Examples
- API Request
- TypeScript
- Python (Sync)
Overview
Store personal memories for a specific user to enhance personalization and provide context-aware responses in your AI applications.What are User Memories?
User memories are personal, contextual information stored for individual users that help your AI system:- Remember user preferences and past interactions
- Provide personalized responses based on user history
- Enhance user experience through adaptive behavior
Memory Types
Raw Text: Textual content that you want to save in Cortex as a memory. This can be any descriptive information about a user, such as their preferences, habits, background information, or important context that should be remembered for future interactions. User-Assistant Pairs: Conversational exchanges between a user and an AI assistant (or any similar interaction pattern). These are structured as question-response or prompt-answer pairs that capture the flow of conversations, including responses from an LLM or any similar system.Additional Parameters
Custom Instructions: Contextual information you provide about the text being indexed that Cortex needs to know. This helps guide how the memory should be interpreted, categorized, or retrieved later. For example, you might specify that certain information is particularly important, should be weighted more heavily, or relates to specific topics. Infer: When set totrue, Cortex will process and analyze the memory content to improve its indexing and retrieval capabilities. This includes extracting key concepts, understanding context, and optimizing how the memory is stored for better semantic search and recall.
Functionality
- Manual Memory Addition: Allows you to explicitly add specific memories for a user
- Vector Store Integration: Stores memories in a searchable vector database for semantic retrieval
- Tenant Isolation: Ensures memories are properly isolated by tenant and sub-tenant
- Automatic Provisioning: If the tenant/sub-tenant combination doesn’t exist for user memory, it will be automatically provisioned on first use
Use Cases
- Preference Storage: Store user preferences like preferred communication style, timezone, or language
- Context Preservation: Remember important details from previous conversations
- Personalization Data: Store information that helps tailor responses to individual users
Important Notes
Memory Persistence: User memories are stored permanently until explicitly deleted. They persist across sessions and can be retrieved using the Retrieve User Memory endpoint.
Best Practices:
- Use clear, descriptive memory content that will be useful for future AI interactions
- Consider the context in which memories will be retrieved
- Avoid storing sensitive information unless necessary
- Use consistent formatting for similar types of memories
- Choose either
raw_textoruser_assistant_pairs- do not provide both in the same request
Error Responses
All endpoints return consistent error responses following the standard format. For detailed error information, see our Error Responses documentation.Authorizations
Body
application/json