▶️ Watch the video tutorial (10 minutes)
Our agent looks up real orders and pulls customer history. Ask it about order 1042 and you get the status, total, customer name. Then you follow up with "can I return it?" and the agent has no idea what order you're talking about. Every message is a fresh start. The conversation is gone.
In this episode we give the agent memory. The SDK has a Conversational interface and a RemembersConversations trait that stores and loads chat history through the database tables we set up back in Episode 1. I walk through three conversation patterns: starting a new one tied to a user, continuing an existing one by passing the conversation ID, and resuming the last session automatically.
I build a ChatController with a send endpoint that handles both new and continuing conversations, then test the full flow. Ask about an order, follow up about returning it, and the agent keeps the context. It knows what "it" refers to because it remembers what came before.
I also cover the messages method for cases where you want manual control over how history is stored and loaded, like if you're using Redis or a custom storage layer instead of the default database tables.
Next episode we're building a knowledge base with embeddings so the agent can answer policy questions from actual documentation instead of guessing.