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
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: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
- FalkorDB
- Redis
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:| Variable | Default | Description |
|---|---|---|
GRAPHITI_ENABLED | true | Enable/disable memory system globally |
GRAPHITI_LLM_MODEL | gpt-4o-mini | LLM for entity extraction |
GRAPHITI_EMBEDDING_MODEL | text-embedding-3-small | Embeddings for semantic search |
FALKORDB_HOST | localhost | FalkorDB/Redis host |
FALKORDB_PORT | 6379 | FalkorDB/Redis port |
FALKORDB_PASSWORD | — | Optional authentication |
Verify Memory is Enabled
Check the system health endpoint:| Status | Meaning |
|---|---|
healthy | Graphiti is enabled and FalkorDB is connected |
skipped | Graphiti is disabled (GRAPHITI_ENABLED=false) |
unhealthy | Graphiti is enabled but FalkorDB connection failed |
Memory Lifecycle
During a Session
When a conversation starts, the system automatically:- Constructs the user’s graph ID:
org_{orgId}_agent_{agentId}_user_{sanitizedUserId} - Connects to the user’s memory graph in FalkorDB
- 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”
- Formats retrieved facts into a memory context string
- Appends memory context to the agent’s system prompt
When a Session Ends
After every conversation (voice or text), the system automatically:- Buffers all conversation messages during the session
- When session ends, starts a background ingestion task
- Formats messages as an episode:
- Calls
client.add_episode()to extract entities and relationships - Updates the user’s knowledge graph in FalkorDB
What Gets Remembered
Automatically Extracted
The memory system automatically identifies and stores:| Category | Examples |
|---|---|
| User Information | Name, email, location, account numbers |
| Preferences | Communication style, preferred products, language |
| Issues & Resolutions | Support tickets, complaints, solutions provided |
| Orders & Transactions | Purchase history, order numbers, amounts |
| Appointments | Scheduled meetings, bookings, follow-ups |
| Decisions Made | Choices made during previous conversations |
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: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)
List User Memory (Manual)
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
Agent doesn't remember previous conversations
Agent doesn't remember previous conversations
Check:
- Is
GRAPHITI_ENABLED=truein your backend environment? - Is FalkorDB running and accessible? (
GET /health→ checkgraphiti.status) - Did the previous session end properly (not abandoned)?
- Is the same user identifier being used across sessions?
- Wait at least 30 seconds between sessions for ingestion to complete
Graphiti health check shows 'unhealthy'
Graphiti health check shows 'unhealthy'
Cause: FalkorDB is not running or connection failed.Fix:
- Start FalkorDB:
docker run -p 6379:6379 falkordb/falkordb:latest - Verify
FALKORDB_HOSTandFALKORDB_PORTenvironment variables - Check firewall/network connectivity
- Restart the backend service
Agent over-references old information
Agent over-references old information
Problem: Agent brings up outdated or irrelevant past context.Solution: Add to system prompt:
Memory contains incorrect information
Memory contains incorrect information
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_MODELto a more capable model if extraction is poor
Memory not available for text chat sessions
Memory not available for text chat sessions
Problem: Text chat API sessions not ingesting memory.Solution:
- Always call
POST /v1/chat/sessions/{id}/endexplicitly - Avoid letting sessions expire via idle timeout (memory won’t ingest)
- Verify
GRAPHITI_ENABLED=truein backend environment
Ingestion takes too long or times out
Ingestion takes too long or times out
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:- Phone numbers:
+923136488867→p923136488867(replaces+withp) - Special characters: Replaced with underscore
_ - Only alphanumeric, dashes, and underscores allowed
Memory Search Queries
When retrieving context, Graphiti searches with multiple queries:Ingestion Process
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.
Related Documentation
- System Health API — Monitor Graphiti status
- Environment Configuration — All backend environment variables
- FalkorDB Documentation — Graph database documentation
- Graphiti GitHub — Graphiti source code