Skip to main content

Overview

Conversation Memory allows your agent to remember information from previous conversations with each user. Instead of starting every session fresh, your agent can recall past interactions, preferences, and context — creating a truly personalized experience. TalkifAI uses Graphiti — a knowledge graph memory system backed by FalkorDB — to store and retrieve conversational context across sessions. Best for:
  • Customer support (remember previous issues, account history)
  • Sales agents (track where each lead is in the pipeline)
  • Personal assistants (remember preferences, past requests)
  • Healthcare (maintain patient context across appointments)
  • Any use case where continuity matters
Memory is a global setting — when enabled, it applies to ALL agents in your deployment. There is currently no per-agent toggle in the Studio UI.

How It Works


Memory Architecture

Graphiti Knowledge Graph

Memory is stored as a knowledge graph — not just raw conversation logs. The system extracts meaningful relationships:
This structured approach means the agent can answer contextual questions like “What has this user bought before?” or “What issues did they report last month?”

Memory Scoping

Memory is scoped per user + agent + organization:
  • Same user, different agents → separate memory graphs
  • Different users, same agent → isolated memory (no cross-user leakage)
  • Different organizations → completely isolated (multi-tenant)
  • All memory stored securely in FalkorDB

Infrastructure Requirements

Graphiti requires FalkorDB (RedisGraph fork) for graph storage.Environment variables:
Docker:

Enable Conversation Memory

Via Environment Variables (Backend)

Memory is enabled globally via environment variables in your backend service:
Configuration options:
No Studio UI toggle exists — Memory configuration is done via environment variables only. Per-agent memory settings are planned for a future release.

Verify Memory is Enabled

Check the system health endpoint:
Response:

Memory Lifecycle

During a Session

When a conversation starts, the system automatically:
  1. Constructs the user’s graph ID: org_{orgId}_agent_{agentId}_user_{sanitizedUserId}
  2. Connects to the user’s memory graph in FalkorDB
  3. Searches for relevant facts using multiple queries:
    • “user personal information age name preferences”
    • “what the user told me about themselves”
    • “facts about the user”
    • “user mentioned said told”
  4. Formats retrieved facts into a memory context string
  5. Appends memory context to the agent’s system prompt
Example memory context injected:

When a Session Ends

After every conversation (voice or text), the system automatically:
  1. Buffers all conversation messages during the session
  2. When session ends, starts a background ingestion task
  3. Formats messages as an episode:
  4. Calls client.add_episode() to extract entities and relationships
  5. Updates the user’s knowledge graph in FalkorDB
Ingestion time: ~18-25 seconds (runs in background, doesn’t delay session end)
Important: Always call the session end API explicitly. If sessions expire via idle timeout, memory ingestion may not complete.

What Gets Remembered

Automatically Extracted

The memory system automatically identifies and stores:

Not Stored

  • Credit card numbers or financial credentials (automatically filtered)
  • Passwords or sensitive authentication data
  • Content explicitly marked as confidential by your system prompt

Memory in Your System Prompt

You can guide the agent on how to use memory by including instructions in the system prompt:

Returning User Experience

Example Conversation

Without Memory:
With Memory:

Privacy & Data Control

Data Retention

  • Memory is retained indefinitely by default (until manually deleted)
  • Each user’s data is isolated in their own graph
  • Users can request memory deletion (GDPR compliance)

Clear User Memory (Manual)

There is currently no API endpoint to delete individual user memory. This feature is planned for a future release.Workaround: Directly delete the user’s graph from FalkorDB:
Caution: This is a destructive operation. Use with care.

List User Memory (Manual)

There is currently no API endpoint to view individual user memory. This feature is planned for a future release.Workaround: Query FalkorDB directly:

Best Practices

Prompt for Natural Recall

Write system prompts that guide the agent to use memory naturally, not robotically. “I recall you…” sounds better than “According to my records…”

Don't Over-Rely on Memory

Memory enriches conversations — it doesn’t replace good conversation design. Agents should still ask clarifying questions when needed.

Test with Returning Users

After enabling memory, test by having the same user start two separate conversations. Verify the agent recalls context correctly.

Respect Sensitive Data

Avoid storing sensitive PII in your system prompt. Memory is powerful, but user trust is more important.

Wait Between Test Sessions

Memory ingestion takes 18-25 seconds. Wait at least 30 seconds between test conversations to ensure ingestion completes.

Monitor FalkorDB Storage

Graph storage grows over time. Monitor your FalkorDB instance and implement retention policies for production deployments.

Troubleshooting

Check:
  1. Is GRAPHITI_ENABLED=true in your backend environment?
  2. Is FalkorDB running and accessible? (GET /health → check graphiti.status)
  3. Did the previous session end properly (not abandoned)?
  4. Is the same user identifier being used across sessions?
  5. Wait at least 30 seconds between sessions for ingestion to complete
Debug:
Cause: FalkorDB is not running or connection failed.Fix:
  1. Start FalkorDB: docker run -p 6379:6379 falkordb/falkordb:latest
  2. Verify FALKORDB_HOST and FALKORDB_PORT environment variables
  3. Check firewall/network connectivity
  4. Restart the backend service
Problem: Agent brings up outdated or irrelevant past context.Solution: Add to system prompt:
Problem: The knowledge graph extracted wrong facts.Solution:
  • Clear user memory from FalkorDB and let it rebuild from fresh conversations
  • Be more explicit in conversations about key facts
  • Adjust GRAPHITI_LLM_MODEL to a more capable model if extraction is poor
Problem: Text chat API sessions not ingesting memory.Solution:
  • Always call POST /v1/chat/sessions/{id}/end explicitly
  • Avoid letting sessions expire via idle timeout (memory won’t ingest)
  • Verify GRAPHITI_ENABLED=true in backend environment
Problem: Memory ingestion exceeds the worker shutdown timeout.Solution:
  • The backend already runs ingestion in parallel with transcription/analysis
  • Ingestion timeout is set to 18 seconds by default
  • If consistently timing out, check LLM API latency (Graphiti uses GPT-4o-mini by default)
  • Consider using a faster LLM for entity extraction

Technical Details

Group ID Format

Each user’s memory is stored in a separate FalkorDB graph with this ID format:
Sanitization rules:
  • Phone numbers: +923136488867p923136488867 (replaces + with p)
  • Special characters: Replaced with underscore _
  • Only alphanumeric, dashes, and underscores allowed

Memory Search Queries

When retrieving context, Graphiti searches with multiple queries:
If user name is available, it’s prepended to improve recall.

Ingestion Process

Graphiti’s LLM client extracts entities and relationships from the episode body.

Next Steps

Enable Graphiti

Set GRAPHITI_ENABLED=true in your backend environment and ensure FalkorDB is running.

Verify Health

Check GET /health endpoint to confirm Graphiti status is “healthy”.

Test Returning Users

Run two separate conversations with the same user (wait 30s between) to verify memory works.

Monitor Storage

Set up monitoring for FalkorDB storage growth in production.