By Sagar Shankaran, Founder of CallSphere
State management is the unglamorous part of chatbots that decides whether they survive scale. The 2026 patterns and where they break.
Key takeaways
Chatbots have state across many dimensions: the current message, the conversation history, user preferences, transient task state, persistent facts, and global config. Decide poorly where each piece lives and you get bots that forget mid-conversation, leak across users, or scale poorly.
This piece walks through the 2026 state-management patterns that hold up.
flowchart TB
L1[Layer 1: Request state<br/>per-message] --> Lifetime1[Lifetime: one turn]
L2[Layer 2: Session state<br/>conversation] --> Lifetime2[Lifetime: minutes to hours]
L3[Layer 3: User state<br/>per-user] --> Lifetime3[Lifetime: account life]
L4[Layer 4: Tenant state<br/>per-customer org] --> Lifetime4[Lifetime: contract life]
L5[Layer 5: Global state<br/>shared across all] --> Lifetime5[Lifetime: indefinite]
Each layer has different storage, different retrieval patterns, and different security implications.
In-memory only. Lives for the duration of a single message. Includes:
No persistence. Lost on restart. Logged for observability.
Conversation-level state. Lives across turns within a session.
Hear it before you finish reading
Talk to a live CallSphere AI voice agent in your browser — 60 seconds, no signup.
Storage: typically Redis or a session store. TTL based on inactivity.
Per-user, persistent. Lives across sessions:
Storage: relational DB plus vector store for semantic memory. Lifetime aligned with the user's account.
Per-customer-organization. Configuration that varies per tenant:
Storage: configuration management; cached in process memory.
Shared across all users and tenants:
Storage: typically version-controlled config plus metrics database.
Still reading? Stop comparing — try CallSphere live.
CallSphere ships complete AI voice agents per industry — 14 tools for healthcare, 10 agents for real estate, 4 specialists for salons. See how it actually handles a call before you book a demo.
flowchart LR
Msg[Incoming message] --> Tenant[Lookup tenant state]
Tenant --> User[Lookup user state]
User --> Session[Lookup session state]
Session --> Run[Run agent turn]
Run --> Persist[Persist updates]
Five lookups in order: tenant → user → session → request → run. Persist on the way back.
Multi-message conversations have ordering questions:
The 2026 pattern that works:
Race conditions on session state need careful handling. The Redis transaction pattern (WATCH / MULTI / EXEC) covers most cases.
| Layer | Typical Store |
|---|---|
| Request | In-memory |
| Session | Redis or session DB |
| User | Postgres + vector |
| Tenant | Config + cache |
| Global | Version-controlled config + DB |
For a CallSphere chat agent:
RequestState:
message_id, tenant_id, user_id, session_id, raw_text, processed_text,
tool_calls_in_this_turn, llm_calls_in_this_turn, decisions_made
SessionState:
conversation_history (recent N), active_task, language_pref,
authenticated_user, last_activity_ts
UserState:
profile, semantic_memory_id, conversation_summaries,
auth_credentials (no PII in cache)
TenantState:
brand_voice, available_tools, compliance_flags, custom_prompts
Each is loaded with a clear function and a clear cache strategy.
Every state read and write should be logged with the layer, the key, and the request context. Without this, debugging "why did the bot forget X" is impossible.

Written by
Sagar Shankaran· Founder, CallSphere
LinkedInSagar Shankaran is the founder of CallSphere, where he builds production AI voice and chat agents deployed across healthcare, hospitality, real estate, and home services. He writes about agentic AI, LLM engineering, and shipping voice agents that handle real calls in production.
See how AI voice agents work for your industry. Live demo available -- no signup required.
A founder's guide to page chat: web page chat box options, best live chat for small business, and how CallSphere ships an embed in 5 minutes.
A founder's guide to building a chatbot for answering questions on your website: RAG, voice, and how CallSphere ships one in 3-5 days.
When to use Pinecone vs pgvector vs Qdrant vs Weaviate. A decision framework that maps team size and workload to the right pick without endless evaluation loops.
How leaders should think about Claude Sonnet 4.6 cost — adoption patterns, ROI, competitive dynamics, and what model selection means for the next 12 months.
The cautious-Claude trope tested against real production data. Where it's true, where it's false, and how routing plus prompting closes most of the gap.
Public refusal benchmarks show Claude declines legitimate enterprise prompts more than peers. Here is how to quantify the cost and engineer around it.
© 2026 CallSphere Inc. All rights reserved.
Made within San Francisco
Watch how CallSphere handles real customer calls, schedules appointments, and processes payments — live.
Try Live DemoBook a DemoCalculate Your ROI