Session Metadata and Storage
SDK Session metadata, message files, and directory layout
Session Metadata and Storage
SDK sessions are persisted by default under:
<projectRoot>/.downcity/agents/<agentId>/sessions/<sessionId>/messages/messages.jsonlThe same directory also contains:
<projectRoot>/.downcity/agents/<agentId>/sessions/<sessionId>/messages/meta.jsonand the in-progress assistant snapshot:
<projectRoot>/.downcity/agents/<agentId>/sessions/<sessionId>/messages/inflight.jsonWhy storage is partitioned by agentId
Because multiple SDK agents can exist inside the same project directory.
agentId keeps their session data isolated.
This is also one of the reasons why id should not be treated as a casual display string.
What you can usually find here
- message history
- in-progress assistant snapshot
- session metadata
- archive directories
messages.jsonl stores stable history.
inflight.json stores the current unfinished assistant UIMessage. During multi-step tool execution, the SDK keeps rewriting this snapshot so already-produced text and tool parts survive interruptions. When execution finishes normally, the final assistant message is committed into messages.jsonl and inflight.json is removed.
If you are troubleshooting, replaying history, or running multi-agent experiments, this persisted data is extremely useful.
meta.json
meta.json stores the lightweight fields used by session lists and detail views:
sessionIdagentIdtitlemodelLabelcreatedAtupdatedAttimezone
title is persisted. After the first user message, the SDK first tries to generate a title with the configured model. If generation fails, it writes a truncated version of the first user message as title.