---
id: chat-session-blob
name: Chat Session Blob Storage
version: 1.0.0
summary: Authoritative Azure Blob Storage container owned by the Conversational bounded context for durable AG-UI multi-turn chat session state.
owners:
  - ai-capabilities-team
container_type: objectStore
badges:
  - content: Object Storage
    backgroundColor: teal
    textColor: teal
technology: azure-storage-account
authoritative: true
access_mode: readWrite
purpose: Stores durable Chat conversation session state across container restarts.
classification: confidential
retention: indefinite
residency: eastasia
styles:
  icon: /icons/database/blob.svg
---

## Purpose & Ownership Boundary

Chat Session Blob Storage (`chatting-blob`) is the authoritative Azure Blob Storage container owned exclusively by [[service|chat-api]] in the Conversational bounded context. Object storage persists durable AG-UI multi-turn conversation sessions under the `ag-ui/` prefix so chat continuity survives container restarts without introducing a relational database or Redis dependency into [[service|chat-api]].

## Data Store Profile

| Property                            | Value                                                                          |
| :---------------------------------- | :----------------------------------------------------------------------------- |
| **Bounded Context / Owner**         | Conversational — [[team\|ai-capabilities-team]]                                |
| **Engine / Technology**             | Azure Blob Storage (Azure Storage Account in cloud; Azurite emulator locally)  |
| **Store Type**                      | Object Storage                                                                 |
| **Primary Writer(s)**               | [[service\|chat-api]]                                                          |
| **Primary Reader(s)**               | [[service\|chat-api]]                                                          |
| **Authoritative / Source of Truth** | Yes                                                                            |
| **Data Classification**             | Confidential                                                                   |
| **Retention / TTL Policy**          | Indefinite (no automatic lifecycle TTL configured in infrastructure templates) |

## Logical Data Layout & Key Patterns

| Container / Prefix          | Stored Data                                          | TTL / Eviction                                                    | Invalidation / Update Trigger                           |
| :-------------------------- | :--------------------------------------------------- | :---------------------------------------------------------------- | :------------------------------------------------------ |
| `chatting-blob` / `ag-ui/*` | Serialized AG-UI workflow conversation session state | Indefinite (verify any externally managed Azure lifecycle policy) | Updated per conversation turn by [[service\|chat-api]]. |

Conversational state is intentionally split by concern: AG-UI workflow sessions live in `chatting-blob`, long-term user reading preferences live in Microsoft Foundry memory, agent scratchpads live on local ephemeral filesystem storage, and business domain records remain in their owning service stores.

## Consistency, Isolation & Security Guardrails

- **Confidential data & PII masking:** Conversation transcripts can contain customer preferences and session context even though Presidio PII middleware masks detected PII before model calls and outputs. Public blob access is disabled (`AllowBlobPublicAccess = false`), and access is restricted to [[service|chat-api]] via Managed Identity RBAC (`StorageBlobDataContributor`).
- **Startup readiness:** [[service|chat-api]] waits for `chatting-blob` health before accepting `/ag-ui` traffic.
- **No domain state leakage:** Business entities (books, baskets, orders, reviews) are never persisted in `chatting-blob`.

:::warning
**Strict Single-Service & Shared Account Isolation:** `chatting-blob` shares the Azure Storage Account with [[container|catalog-blob]] and Azure Functions host storage. No other BookWorm service or agent may read or write `chatting-blob` directly; all conversational interactions must flow through [[service|chat-api]].
:::

## Operational & Resilience Notes

<AccordionGroup>
	<Accordion title="Hosting, redundancy, and environment parity">
		- **Local vs. Cloud:** Local development uses a persistent Azurite emulator with Azure Storage
		Explorer; cloud environments use Azure Storage Account with TLS 1.2 minimum (`StandardLrs` in
		Dev, `StandardZrs` in Staging, `StandardGzrs` in Production). - **Retention governance:**
		Because no automatic blob lifecycle policy is declared in repository infrastructure templates,
		coordinate any GDPR/retention purge policies directly at the Azure Storage Account level.
	</Accordion>
</AccordionGroup>

## Architecture Visualizations

<NodeGraph />

<MermaidFileLoader file="mermaids/chat-session-blob-diagram-1.mmd" />

## Related Documentation

- [[service|chat-api]] — Owning AG-UI server, multi-agent workflow, and Microsoft Entra ID policies.
- [[agent|book-agent]] — Primary conversational agent operating over AG-UI sessions.
- [[container|catalog-blob]] — Sibling container on the shared Azure Storage Account.
- [[doc|operational/005-backup-restore-and-dr]] — Platform backup, restore, and disaster recovery runbook.
