Enable your agents to learn and remember information from conversations over time
The Memory System allows Kortix agents to extract, store, and recall information from past conversations. This creates a personalized experience where agents remember user preferences, facts, and context across multiple sessions.
POST /api/memory/memoriesContent-Type: application/json{ "content": "User is building a mobile app with React Native", "memory_type": "context", "confidence_score": 0.9, "metadata": { "project": "mobile-app", "technology": "react-native" }}
PUT /api/memory/thread/{thread_id}/settingsContent-Type: application/json{ "enabled": false}
Thread-level settings override global settings. If you disable memory for a specific thread, no memories will be extracted or retrieved for that conversation.
Retrieved memories are formatted and injected into agent prompts:
def format_memories_for_prompt(self, memories: List[MemoryItem]) -> str: if not memories: return "" sections = { MemoryType.FACT: [], MemoryType.PREFERENCE: [], MemoryType.CONTEXT: [], MemoryType.CONVERSATION_SUMMARY: [] } for memory in memories: sections[memory.memory_type].append(memory.content) formatted_parts = [] if sections[MemoryType.FACT]: formatted_parts.append("Personal Facts:\n- " + "\n- ".join(sections[MemoryType.FACT])) if sections[MemoryType.PREFERENCE]: formatted_parts.append("Preferences:\n- " + "\n- ".join(sections[MemoryType.PREFERENCE])) if sections[MemoryType.CONTEXT]: formatted_parts.append("Context:\n- " + "\n- ".join(sections[MemoryType.CONTEXT])) if sections[MemoryType.CONVERSATION_SUMMARY]: formatted_parts.append("Past Conversations:\n- " + "\n- ".join(sections[MemoryType.CONVERSATION_SUMMARY])) return "# What You Remember About This User\n\n" + "\n\n".join(formatted_parts)
Example formatted memory:
# What You Remember About This UserPersonal Facts:- Works as a senior engineer at TechCorp- Based in Austin, Texas- Has 8 years of Python experiencePreferences:- Prefers detailed technical explanations- Likes code examples with comments- Wants performance-focused solutionsContext:- Building a microservices architecture- Migrating from monolith to containers- Using Kubernetes for orchestration
Periodically review auto-extracted memories to ensure accuracy. Delete or edit memories that are incorrect or outdated.
Use manual creation sparingly
Let the AI extract memories automatically in most cases. Manual creation is best for critical facts or preferences you want to ensure are remembered.
Monitor memory count
Stay aware of your tier’s memory limits. Delete old or irrelevant memories to make room for new ones.
Disable for sensitive conversations
Use thread-level memory settings to disable memory extraction for conversations containing sensitive information.
Leverage memory types
Different memory types serve different purposes. Facts are objective, preferences guide behavior, context provides background, and summaries reference past interactions.