Updated docs for agent_id and run_id (#3294)

This commit is contained in:
Parshva Daftari
2025-08-13 01:33:39 +05:30
committed by GitHub
parent 23d31a830b
commit 2145ffdb1c
5 changed files with 152 additions and 74 deletions
+35 -1
View File
@@ -68,10 +68,15 @@ await memory.search(
#### List memories
List all memories for a `user_id`, `agent_id`, or `run_id`:
List all memories for a `user_id`, `agent_id`, and/or `run_id`:
```python Python
await memory.get_all(user_id="alice")
# Get memories with agent and run context
await memory.get_all(user_id="alice", agent_id="assistant")
await memory.get_all(user_id="alice", run_id="session-001")
await memory.get_all(user_id="alice", agent_id="assistant", run_id="session-001")
```
#### Get specific memory
@@ -111,6 +116,35 @@ await memory.delete_all(user_id="alice")
Note: At least one filter (user_id, agent_id, or run_id) is required when using delete_all.
### Advanced Memory Organization
AsyncMemory supports the same three-parameter organization system as the synchronous Memory class:
```python Python
# Store memories with full context
await memory.add(
messages=[{"role": "user", "content": "I prefer vegetarian food"}],
user_id="alice",
agent_id="diet-assistant",
run_id="consultation-001"
)
# Retrieve memories with different scopes
all_user_memories = await memory.get_all(user_id="alice")
agent_memories = await memory.get_all(user_id="alice", agent_id="diet-assistant")
session_memories = await memory.get_all(user_id="alice", run_id="consultation-001")
specific_memories = await memory.get_all(
user_id="alice",
agent_id="diet-assistant",
run_id="consultation-001"
)
# Search with context
general_search = await memory.search("What do you know about me?", user_id="alice")
agent_search = await memory.search("What do you know about me?", user_id="alice", agent_id="diet-assistant")
session_search = await memory.search("What do you know about me?", user_id="alice", run_id="consultation-001")
```
#### Memory History
Get the history of changes for a specific memory:
+57
View File
@@ -0,0 +1,57 @@
---
title: Overview
description: 'Build powerful AI applications with self-improving memory using Mem0 open-source'
icon: "eye"
iconType: "solid"
---
## Welcome to Mem0 Open Source
Mem0 is a self-improving memory layer for LLM applications that enables personalized AI experiences while saving costs and delighting users. The open-source version gives you complete control over your memory infrastructure.
## Why Choose Mem0 Open Source?
Mem0 open-source provides a powerful, flexible foundation for AI memory management with these key advantages:
1. **Complete Control**: Deploy and manage your own memory infrastructure with full customization capabilities. Perfect for organizations that need data sovereignty and custom integrations.
2. **Flexible Architecture**: Choose from multiple vector databases (Pinecone, Qdrant, Weaviate, Chroma, PGVector), graph stores (Neo4j, Memgraph), and embedding models to fit your specific needs.
3. **Advanced Memory Organization**: Organize memories using `user_id`, `agent_id`, and `run_id` parameters for sophisticated multi-agent, multi-session applications with precise context control.
4. **Rich Integration Ecosystem**: Seamlessly integrate with popular frameworks like LangChain, LlamaIndex, AutoGen, CrewAI, and Vercel AI SDK.
## Core Features
### Memory Management
- **Synchronous & Asynchronous Operations**: Choose between sync and async memory operations based on your application needs
- **Smart Memory Retrieval**: Intelligent search and retrieval with semantic understanding
- **Memory Persistence**: Long-term storage with automatic optimization and cleanup
### Advanced Organization
- **User Context**: Organize memories by user for personalized experiences
- **Agent Isolation**: Separate memories by AI agent for specialized knowledge domains
- **Session Tracking**: Use run IDs to maintain context across different conversation sessions
### Flexible Storage
- **Vector Databases**: Support for Pinecone, Qdrant, Weaviate, Chroma, and PGVector
- **Graph Stores**: Neo4j and Memgraph integration for relationship-based memory
- **Embedding Models**: Multiple embedding providers for optimal performance
## Getting Started
Choose your preferred approach:
- **[Python Quickstart](../python-quickstart)**: Get started with Python SDK
- **[Node.js Quickstart](../node-quickstart)**: Use Mem0 with Node.js/TypeScript
- **[Examples](../examples)**: Explore real-world use cases and implementations
## Next Steps
- Explore [specific features](./async-memory) in detail
- Learn about [graph memory](../graph_memory/overview) capabilities
- Set up [vector databases](../components/vectordbs/overview) and [LLM integrations](../components/llms/overview)
- Check out our [examples](../examples) for practical implementations
- Join our [Discord community](https://mem0.dev/DiD) for support
We're excited to see what you'll build with Mem0 open-source. Let's create smarter, more personalized AI experiences together!