Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt

Use this file to discover all available pages before exploring further.

Memory is what separates a useful agent from a frustrating one. Without it, every message is a blank slate. The agent forgets what you said 30 seconds ago. With the right memory configuration, your agent maintains conversation context, learns user preferences, and builds organizational knowledge over time. Xpander gives you three types of memory, each serving a different purpose. Configure them in the Memory tab of the Agent Studio.
Memory tab showing session storage, user and agent memories, compression, and optimization settings
This page covers:

Session Storage

Session storage is short-term memory. It keeps the conversation history within a single thread so the agent remembers what was said earlier in the same conversation. Every conversation thread has its own history. As long as messages are in the same thread, the agent sees the full history up to the configured limit. Starting a new thread means a clean slate. The agent won’t remember what was said in a previous conversation. Multiple users can share the same thread (e.g., a support ticket where Alice opens the conversation and Bob follows up). Both see the same conversation history, but the thread is still self-contained. Nothing carries over to other threads. Each session storage is associated with one thread. Every session connects a user and the agent, and gets its own isolated storage right beside it.
SettingWhat it doesRecommendation
No. of history runsHow many past exchanges the agent can see. 1 run = 1 user message + 1 agent response.3–5 for most use cases. 10 if conversations are long and context-heavy.
More history means better context, but also more tokens per request. If you’re hitting token limits or seeing slow responses, reduce the number of history runs before disabling memory altogether.

User Memories

User memories store personal facts about individual users that persist across all conversations. When Alice tells your agent “I prefer metric units” in Thread 1, the agent remembers that when she starts Thread 2, Thread 3, or any future conversation. User memories are scoped to user_id. They follow the user, not the thread. Each user’s memories are completely isolated. Alice’s preferences never leak into Bob’s conversations, even when they interact with the same agent. This makes user memories safe for multi-tenant environments where personalization matters but privacy is critical. User memory is associated with the user, not with any session or agent. Every session connects a user and the agent, but the memory sits right beside the user and follows them across all sessions.
SettingWhat it does
Enable User MemoriesTurns the feature on or off.
Agentic managedWhen enabled, the agent decides what to remember automatically. When disabled, memories must be created manually via the update_user_memory tool (actions: add, update, delete, clear).
User memories store personal data. Never allow agents to store passwords, API keys, SSNs, or credit card numbers. Memories persist until explicitly deleted.

Agent Memories

Agent memories are shared knowledge that affects all users. Think of them as organizational facts the agent learns over time: “Our support hours are 9-5 EST,” or “The most common billing issue is duplicate charges.” Unlike user memories, agent memories are scoped only to agent_id. Any memory created here becomes part of every conversation for every user. When Alice’s interaction teaches the agent that “the billing API was updated last week,” Bob and every other user will see that knowledge in their next conversation. This is useful for building shared organizational knowledge, but it means a single user’s interaction can change behavior for everyone. Agent memory is associated with the agent itself. Every session connects a user and the agent, and the memory sits right beside the agent, shared across every session.
SettingWhat it does
Enable Agent MemoriesTurns the feature on or off.
Agentic managedWhen enabled, the agent creates and updates memories automatically based on interactions. They are managed via the create_or_update_cultural_knowledge tool.
When agentic management is enabled, a single user’s interaction can change behavior for everyone. This is risky. Not recommended for production, compliance-heavy, or multi-tenant systems without a regular review and rollback strategy.

Agentic vs. Manual Memory

You have two choices for how memories get created and maintained.
Agentic ManagedManual
How memories are createdAgent decides what to save automaticallyYou (or your team) create memories manually
MaintenanceSelf-updating, less work for youFull control, more maintenance
Best forInternal tools, single-tenant use cases, rapid iterationProduction systems, compliance environments, multi-tenant deployments
RiskAgent may save inaccurate or unwanted informationSlower to learn, requires ongoing attention
Start with agentic management during development to see what the agent naturally wants to remember, then switch to manual for production with curated memories.

Memory Optimization

These settings help you manage token usage and performance for tool-heavy agents. They appear in the Memory tab in the order listed below.

Max Tool Calls from History

Limits how many past tool call results are included when loading conversation history. Set to 0 (disabled) for most cases. Only enable if you’re consistently hitting token limits.

Session Summaries

Automatically summarizes long conversations into a compact summary for future reference. This does not affect the agent’s context window. It’s metadata for monitoring and observability dashboards.

Tool Calls Compression

When your agent makes many tool calls in a single conversation, the raw outputs pile up in context and eat through tokens. Tool calls compression condenses verbose outputs after a threshold number of calls.
SettingWhat it doesDefault
Enable compressionTurns on automatic compression of tool outputs.Off
ThresholdNumber of tool calls before compression kicks in. After N tool calls, summaries replace prior verbose results to keep context within limits.3
Compression instructionsOptional guidance on what to keep vs. drop when compressing. Keep exact numbers, dates, entities, URLs, causal links; remove boilerplate and repetition.-

Memory Optimization Strategy

Controls how the agent manages its context window during long executions. This is especially useful for agents that handle extended conversations or make many tool calls in a single session.
ModeWhat it does
DisabledNo optimization. The full conversation history (up to the configured history runs) is included as-is. This is the default.
SummarizationCondenses older messages while preserving key points and tool call results. Reduces token usage while retaining the important context from earlier in the conversation.
ContextRetains the initial instructions and the most recent messages, summarizing everything in between. Best for long-running executions where the beginning (task definition) and end (recent progress) matter most.

Troubleshooting

Make sure you’re passing the same session_id for all messages in the thread. Increase history runs to 3+.
Verify user_id is being passed consistently. Check that User Memories is toggled on.
Reduce history runs. Enable tool calls compression. Lower max tool calls from history.
Review and delete the memory. Consider switching from agentic to manual management.
Agent memories are global. Move user-specific facts to User Memories instead.

Next Steps

AI Models & Intelligence

Model selection, planning mode, and reasoning mode

Knowledge Bases

Give your agent searchable document knowledge

Testing & Chat

Test memory behavior in the built-in chat

Agent Configuration

Full overview of all Agent Studio settings