Memory model
How MarkDB turns raw agent traffic into structured, searchable memory.
MarkDB captures agent traffic as events, then derives higher-level artifacts from them.
Events
Every mirrored exchange becomes an event tied to a session:
user_message,assistant_message,system_messagetool_call,tool_resultsession_started
Events are de-duplicated by content hash, so a client that replays history on each request doesn't re-store the same turn twice.
Pages and summaries
The enrichment worker rolls events up into pages -- compact, summarized artifacts that are cheaper to retrieve than raw transcripts:
- Turn summaries - one user/assistant exchange.
- Session summaries - a working session.
- Chat summaries - an entire conversation thread.
- Trace summaries - tool-use sequences.
Why this matters
Long agent histories are mostly noise. By summarizing at multiple levels and indexing both the raw and summarized forms, MarkDB lets you recall what happened without re-reading every token. Retrieval prefers summaries for context and falls back to exact turns when you need detail.
See Enrichment for how summaries are produced and Hybrid search for how they are retrieved.