Skip to content

Commit 79dc6c9

Browse files
authored
Merge pull request #214 from Dev-Khant/mem0-doc-update
Doc: Mem0 doc update
2 parents 96b5011 + 8d2382d commit 79dc6c9

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

server/services/memory/mem0.mdx

+40
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ You'll also need to set up your Mem0 API key as an environment variable: `MEM0_A
4545
Configuration parameters for memory retrieval (see below)
4646
</ParamField>
4747

48+
<ParamField path="local_config" type="dict" optional>
49+
Configuration for using local LLMs and embedders instead of Mem0's cloud API (see Local Configuration section)
50+
</ParamField>
51+
4852
<Tip>
4953
At least one of `user_id`, `agent_id`, or `run_id` must be provided to
5054
organize memories.
@@ -172,6 +176,42 @@ pipeline = Pipeline([
172176
])
173177
```
174178

179+
### Using Local Configuration
180+
181+
The `local_config` parameter allows you to use your own LLM and embedding providers instead of Mem0's cloud API. This is useful for self-hosted deployments or when you want more control over the memory processing.
182+
183+
```python
184+
local_config = {
185+
"llm": {
186+
"provider": str, # LLM provider name (e.g., "anthropic", "openai")
187+
"config": {
188+
# Provider-specific configuration
189+
"model": str, # Model name
190+
"api_key": str, # API key for the provider
191+
# Other provider-specific parameters
192+
}
193+
},
194+
"embedder": {
195+
"provider": str, # Embedding provider name (e.g., "openai")
196+
"config": {
197+
# Provider-specific configuration
198+
"model": str, # Model name
199+
# Other provider-specific parameters
200+
}
201+
}
202+
}
203+
204+
# Initialize Mem0 memory service with local configuration
205+
memory = Mem0MemoryService(
206+
local_config=local_config, # Use local LLM for memory processing
207+
user_id="user123", # Unique identifier for the user
208+
)
209+
```
210+
211+
<Warning>
212+
When using `local_config` do not provide the `api_key` parameter.
213+
</Warning>
214+
175215
## Frame Flow
176216

177217
```mermaid

0 commit comments

Comments
 (0)