Skip to main content
Persists message history across turns using Redis and WithConversation. Runs with the same conversation ID share context across multiple Run calls. Source: examples/agent_with_conversation/

What it demonstrates

  • conversation.Config with Redis backend
  • AgentRunOptions.ConversationOptions.ID per run
  • Interactive REPL (no args) or single-turn CLI prompt

Run

From examples/:
Interactive mode accepts multiple prompts until you type exit.

Key code

Use a distributed store (Redis, not in-memory) when agent client and worker run in separate processes. See Conversation.

Expected output

Redis persists the session between process restarts. The same CONVERSATION_ID (or session-123 default) replays history on the next go run.

Learn more

Conversation

Backends and session scope

Stream + Conversation

Streaming with persisted history