Quickstart: LangGraph Session Management
Coming Soon
This tutorial is under development. Check back soon!
What You'll Build
A LangGraph agent with persistent conversation memory that:
- Remembers context — Previous messages persist across requests
- Survives restarts — Memory stored in Dapr state, not in-process
- Scales horizontally — Any instance can serve any session
Prerequisites
- Dapr CLI installed and initialized
- Python 3.11+
- An OpenAI API key
Architecture
┌──────────────┐ ┌──────────────┐
│ Request │ │ Request │
│ Session: A │ │ Session: A │
└──────┬───────┘ └──────┬───────┘
│ │
▼ ▼
┌──────────────┐ ┌──────────────┐
│ LangGraph │ │ LangGraph │
│ Instance 1 │ │ Instance 2 │
└──────┬───────┘ └──────┬───────┘
│ │
└────────┬───────────────┘
▼
┌────────────────┐
│ Dapr State │
│ (Session A) │
└────────────────┘
Both instances read/write to the same session state. The user gets consistent memory regardless of which instance handles the request.
Key Concepts
| Concept | Description |
|---|---|
| Session ID | Unique identifier for a conversation thread |
| State Store | Dapr component that persists session data (Redis, PostgreSQL, etc.) |
| Memory Pattern | Store/retrieve conversation history before each LLM call |
| TTL | Optional expiration for inactive sessions |