Memory
Persistent facts and rules your agents carry across runs.
Memory gives your agents knowledge that persists between runs — without a database or a retrieval step.
Two layers are available:
- Facts — individual statements the agent remembers across runs (e.g. "the customer prefers weekly digests over real-time alerts"). Written by the agent at runtime, extracted from past sessions by a background agent, or added directly in the dashboard.
- Rules — a persistent system-prompt overlay applied on every run. Use this for standing instructions that should never change: tone, hard constraints, workspace-wide policies.
Both Facts and Rules exist at three scopes:
- Workspace-wide — applied to every agent in the workspace.
- Per-agent — applied only to that agent's runs.
- Person — yours. Applied to every agent acting for you, in every workspace you belong to. An agent acts for you when you opened the conversation — from the dashboard, the API or Slack — or when its run was started by a schedule or trigger you set to run as you. Other runs nobody opened (schedules and triggers without that option, agent-to-agent calls) have no person scope.
Per-agent facts and rules are injected after workspace-wide ones, and person facts and rules after both.
How the agent reads memory
Memory is injected automatically at dispatch. When a run starts, the platform prepends the relevant facts and rules to the agent's system prompt. The agent reads them as context — no tool call required, no retrieval logic in the recipe.
Workspace-wide facts come first; per-agent facts follow; the facts and rules of the person the agent acts for come last. Together they form a cumulative overlay that the recipe sees as part of its system prompt.
An agent only ever sees the person scope of the one person it is acting for. Another user's entries are never injected, even when both of you use the same agent in the same workspace.
How the agent writes memory
The agent writes facts using the remember and forget built-in
tools. A call to remember queues a new fact;
forget queues a deletion. The harness drains both queues and persists
the changes at the end of the turn — neither takes effect within the
same run that issued the call. By default a fact written by
remember is scoped to the calling agent; pass scope: "workspace" to
share it with every agent in the workspace, or scope: "person" to
suggest it to the person the agent is acting for. A person fact an agent
writes is a suggestion: it shows under Suggested by your agents with
the agent and workspace it came from, and no agent reads it until you
keep it. That keeps an agent fed untrusted content in one workspace from
steering your agents in every other. Person facts carry who wrote them
(you, or an agent) and when. An agent can forget only the person facts
it suggested itself, never a rule you stated; a retraction reaches every
other agent acting for you on their next turn.
Background extraction
The platform runs a background memory maintainer after each session.
It reads the session transcript and extracts facts worth keeping, then
writes them back through the same remember tool. Extracted facts are
tagged source: maintainer in the dashboard.
A watermark per session prevents re-processing. The maintainer runs on Levain's account and costs you nothing.
To stop it for one agent, switch off Extract facts from conversations
on the agent's Memory tab, or set memory_extraction to false in
the agent's config (PATCH /api/v1/agents/{agent_id} or the
update_agent MCP tool). The workspace's other agents keep it. Facts
already stored stay, and the agent's own remember, search_memory and
forget calls keep working. Switching it back on picks up conversations
that go quiet from then on; the ones that went quiet while it was off are
never extracted.
Manage memory in the dashboard
The Memory panel appears at two places:
- Per-agent — on the agent's detail page, under the Memory tab. Shows only facts scoped to that agent.
- Knowledge base → Memory — your own rules and facts first (the person scope, read by every agent acting for you in any workspace), then the workspace-wide facts and rules overlay. Your section is the same wherever you open it: edit a rule in one workspace and every agent acting for you sees the change on its next turn.
Actions available in both:
| Action | What it does |
|---|---|
| Add fact | Creates a new semantic memory entry (source: user). |
| Delete | Soft-deletes the entry; it stops being injected on the next run. |
| Promote / Demote | Moves a fact between agent scope and workspace scope. |
The Rules tab holds the procedural overlay as a freeform text block. Save your changes and they take effect on the next dispatch.
Over the API, person memories are scope: "person" on
/api/v1/agent-memories (suggestions carry pending: true; keep one with
PATCH {"confirmed": true}, discard it with DELETE), and your rules
overlay is /api/v1/agent-memories/procedural/me. Both need a signed-in
user: API keys belong to a workspace, not a person, and cannot read
anyone's person scope.
Skills — learned procedures
Agents running on the self-learning engine (see Execution engines) go one step further: besides facts, they write skills — small documented procedures the agent authors for itself when it solves something worth repeating. Skills load on demand in later runs, so a workflow the agent figured out once doesn't have to be rediscovered.
Skills appear under the Skills tab on the agent's detail page. Each entry shows the skill's description, size, and how often the agent has used it. Open a skill to read exactly what the agent taught itself; delete it to revoke the behavior — the agent stops loading it from the next session on.
Facts written by a self-learning agent land in the same memory store described above: they show up in the Memory panel, editable and deletable like any other fact, and edits you make there reach the agent on its next turn.
Next
- The Tools primitive covers the
rememberandforgetbuilt-in capabilities the agent uses to write facts. - Wikis store structured knowledge the agent searches on demand — Memory injects context automatically, before the agent decides what to search for.