Session storage is the simplest of the three memory layers: the agent remembers what was said earlier in the same conversation thread. It’s on by default for Agno-backed agents and lives in a per-agent Postgres schema xpander manages for you. Every thread has its own history. As long as messages share aDocumentation Index
Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
Use this file to discover all available pages before exploring further.
session_id, the agent sees the full history up to the configured limit. Start a new thread and the slate is clean.
Multiple users can share a thread and they see the same conversation, but it’s still self-contained.
Session storage is wired in automatically only for Agno. The SDK helpers on this page raise
NotImplementedError on LangChain, OpenAI Agents SDK, and AWS Strands. For those frameworks, manage session continuity through the framework’s own state primitives. See the framework pages for details.Configuration
The settings below live onagent.agno_settings and are toggled in the agent’s Memory tab in Agent Studio.
Configure memory in Agent Studio
UI walkthrough for toggling session storage and tuning history depth.
| Setting | What it controls | Default |
|---|---|---|
session_storage | Whether the framework writes turn-by-turn history to Postgres. | True |
num_history_runs | How many prior runs to load into context at the start of each turn. One run = one user message + one agent response. | 10 |
max_tool_calls_from_history | Cap on tool calls replayed from history. 0 means no cap. | 0 |
session_summaries | Generate a summary of each completed session for monitoring views. Doesn’t affect context. | False |
num_history_runs is the big knob. Tune it down to 3 or 5 for high-volume tool agents, up to 20 or more for long analytical conversations. Higher numbers mean longer memory but more tokens per turn.
When to turn it off
The default is on because most agents benefit from it. Reasons to flipsession_storage off:
- One-shot tools that don’t have conversational threads (a webhook handler that returns a single result, a scheduled enrichment job).
- Performance-sensitive paths where the per-turn DB read is meaningful overhead.
- Agents handling regulated data where you don’t want any conversation persistence at all.
Inspect sessions from code
The session helpers are on the loaded agent. They let you:- List every session by
user_id - Get full message history for every session
- Delete a session and its message history
agent.aget_db() returns the same connection the framework reads and writes through:
Troubleshooting
My agent doesn't remember the previous turn when I invoke through the REST API
My agent doesn't remember the previous turn when I invoke through the REST API
By default, every REST invocation gets a fresh
session_id. To get continuity across calls, pass the same session_id (or the same task’s parent ID) on each request. The chat panel and Slack integration manage this for you; programmatic clients have to do it explicitly.Can I share sessions across two different agents?
Can I share sessions across two different agents?
How do I purge old sessions for compliance?
How do I purge old sessions for compliance?
Iterate
agent.aget_user_sessions(user_id) for the affected user, filter by date, and call agent.adelete_session(session_id) per match. Schedule the job through any cron mechanism in your infrastructure; xpander doesn’t run retention policies on your behalf.Postgres connection errors when running the handler locally
Postgres connection errors when running the handler locally
Session storage is on by default, so the agent’s wiring expects a reachable Postgres. For cloud-hosted agents this is automatic. For self-hosted or air-gapped deployments, check the connection string with
await agent.aget_connection_string() and confirm the host is reachable, or toggle session_storage off in Agent Studio.What to read next
User memories
Facts about a specific user that persist across all their sessions.
Agent memories
Org-wide knowledge the agent always carries.
Agno framework
The full args-dict reference, including every session-storage field
aget_args wires up.Output Response Filtering
Trim chatty connector responses before they reach the LLM and bloat session history.

