Vol. II · Production Doctrine · II.7
Unify Execution and Business State
Factor 5: there is one serializable blob. The ticket is the agent state. A second 'agent memory' that drifts from the business object is how you lose the thread and the customer.
6 min read
Doctrine
- Put business fields and loop fields in one document you can serialize, checkpoint, and show a human.
- Tool results become fields on that document, not a parallel transcript store.
- If you cannot reconstruct the next LLM call from the blob plus pinned prompts, you do not own state.
One blob, two readers
The model reads a projection of the blob (the context builder). The product reads the same blob (the ticket UI). LangGraph checkpoints and Inngest runs are this idea with different storage. Letta persists memory as state; the call is still a reducer step over one document.
When a human approves a refund, they are editing the blob. When the agent resumes, it reads the blob. There is no third place.
Anti-patterns
- An 'agent_memory' table and a 'tickets' table that disagree after a retry.
- Hiding step count, pending tool calls, and approval gates outside the blob.