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
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.