Skip to content

Memory Usage

The memory system lets agents share knowledge across war-rooms. Since each room is isolated, memory is the only way for one agent to know what another has built or decided.

Tier Scope Lifetime Mechanism
Session Single agent run Ephemeral Context window
War-room One epic Plan duration channel.jsonl, files
Global All rooms Persistent Shared memory ledger

Every memory entry has a kind. OSTwin supports six:

Files created or modified. Tells other agents what exists.

{"kind": "artifact", "summary": "Created src/models/user.py with User, Role models", "tags": ["models", "user"]}

Use the memory_publish MCP tool:

{
"kind": "interface",
"summary": "UserService.create_user(email: str, password: str) returns User",
"tags": ["service", "users"],
"room_id": "room-002",
"author_role": "engineer",
"ref": "EPIC-002",
"detail": "Full method signature with error handling..."
}

The detail field supports up to 16KB — use it for full schemas or code. The summary (max 4KB) appears in search results.

When an interface changes, publish a new entry with supersedes:

{"kind": "interface", "summary": "POST /api/v1/users — now requires {email, password, name}", "supersedes": "mem-001-abc"}

Superseded entries are excluded from queries.

memory_query with structured filters:

{"kind": "interface", "tags": ["api", "users"], "room_id": "room-002"}

All filters are optional and combinable.

Pattern Example Purpose
Module name auth, billing Find domain-related entries
Artifact type model, route Find specific file types
Technology postgresql, redis Find tech decisions
Boundary api-contract, schema Find shared interfaces

List all entries with memory_list_memories:

{"kind": "interface"}

Returns {id, ts, kind, room_id, ref, tags, summary_preview} without the full detail.

Watch the ledger for real-time changes:

Terminal window
watch -n 5 'cat .agents/memory/ledger.jsonl | jq -c "{kind, room_id, summary}" | tail -20'
Symptom Cause Fix
Agent can’t find interface Wrong tags Match tags between publisher and consumer
Stale data Entry not superseded Publish with supersedes field
Too many results Broad query Add kind or tags filters
Empty results Wrong room filter Use memory_search (searches all rooms)
Limit Value
Summary max 4 KB
Detail max 16 KB
Max query results 50
Default search results 10
  1. Publish early. Other rooms wait for your interfaces. Publish API contracts at design time, not after implementation.
  2. Use the detail field. A summary like “created user model” is useless without the actual schema.
  3. Tag for consumers. Think about what the searching agent would type.
  4. Supersede, don’t duplicate. Changed interfaces need supersedes, not new entries alongside old ones.
  5. Query before coding. Every epic should start by checking memory for existing conventions and schemas.