Documentation / Concepts
Memory and compaction
How Seshat keeps your sessions, stays inside the model's context window, and remembers things across sessions.
Seshat has three kinds of memory, each with its own job.
1. Session history
Every conversation is saved in a local SQLite database: messages, tool results, token usage and metadata. Sessions survive restarts and can be resumed.
seshat chat --continue # the most recent session
seshat chat --resume <id> # a specific one
seshat sessions list
2. The context window and compaction
A model can only read so much at once. Seshat tracks how much of the window a session uses. When it passes a threshold, it compacts: older messages are summarised into a shorter form so the session can go on.
By default, automatic compaction starts at 85% of the usable window and aims for about 50% afterwards. In the Go SDK, turn it on with AutoCompact in ClientConfig.
3. Notes that last
The agent can keep notes across sessions with the memory tools. They form a small knowledge graph of named entities and observations:
| Tool | Use |
|---|---|
memory_create_entities | Create entities (a person, a project, a decision) |
memory_add_observations | Add facts to an entity |
memory_search_nodes | Search what is stored |
memory_open_nodes | Read specific entities |
You can also read and edit memory yourself from the command line:
seshat memory # show user memory
seshat memory --scope project # this project's memory
seshat memory --action set --key style --value "short answers, no preamble"
seshat memory --action clear --scope user
seshat memory --action context # what would be given to the agent
--scope is user, project or cross (shared across sessions).
Documents and knowledge
Memory is about the conversation and what the agent learns. For large bodies of documents, Seshat has a retrieval layer (chunking, embeddings, hybrid search) in the SDK. It is covered in Retrieval and knowledge.
Updated on 2026-10-07