11# Agent Ledger
22
33Agent Ledger is a framework-neutral specification and a set of polyglot adapters for durable agent
4- sessions. It records model and tool attempts before execution, preserves causal timelines across
5- distributed agents, and lets each framework rebuild its own native session after interruption .
4+ execution records. Agent loops and orchestrators append to the same session history, producing a
5+ causal account of model calls, tool calls, delegation, framework- native state, and outcomes .
66
77The specification is the stable product. Language SDKs are deliberately small; most project code
88lives in adapters that understand a framework's hooks, messages, checkpoints, and resume APIs.
99
10+ ## Architecture position
11+
12+ Agent Ledger is not another agent loop or workflow engine. It is a shared evidence layer across
13+ both:
14+
15+ ``` text
16+ Orchestrator ── decisions, delegation, approvals ──┐
17+ ├── Agent Ledger session
18+ Agent loops ── steps, attempts, native state ──────┘ │
19+ ├── recovery
20+ ├── global timeline
21+ └── analysis / evaluation
22+ ```
23+
24+ An orchestrator owns desired state, scheduling, and run ownership. Each agent framework owns its
25+ native context and resume API. Agent Ledger owns the immutable facts that let those systems explain
26+ and reconstruct what happened.
27+
1028## Model
1129
12- - ` Session ` groups one end-to-end task across processes, languages, and agents.
13- - ` Run ` identifies one semantic agent execution and participates in the causal DAG.
30+ - ` Session ` groups one end-to-end task across processes, languages, agents, and orchestration runs.
31+ - ` Run ` identifies one semantic execution by an agent or orchestrator and participates in the
32+ causal DAG.
1433- ` EventStream ` is an optimistic-concurrency partition. It may contain one run's execution events or
1534 framework-native state that survives several runtime runs.
1635- ` Step ` is logical work that survives retries; ` Attempt ` is one physical model or tool invocation.
1736- Normalized events are the source for timelines and trajectories. Framework-native records are the
18- source for resume.
37+ lossless input to framework-owned resume.
1938
2039Requested events are committed before an external call. A requested event without a terminal event
2140is unresolved after a crash. It is input to the adapter's reconciliation policy; an adapter must
@@ -31,7 +50,7 @@ not silently replay a side-effecting tool.
3150| ` typescript/ ` | TypeScript core SDK and Pi adapter |
3251| ` go/ ` | Go core SDK and AgentGo adapter |
3352
34- Current framework profiles:
53+ Current framework profiles are integration examples, not definitions of the core session model :
3554
3655| Adapter | Recording | Recovery |
3756| --- | --- | --- |
@@ -42,6 +61,10 @@ Current framework profiles:
4261Every adapter publishes machine-readable capabilities such as ` strict ` , ` best_effort ` , and
4362` unsupported ` ; installing a telemetry-only hook never silently claims durable recovery.
4463
64+ Pi's append-only session tree is preserved in a dedicated framework stream because Pi needs it for
65+ lossless reconstruction. Its entry types, active leaf, and branching rules remain Pi-owned rather
66+ than becoming requirements for other agents or orchestrators.
67+
4568## Store contract
4669
4770Applications inject an ` EventStore ` . V1 has no mandatory collector or ` /agent-session ` service:
@@ -69,3 +92,5 @@ make build
6992
7093See [ RFC 0001] ( spec/rfcs/0001-agent-ledger.md ) for the ledger contract and
7194[ RFC 0002] ( spec/rfcs/0002-polyglot-adapters.md ) for framework recording and recovery boundaries.
95+ The [ orchestrated agents example] ( python/examples/orchestrated_agents.py ) shows an orchestrator and
96+ multiple agent loops contributing to one causal session.
0 commit comments