What are Custom Instructions?
Custom instructions are natural language guidelines that tell Mem0 exactly what information to extract and remember from conversations. Think of them as smart filters that ensure your AI application captures only the most relevant data for your specific use case.Why Use Custom Instructions?
- Focus on What Matters: Only capture information relevant to your application
- Maintain Privacy: Explicitly exclude sensitive data like passwords or personal identifiers
- Ensure Consistency: All memories follow the same extraction rules across your project
- Improve Quality: Filter out noise and irrelevant conversations
How to Set Custom Instructions
Basic Setup
Best Practice Template
Structure your instructions using this proven template:Real-World Examples
Advanced Techniques
Conditional Processing
Handle different conversation types with conditional logic:Testing Your Instructions
Always test your custom instructions with real messages examples:Best Practices
✅ Do
- Be specific about what information to extract
- Use clear categories to organize your instructions
- Test with real conversations before deploying
- Explicitly state exclusions for privacy and compliance
- Start simple and iterate based on results
❌ Don’t
- Make instructions too long or complex
- Create conflicting rules within your guidelines
- Be overly restrictive (balance specificity with flexibility)
- Forget to exclude sensitive information
- Skip testing with diverse conversation examples
Common Issues and Solutions
Issue | Solution |
---|---|
Instructions too long | Break into focused categories, keep concise |
Missing important data | Add specific examples of what to capture |
Capturing irrelevant info | Strengthen exclusion rules and be more specific |
Inconsistent results | Clarify guidelines and test with more examples |