A comprehensive Dify plugin that integrates Mem0 AI's intelligent memory layer, providing 8 powerful tools with full API v2 support including advanced filtering, metadata, and multi-entity management.
- ✅ Add Memory - Create memories with metadata and multi-entity support
- ✅ Retrieve Memory - Search with v2 advanced filters (AND/OR logic)
- ✅ Get All Memories - List memories with pagination
- ✅ Get Memory - Fetch specific memory details
- ✅ Update Memory - Modify existing memories
- ✅ Delete Memory - Remove individual memories
- ✅ Delete All Memories - Batch delete with filters
- ✅ Get Memory History - View change history
- 🚀 Mem0 API v2 - Full support with advanced filters
- 🎯 Multi-Entity Support - user_id, agent_id, app_id, run_id
- 📊 Metadata System - Custom JSON metadata for rich context
- 🔍 Complex Filters - AND/OR logic for precise queries
- 🌍 Internationalized - 4 languages (en/zh/pt/ja)
- ♻️ 100% Backward Compatible - Works with existing workflows
-
In Dify Dashboard
- Go to
Settings→Plugins - Click
Install from GitHub - Enter your repository URL
- Click
Install
- Go to
-
Configure API Key
- Get your API key from Mem0 Dashboard
- Enter it in the plugin settings
-
Start Using
- All 8 tools are now available in your workflows!
Download mem0-0.0.3.difypkg from Releases and upload it manually in Dify.
{
"user": "I love Italian food",
"assistant": "Great! I'll remember that.",
"user_id": "alex"
}{
"query": "What food does alex like?",
"user_id": "alex"
}{
"user": "I prefer morning meetings",
"assistant": "Noted!",
"user_id": "alex",
"agent_id": "scheduler",
"metadata": "{\"type\": \"preference\", \"priority\": \"high\"}"
}{
"query": "user preferences",
"version": "v2",
"filters": "{\"AND\": [{\"user_id\": \"alex\"}, {\"agent_id\": \"scheduler\"}]}"
}{
"agent_id": "travel_assistant",
"limit": 50
}| Tool | Description | v2 Support |
|---|---|---|
add_mem0ai_memory |
Add new memories with metadata | ✅ |
retrieve_mem0ai_memory |
Search with advanced filters | ✅ |
get_all_mem0ai_memories |
List all memories | ✅ |
get_mem0ai_memory |
Get specific memory | ✅ |
update_mem0ai_memory |
Update memory content | ✅ |
delete_mem0ai_memory |
Delete single memory | ✅ |
delete_all_mem0ai_memories |
Batch delete memories | ✅ |
get_mem0ai_memory_history |
View change history | ✅ |
- CHANGELOG.md - Detailed changelog and examples
- INSTALL.md - Installation guide
- BUGFIX.md - Known issues and fixes
- Mem0 Official Docs - Full API documentation
# Remember user preferences
add_memory("I prefer morning meetings", user_id="john")
add_memory("I'm vegetarian", user_id="john")
# Query preferences
search("when does john prefer meetings?", user_id="john")# Track interactions
add_memory("Customer reported login issue", user_id="customer_123")
# Retrieve context
search("previous issues", user_id="customer_123")# Agent-specific memories
add_memory("User likes Italian food", agent_id="food_agent")
add_memory("User prefers Rome", agent_id="travel_agent")
# Search across agents
search("user preferences",
version="v2",
filters='{"OR": [{"agent_id": "food_agent"}, {"agent_id": "travel_agent"}]}')- Dify instance (self-hosted or cloud)
- Mem0 API key (Get one here)
- Python 3.12+ (for local development)
MEM0_API_KEY=your_api_key_here-
Clone the repository
git clone https://github.com/yourusername/dify-plugin-mem0.git cd dify-plugin-mem0 -
Install dependencies
pip install -r requirements.txt
-
Run locally
python -m main
Run YAML validation:
for file in tools/*.yaml; do
python3 -c "import yaml; yaml.safe_load(open('$file'))" && echo "✅ $(basename $file)"
done| Version | Date | Changes |
|---|---|---|
| v0.0.3 | 2025-10-06 | Added 6 new tools, v2 API support, metadata, multi-entity |
| v0.0.2 | 2025-02-24 | Basic add and retrieve functionality |
| v0.0.1 | Initial | First release |
See CHANGELOG.md for detailed changes.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Dify - AI application development platform
- Mem0 AI - Intelligent memory layer for AI
- Built with ❤️ using Dify Plugin SDK
- Issues: GitHub Issues
- Documentation: Mem0 Docs
- Dify Docs: Plugin Development
If you find this plugin useful, please give it a ⭐ on GitHub!
Made with ❤️ by yevanchen
