docs(platform): align Platform docs with v3 SDK behavior (#5849)
This commit is contained in:
@@ -238,11 +238,11 @@ client.search("preferences", filters={
|
||||
- **Use natural language**: Mem0 understands intent, so describe what you're looking for naturally
|
||||
- **Scope with user ID**: Always provide `user_id` to scope search to relevant memories
|
||||
- **Platform API**: Use `filters={"user_id": "alice"}`
|
||||
- **OSS**: Use `user_id="alice"` as parameter
|
||||
- **OSS**: Use `filters={"user_id": "alice"}` (passing `user_id` as a top-level kwarg raises `ValueError` in v3)
|
||||
- **Combine filters**: Use AND/OR logic to create precise queries (Platform)
|
||||
- **Consider wildcard filters**: Use wildcard filters (e.g., `run_id: "*"`) for broader matches
|
||||
- **Tune parameters**: Adjust `top_k` for result count, `threshold` for relevance cutoff
|
||||
- **Enable reranking**: Use `rerank=True` (default) when you have a reranker configured
|
||||
- **Enable reranking**: Use `rerank=True` (default is `False`) when you have a reranker configured
|
||||
|
||||
<Callout type="tip" icon="plug">
|
||||
**MCP Alternative**: With <Link href="/platform/mem0-mcp">Mem0 MCP</Link>, AI agents can search their own memories proactively when needed.
|
||||
|
||||
@@ -60,7 +60,7 @@ import os
|
||||
|
||||
from mem0 import Memory
|
||||
|
||||
memory = Memory(api_key=os.environ["MEM0_API_KEY"])
|
||||
memory = Memory()
|
||||
|
||||
# Sticky note: conversation memory
|
||||
memory.add(
|
||||
@@ -72,8 +72,7 @@ memory.add(
|
||||
# Later in the session, pull long-term + session context
|
||||
results = memory.search(
|
||||
"Any hotel preferences?",
|
||||
user_id="alex",
|
||||
run_id="trip-planning-2025",
|
||||
filters={"user_id": "alex", "run_id": "trip-planning-2025"},
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user