Ports
Durable agent memory & context management
An agent that forgets everything between runs cannot accumulate judgment. eli.ai gives every agent durable memory through the portable kb_memorytool, keeps long runs inside the model's context window with token-budget compaction, and can optionally apply harness groundedness to what the agent writes. All three are provider-agnostic — they work on any model, self-hosted, with no vendor-specific features.
Lifecycle
Agent memory — lifecycle
Memory is recalled at run start, updated during the run, and persists to the next one.
Downloads
Concepts
- Agent memory
- Lifecycle
Keywords
- kb_memory.recall (load per-agent memory)
- kb_memory.remember (persist a durable fact)
- kb_memory.forget (retract)
- reason + call tools
- token budget exceeded?
- summarize older turns, keep facts
- memory persists to next run
Source and generation provenance
Status: current
Generated at: 2026-08-12T23:36:22.127Z
Source hash: 3e76f14ca31f7d662731c42b83490b997e0bf60de0b4d1a9fe6ab85e1914a1d5
Metadata payload hash: 227b97db99258e550fab56325dd2dfc87c3b7a9540aaa1aaaa280b7338012401
Canonical appearance
src/app/(docs)/docs/concepts/agent-memory/page.tsx:29 route /docs/concepts/agent-memory
All appearances
canonical—src/app/(docs)/docs/concepts/agent-memory/page.tsx:29route/docs/concepts/agent-memory
No mirrored appearances.
Generation versions
App: eli-ai 0.1.0
Mermaid: 11.16.0 · Mermaid CLI: 11.16.0
Node: v26.3.1 · Yarn: 4.17.1
Renderer config hash: 68c10966fe84406ee626034d58bfabd555df9f65f691204b7c46db24038da101
Renderer theme hash: c80287a78d80ad63d27bd5ca348b2ef9a7e2f44da289e436be6484ea28a1b033
Adapter versions: diagramGenerator=2, drawioFlowchart=1, drawioGantt=1, drawioSequence=1, drawioState=1
Full sidecar JSON: agent-memory-lifecycle-3e76f14c.json
The kb_memory tool
kb_memory is a first-class harness tool with three operations, backed by the agent_memory table and scoped per agent within a workspace:
- remember— persist a durable fact or preference ("the client capitalizes 'the Platform'", "prefer FY over CY in summaries") with an optional key so it can be updated later.
- recall — retrieve stored memories, by key or by relevance, to load standing context at the start of or during a run.
- forget— retract a memory that is stale or was wrong, so bad state doesn't compound.
Because memory lives in the database and not in a single run's transcript, it survives across runs: a scheduled agent that runs nightly builds on what it learned yesterday, and an interactive agent remembers a correction you made last week. Memory is per-agent, so two agents in the same workspace keep separate notebooks and never cross-contaminate.
Memory is scoped and tenant-safe
kb_memoryoperation runs under the workspace's row-level security and is keyed to the agent. One workspace's memory is never visible to another, and one agent's memory is never visible to another agent — memory obeys the same tenancy rules as the rest of the platform.Context compaction
A long run — many tool calls, large retrieved chunks — will eventually overflow the model's context window. eli.ai applies portable, token-budget compaction: as the working context approaches its budget, older turns are summarized into a compact running state while durable facts and the active task are preserved verbatim. The agent keeps going instead of hitting a wall or silently truncating.
- Budget-driven. Compaction triggers on a token threshold, not a fixed turn count, so it adapts to how heavy each turn actually is.
- Facts over transcript. Summarization protects what matters —
kb_memoryentries and the current objective survive; verbose intermediate tool output is what gets compressed. - Model-agnostic.It is implemented in the harness, so it works identically on a frontier model or a local one — no reliance on a provider's own context features.
Optional harness groundedness
The harness can optionally apply a groundedness check to what an agent produces, reusing the shared judgeAssertionsengine so an agent's claims are held to the same standard as a chat answer. Like interactive chat it defaults to flag-only, surfacing a verification signal without hard-blocking a run. See Retrieval & grounded chat and Judge governance.
Provider-agnostic Tier-1, by design
kb_memory, token-budget compaction, and harness groundedness are the Tier-1, provider-agnostic implementations: they run on any model on any host with no vendor-specific dependency. Anthropic-native memory and context-editing are a future optimization that a cloud-OK workspace can layer on for efficiency — but the portable path is the default and is fully self-hostable.Related
- Agents & the harness — the durable run loop memory plugs into.
- Tools, MCP & HITL — how
kb_memorysits alongside other tools.