/
Stateful Agents: Conversational Memory That Actually Works
Your agent works beautifully in testing, handles complex multi-turn conversations, then you refresh the page and... it has no idea who you are or what you were talking about.
That's when you realize you have to spin up a database, handle session management, and then figure out how to make it all work reliably across different models. What should be a simple "remember our conversation" feature becomes a multi-day engineering project.
We've solved this problem with Stateful Agents. Every agent in Toolhouse now maintains persistent conversation state automatically. No database setup, no session management code, no additional infrastructure. It just works.
Why statefulness matters
Long-running workflows become feasible. Your documentation agent can work on a large codebase overnight while you sleep. When you check in the next morning, it remembers exactly where it left off, what parameters you set, and what specific requirements you gave it. No need to re-contextualize or start over.
Agent behavior becomes trainable. When your marketing agent writes that first draft blog post, you can give it feedback: "make this funnier," "use simpler language," or "focus more on technical benefits." With stateful memory, these preferences persist across conversations. Next time you need a blog post, you won't need to repeat the same feedback cycle—the agent already knows your style preferences.
Evaluation and debugging get easier. Full conversation history, including all MCP server calls, is available via API. You can feed this complete interaction log to your evaluation framework to understand exactly how your agent behaves over extended conversations, not just individual message exchanges.
State management happens automatically
State management happens automatically, but you control it through three simple endpoints:
Creates a new conversation and returns X-Toolhouse-Run-ID
in the response headers. This becomes your session identifier.
Appends new messages to an existing conversation state. The agent has full context of everything that came before.
Retrieves the complete conversation history as structured data.
That's it. No schema migrations, no connection pooling, no cleanup jobs.
Built for real world use cases
We built our own documentation agent at help.toolhouse.ai using stateful agents. Each conversation gets a permanent URL that you can bookmark or share with teammates. Everyone sees the exact same conversation thread, complete with context and history.
The implementation is open source: stateful-chat-agent. It's a complete working example of how to build a conversational interface with persistent state, including the frontend components and API integration patterns.
Go stateful today
Stateful agents are available to all Toolhouse users starting today. If you're already using Toolhouse agents, your existing agents now support persistent state out-of-the-box.
The feature works across all agent types and MCP server configurations. Whether you're building customer support bots, code review agents, or complex workflow automation, conversation state persists automatically.
Sign up here to start building stateful agents today.