Skip to main content

Agent Memory & Context

Memory gives your agents the ability to remember information — both within a single conversation and across multiple interactions. A support agent that remembers a caller’s name, a booking agent that recalls past appointments, or a sales agent that builds on previous conversations all rely on memory.

How Memory Works

thinnestAI provides two types of memory:
  1. Session Memory — Conversation history within a single call or chat session
  2. Agentic Memory — Long-term memory that persists across sessions, managed by the agent itself
Both work together to create a natural, contextual experience for your users.

Session Memory (Conversation History)

Session memory is automatic. Every message in a conversation — from both the user and the agent — is tracked and included as context for the agent’s next response. This means your agent always knows what was said earlier in the current conversation.

How It Works

When a user says something, thinnestAI sends the full conversation history to the AI model along with the new message. The model sees everything that was said and responds in context. For example, in a phone call:
The agent remembers the full conversation, so “my other order” makes sense in context.

Session Persistence

By default, each phone call or chat session is a separate conversation. When the session ends, the conversation history is saved and can be reviewed in Call Logs, but a new call starts fresh. You can configure session persistence to link conversations:
  • Per Phone Number — If the same phone number calls again, the agent has access to the previous conversation history.
  • Per User — If the caller is identified (via phone number lookup or authentication), conversations are linked across all sessions.
  • Time Window — Only recall conversations from the last N days.

Configuring Session Persistence

In the dashboard, go to Agent Settings > Memory: Via the API:

Agentic Memory

Agentic memory is a more advanced feature where the agent decides what to remember on its own. Instead of just replaying conversation history, the agent extracts and stores key facts, preferences, and context that it deems important.

How It Works

When agentic memory is enabled, the agent has access to a remember tool. During conversations, it can choose to save information it considers important:
The agent learns and adapts over time without you needing to manually configure anything.

What Gets Remembered

The agent uses its judgment to decide what’s worth remembering. Typically:
  • User preferences — Communication preferences, scheduling preferences, product preferences
  • Key facts — Name, account details, past issues
  • Context — Ongoing issues, recent interactions, follow-up items
  • Relationships — “This is John’s assistant calling about his account”

Enabling Agentic Memory

In the dashboard, toggle Agentic Memory on in your agent’s Memory settings. Via the API:

Reviewing Stored Memories

You can view and manage what your agent has remembered:
  1. Go to Agent > Memory in the dashboard.
  2. Browse stored memories organized by user/phone number.
  3. Delete or edit individual memories if needed.
Via the API:

Memory and Token Usage

Memory adds context to each request, which increases token usage. Here’s how to manage it:

Session History

More history means more tokens per request. If you’re on a budget:
  • Reduce max_history_messages to 10-20
  • Shorten history_window_days
  • Use a model with a large context window (like Gemini) if you need long history

Agentic Memory

Stored memories are typically short summaries, so they add minimal token overhead. However, an agent with hundreds of memories for a single user will use more tokens.

Recommendations

Clearing Memory

Clear Session History

Clear Agentic Memories

Best Practices

  1. Start with session memory only. Enable agentic memory once your agent’s core behavior is solid.
  2. Review stored memories regularly. Make sure the agent is remembering useful things, not noise.
  3. Set appropriate history limits. Too much context can confuse the model and slow responses.
  4. Use persistent sessions for repeat callers. It dramatically improves the caller experience when the agent remembers them.
  5. Guide memory in your prompt. You can tell the agent what to remember: