State and storage
Home directory and files explains configuration, extension, and runtime file purposes. Operators inspecting the two SQLite databases should use session records and SQLite. This page defines the write and recovery contracts for indexes, bindings, and graph state.
| Task | Where the data lives | What it contains |
|---|---|---|
| Resume a conversation or a waiting human interaction | Server runtime/checkpoints.sqlite |
LangGraph messages, graph state, and pending execution position. Recovery prefers the checkpoint recorded by the session index |
| List sessions belonging to one user | sessions in runtime/sessions.sqlite |
Title, timestamps, current status, last turn ID, and checkpoint ID |
| Determine readable inputs and output location for a session | session_bindings in the same database |
Input-directory list and final output directory bound at session creation |
| Inspect reports or charts | Actual output directory, defaulting to <home>/outputs/<user>/<thread>/ |
Agent-generated business files, including offloaded content referenced by messages |
| Analyze call order, latency, and errors for one turn | Session traces/ directory |
Root-execution OTLP JSON, linking model, tool, and subagent calls |
| Analyze startup, connection, or interface errors | runtime/logs/ |
Separate backend, Web, and TUI runtime logs |
Traces record observations produced by an actual turn. Recovery uses checkpoints, session bindings, and dependent business files. Preserve original binding paths and checkpoint-referenced outputs when archiving or migrating. A trace or session-list backup alone cannot restore graph state.
Session index
sessions has primary key (user_id, thread_id) and additionally requires thread_id to be unique within one Home. submitted_runs independently registers (thread_id, run_id) to reject duplicate submissions. Titles use the first 100 characters of user text after collapsing whitespace. The SDK shares the binding table but does not read or write the server session index. Hosts are responsible for state isolation when multiple callers share a checkpointer.
Starting a turn writes running; successful completion writes completed; failure writes error; cancellation or disconnection writes interrupted. Process startup changes leftover running sessions to interrupted. Failed or cancelled turns update their checkpoint when messages have been saved; otherwise they retain the previous position.
REST pauses awaiting human input write waiting_for_input. A2A uses internal index status waiting, which REST exposes as interrupted. A2A's default in-process TaskStore loses tasks on restart; see A2A human feedback for recovery scope. See session detail for REST reads and recovery.
Session bindings
session_bindings stores input lists and final output directories by (user_id, thread_id). Only a missing binding causes open_session(create=True) to open a short-lived connection, acquire BEGIN IMMEDIATE, validate output ownership, and register the binding. Concurrent requests in one Home cannot register overlapping directories. Resuming an existing binding reads this session, validates paths, and ensures directories exist without requesting a write lock or scanning other sessions. Both build_graph and create_agent use this path.
Bindings are stored in Home's database. No control marker is needed in a business directory even when outputs live outside Home.
for_session() resolves saved paths without writing the database or checking that original inputs remain available. REST output listing and preview use this path, allowing outputs to be browsed after original inputs have been deleted. Execution recovery uses open_session(), which checks that bound input directories still exist and are readable.
Permissions and ownership
Opening a session sets runtime/ and its session state directories to 0700. When outputs are in Home's default area, <home>/outputs and the corresponding first-level directory also use 0700. New business directories beneath them inherit the process umask. Existing business-directory permissions and custom directories outside Home are not reset. Business directories retain offloaded files that checkpoints may reference; see sessions and outputs.
backend.lock allows only one server to run against the same Home at a time. The OS authorizes file access. Home, user, and session directory allocation constrains application ownership; see security boundaries for its security implications.
Implementation and verification: paths and bindings, session index, output-directory tests, and file-access boundary tests.