Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

ADR-004: Keep Chat workflow sessions in memory

The Chat workflow uses an in-memory session store and does not treat conversation history as durable business data.

November 4, 2026AcceptedData

1. Context & Problem

The conversational workflow needs short-term session state to coordinate an ongoing exchange with a customer. However, permanently storing full conversation histories would introduce significant data-retention, privacy, availability, and lifecycle management obligations beyond what the current chat workflow requires.

The service also needs a clear boundary between temporary interaction state, authoritative business records (such as catalog, basket, or order data), and any future user-scoped personalization memory feature.

2. Business Value

  • Reduced privacy and compliance overhead: Avoids retaining full conversational transcripts and the associated retention, access, and deletion obligations when durable history is not required.
  • Simpler operations and lower cost: Eliminates the need to provision, replicate, back up, and purge a persistent transcript database for routine workflow sessions.
  • Clear data boundaries: Prevents temporary chat scratchpad state from being mistaken for durable business records or long-term customer profiles.

3. How It Works

  • During an active conversation, the chat workflow holds interaction state in temporary, in-memory storage on the running service instance.
  • Conversation history is treated purely as transient workflow state—it is not an authoritative business record and is not expected to survive service restarts or move seamlessly between service instances.
  • This rule governs workflow sessions only. It does not prevent a separately designed personalization feature from storing approved, user-scoped preferences or summaries under dedicated identity, privacy, retention, inspection, and deletion controls.

4. Trade-offs & Lessons Learned

  • No cross-restart or cross-instance recovery: Deployment, scaling, and failover behavior must not assume a shared, durable session database exists.
  • Explicit design required for durable features: Any future business requirement for persistent chat history, cross-instance continuity, or formal retention controls must go through a dedicated storage, identity, privacy, and lifecycle decision rather than silently modifying the session store.
  • Alternatives considered:
    • Persist full conversation history: Would enable recovery and continuity, but makes the service responsible for retaining, protecting, and deleting full transcripts outside the current workflow’s needs.
    • Use a shared distributed session store: Would let session state survive instance changes, but introduces a shared persistence dependency and its operational lifecycle without a current requirement for that guarantee.
    • Treat session state as long-term user memory: Workflow session state is scoped to a single interaction and lacks verified customer ownership, explicit memory controls, and retention rules; cross-session personalization requires a separate design.

5. Technical Reference

  • Target scope: Chat APIServicev1.0.0Chat APIInternal HTTP host for BookWorm's interactive multi-agent chat workflow, agent discovery, and session persistence. Ownerai-capabilities-teamDiagramRepositoryOpen docs within Chat SystemSystemv1.0.0Chat SystemInternal system that hosts BookWorm's conversational workflow and specialist AI agents for customer support and catalog-...Ownerai-capabilities-teamDiagramRepositoryOpen docs.
  • Session store behavior: The composed Chat workflow uses an in-memory session store scoped to the lifetime of the running service instance; no durable transcript store or shared distributed session database is used.
  • Related proposal: User-scoped episodic and semantic memory described in ADR-006: Add user-scoped episodic and semantic memory to BookAgentDecision Recordv1.0.0ADR-006: Add user-scoped episodic and semantic memory to BookAgentProposes private, cross-session memory so BookAgent can use past book discussions and stated reading preferences, while ...Ownerai-capabilities-teamOpen docs remains proposed and does not change the current in-memory session-store behavior.