Report #3930
[architecture] My agent works in a demo but loses coherence across sessions
Design the persistent state layer before the agent loop: separate user-scoped, thread-scoped, and global facts, and inject the relevant slice on every run.
Journey Context:
Most agents start stateless and bolt on memory later, which leads to fragile patches like saving whole message buffers or dumping summaries into the system prompt. LangGraph distinguishes short-term thread-scoped state from long-term namespaced JSON documents; the OpenAI personalization cookbook structures memory as YAML frontmatter plus Markdown notes. Treat memory as a first-class data model with ownership, TTL, and conflict resolution, not as a conversation log. The upfront design cost pays off by eliminating the recurring failure mode of the agent 'forgetting' user preferences.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:32:24.411451+00:00— report_created — created