Agent Memory

What an agent has remembered and where each piece came from. Distinct from retrieval: these are injected into every future run whether relevant or not, which is why a person has to be able to inspect and delete them.

src/components/ui/agent-memory.tsx

About

From the component's own source, where it was written.

What an agent has remembered, and where each piece came from.

Distinct from RetrievalResults, which shows what one query pulled back. This is the durable store — the things that will be injected into *every* future run whether they are relevant or not, which is why it needs to be inspectable and editable by a person.

**Provenance is mandatory in the type, not optional.** A memory with no source cannot be audited, and an agent that has silently learned something wrong is exactly the case this screen exists for. source is required.

Pinned entries sort first and are exempt from eviction — they are the ones a person asserted, as opposed to the ones the agent inferred.

Install

npx astralyx-ui add agent-memory

Usage

import { AgentMemory } from '@/components/ui/agent-memory'

<AgentMemory entries={entries} onPin={pin} onForget={forget} />

Composer

Change the props and the source below follows.

  • Ada prefers British spelling and metric units in all generated copy.

    user:ada · stated12 Augweight 0.90preferencepinned
  • The staging database is reset every Sunday at 03:00 UTC — data written before then is gone.

    run:8841 · inferred28 Augweight 0.60fact
  • Refunds above £200 always need a human. The agent proposed one at £340 and was blocked.

    run:9102 · correction3 Sepweight 0.95correction
  • The team calls the billing service “ledger”, not “payments”.

    thread:eng-41271 Sepweight 0.40fact
Props

No props to configure.

tsx
<AgentMemory entries={entries} onPin={pin} onForget={forget} />

Examples

Inspecting and editing memory

API

Generated from the source, so it cannot fall behind the code. One table per exported component, then hooks, functions and types.

AgentMemory

Extends Omit<ComponentProps<'div'>, 'onSelect'>.

PropTypeDefaultDescription
entriesMemoryEntry[]required{ id, content, source, at?, importance?, pinned?, kind? }.
onPin(id: string, pinned: boolean) => void——
onForget(id: string) => void—Deleting a memory is a normal operation, not an admin one.
searchablebooleantrue—
searchPlaceholderstring'Search memory…'—
searchLabelstring'Search memory'—
pinLabelstring'Pin'—
unpinLabelstring'Unpin'—
forgetLabelstring'Forget'—
emptyLabelstring'Nothing remembered yet'—
emptyHintstring'Memories appear here as the agent learns them.'—
sourceLabel(source: string) => ReactNode(source) => source—

Types

MemoryEntry

What an agent has remembered, and where each piece came from.

FieldTypeDescription
idstring—
contentReactNode—
sourcestringRequired in the type, not optional. A memory with no provenance cannot be audited, and an agent that has silently learned something wrong is exactly what this screen exists for.
at?stringAlready formatted — this component does not own your locale.
importance?number0–1. How strongly it is weighted at retrieval time.
pinned?booleanSorts first and is exempt from eviction — the things a person asserted, as opposed to what the agent inferred.
kind?stringFree-form grouping — 'preference', 'fact', 'correction'.