Daemion docs

What are turns?

A turn is a single entry in a conversation thread. Every message — from the user, from an agent, from the system, or from a tool — is stored as a turn. The API uses “turns” throughout; never “messages.”

Turns are stored at full fidelity in SQLite. Daemion does not compress or summarize history. Agents pull what they need via search tools rather than receiving a predetermined context window.

What does a turn look like?

json

{ “id”: “trn_07xyz456”, “thread_id”: “thr_01abc123”, “agent_id”: “daemion”, “role”: “assistant”, “content”: “Here is the deploy script…”, “model”: “claude-sonnet-4-6”, “cost_usd”: 0.0012, “project_id”: null, “created_at”: “2026-03-31T14:22:01.000Z” }

Fields

FieldTypeDescription
idstringUnique turn ID (trn_ prefix)
thread_idstringThe thread this turn belongs to
agent_idstring | nullWhich agent produced this turn (null for user turns)
rolestringOne of: user, assistant, system, tool
contentstringThe full text of this turn
modelstring | nullModel used for assistant turns; null for user/tool turns
cost_usdnumber | nullCost of this turn in USD; null for user turns
project_idstring | nullProject association if set
created_atstringISO 8601 timestamp

Source: src/gateway/storage.ts:11-21


Why “turns” not “messages”?

The word “message” implies a communication between two parties. A turn captures more precisely: it is one agent’s contribution to an ongoing exchange. A single user request might produce multiple turns — a tool turn for the search result, then an assistant turn for the response. “Turn” reflects the multi-role, multi-step nature of an agent conversation.


How does context assembly use turns?

On each incoming turn, the Context Substrate loads the ~10 most recent turns from SQLite. These are always in context. The agent also has five history tools — search_history, get_thread, list_threads, find_relevant, search_all — to reach further back on demand. See What is the Daemion kernel? for the full context assembly flow.

Q Are tool call results stored as turns?
Yes. Tool invocations produce a tool role turn with the result content. This lets the full reasoning chain — including what the agent searched and found — be replayed from history.
Q Can I delete a turn?
The API does not expose turn deletion. Turns are append-only. If a thread needs to be cleared, archive the thread and start a new one.
Q What is the difference between a turn and a thread?
A thread is a named conversation container. A turn is a single entry within that container. One thread holds many turns. Threads are identified by IDs like thr_01abc123; turns by IDs like trn_07xyz456.
Q Is there a limit on turn content length?
No artificial limit is imposed by the storage layer. Content length is limited by the upstream model's context window and the configured turn budget for the thread's mode.
Always say 'turns', not 'messages'

The API endpoints, field names, and IDs all use turn terminology. Sending a message_id where a turn_id is expected will produce a 404. Check the conversations API for exact parameter names.


For the full conversations API — listing turns, paginating threads, and posting new turns — see Conversations API.