Overview
The Memories API allows AI assistants to remember information about users across conversations, enabling personalized and context-aware interactions. All memory endpoints are prefixed with/api/memories.
Get All Memories
Retrieve all memories for the authenticated user:Response
Array of memory objects
Unique identifier for the memory
Memory content
ISO 8601 timestamp of last update
Total tokens used by all memories
Maximum tokens allowed for memories
Percentage of limit used
Create Memory
Create a new memory:Request Body
Unique identifier for the memory
Memory content (max 100KB)
Example
Response
Update Memory
Update an existing memory:Path Parameters
Memory key to update
Request Body
New memory content
Example
Delete Memory
Delete a specific memory:Path Parameters
Memory key to delete
Response
Update Memory Preferences
Toggle memory functionality on/off for the user:Request Body
Enable or disable memory functionality
Example
Response
Memory Configuration
Memory functionality can be configured inlibrechat.yaml:
librechat.yaml
Permissions
Memory operations require specific permissions:USE- Use memory functionalityREAD- View existing memoriesCREATE- Create new memoriesUPDATE- Update existing memoriesOPT_OUT- Disable memory functionality
librechat.yaml.
Token Limits
Memories are stored with token counting to prevent excessive usage:- Maximum payload size: 100KB per memory
- Total token limit: Configurable per user/role
- Token counting includes both key and value
Use Cases
Personal Preferences
Personal Preferences
Remember user communication preferences, time zones, language preferences, etc.
Project Context
Project Context
Store ongoing project information for consistent assistance.
Technical Stack
Technical Stack
Remember the user’s tech stack and preferences.
Learning Goals
Learning Goals
Track what the user is learning or wants to focus on.
Best Practices
Use Descriptive Keys
Choose clear, meaningful keys like
coding_style instead of generic ones like pref1.Error Responses
403 Forbidden
403 Forbidden
413 Payload Too Large
413 Payload Too Large
429 Token Limit Exceeded
429 Token Limit Exceeded
Related Documentation
- Configuration - Memory configuration in librechat.yaml
- Roles & Permissions - Configure memory permissions