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.

Memory tiers

TierScopeLifetimeMechanism
SessionSingle agent runEphemeralContext window
War-roomOne epicPlan durationchannel.jsonl, files
GlobalAll roomsPersistentShared memory ledger

Entry kinds

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"]}

Publishing entries

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.

Superseding entries

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.

Querying memory

memory_query with structured filters:

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

All filters are optional and combinable.

Tag strategies

PatternExamplePurpose
Module nameauth, billingFind domain-related entries
Artifact typemodel, routeFind specific file types
Technologypostgresql, redisFind tech decisions
Boundaryapi-contract, schemaFind shared interfaces

Monitoring

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'

Debugging

SymptomCauseFix
Agent can’t find interfaceWrong tagsMatch tags between publisher and consumer
Stale dataEntry not supersededPublish with supersedes field
Too many resultsBroad queryAdd kind or tags filters
Empty resultsWrong room filterUse memory_search (searches all rooms)

Bounds

LimitValue
Summary max4 KB
Detail max16 KB
Max query results50
Default search results10

Best practices

  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.