chore: merge origin/main into mintlify/af82bda4 and resolve conflicts
This commit is contained in:
@@ -4,7 +4,7 @@ description: "Configure Mem0 Open Source in Python or TypeScript with your own L
|
||||
icon: "sliders"
|
||||
---
|
||||
|
||||
Mem0 OSS works out of the box with OpenAI defaults. Point it at your own LLM, embedder, and vector store by passing a config when you create `Memory`. The Python SDK also supports a reranker and graph memory.
|
||||
Mem0 OSS works out of the box with OpenAI defaults. Point it at your own LLM, embedder, vector store, and reranker by passing a config when you create `Memory`.
|
||||
|
||||
<Info>
|
||||
**Prerequisites**
|
||||
@@ -90,11 +90,11 @@ Set your provider keys as environment variables:
|
||||
|
||||
```bash
|
||||
export OPENAI_API_KEY="..."
|
||||
export COHERE_API_KEY="..." # Python reranker only
|
||||
export COHERE_API_KEY="..." # Cohere reranker only
|
||||
```
|
||||
|
||||
<Note>
|
||||
The TypeScript OSS SDK configures the LLM, embedder, vector store, and history store. Reranker and graph memory are Python-only today.
|
||||
The TypeScript OSS SDK configures the LLM, embedder, vector store, history store, and reranker. Graph memory is not part of OSS in either language: it is a built-in [Mem0 Platform feature](/platform/features/graph-memory).
|
||||
</Note>
|
||||
|
||||
Prefer a config file? Load YAML into Python's `from_config`:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: Custom Instructions
|
||||
description: Tailor Mem0 Open Source fact extraction with a self-hosted custom prompt and examples so the library stores only the conversation details you care about.
|
||||
title: "Open Source Custom Instructions"
|
||||
sidebarTitle: "Custom Instructions"
|
||||
description: Tailor fact extraction so Mem0 stores only the details you care about.
|
||||
icon: "wand-magic-sparkles"
|
||||
---
|
||||
|
||||
|
||||
@@ -6,6 +6,10 @@ icon: "filter"
|
||||
|
||||
Enhanced metadata filtering in Mem0 lets you run complex queries across memory metadata. Combine comparisons, logical operators, and wildcard matches to zero in on the exact memories your agent needs.
|
||||
|
||||
<Info>
|
||||
This page covers the self-hosted `Memory` / `AsyncMemory` grammar. Sibling top-level keys are implicitly ANDed on both self-hosted and the hosted Platform API, so a flat filter like `{"user_id": "alice", "category": "work"}` works without wrapping it in `AND` on either. Two real differences remain: the `nin` operator documented below is not part of the Platform contract, and Platform validates every top-level key against a fixed allow-list, rejecting anything else with a 400. See [Memory Filters (Platform)](/platform/features/v2-memory-filters) for the hosted grammar.
|
||||
</Info>
|
||||
|
||||
---
|
||||
|
||||
## Feature anatomy
|
||||
@@ -19,7 +23,7 @@ Enhanced metadata filtering in Mem0 lets you run complex queries across memory m
|
||||
| `lt` / `lte` | Less than / less than or equal | Cap numeric values (e.g., ratings, timestamps). |
|
||||
| `in` / `nin` | In list / not in list | Pre-approve or block sets of values without chaining multiple filters. |
|
||||
| `contains` / `icontains` | Case-sensitive / case-insensitive substring match | Scan text fields for keywords. |
|
||||
| `*` | Wildcard | Require that a field exists, regardless of value. |
|
||||
| `*` | Wildcard | Match regardless of value. Exact semantics (field-must-exist vs. no-op) vary by vector store, see [Wildcard matching](#wildcard-matching). |
|
||||
| `AND` / `OR` / `NOT` | Combine filters | Build logic trees so multiple conditions work together. |
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
@@ -111,7 +115,7 @@ results = m.search(
|
||||
|
||||
### Wildcard matching
|
||||
|
||||
Allow any value for a field while still requiring the field to exist: handy when the mere presence of a field matters.
|
||||
Match any value for a field, handy when the mere presence of a field matters.
|
||||
|
||||
```python
|
||||
# Match any value for a field
|
||||
@@ -124,10 +128,18 @@ results = m.search(
|
||||
)
|
||||
```
|
||||
|
||||
<Warning>
|
||||
Wildcard semantics differ by vector store. pgvector requires the key to exist in the payload (a real "field exists" check). Qdrant and Chroma have no native "field exists" filter, so `*` is a no-op there: the field condition is dropped and every record passes, including ones where the field is missing entirely. Do not rely on `*` to exclude records with a missing field unless you have confirmed your store's behavior in `mem0/vector_stores/<provider>.py`.
|
||||
</Warning>
|
||||
|
||||
### Logical combinations
|
||||
|
||||
Combine filters with `AND`, `OR`, and `NOT` to express complex decision trees. Nest logical operators to encode multi-branch workflows.
|
||||
|
||||
<Warning>
|
||||
The examples on this page use `search()`. `get_all()` accepts the same entity and comparison-operator filters, but the `AND` / `OR` / `NOT` wrapper is only translated at the `search()` layer before it reaches the vector store. Whether it also works on `get_all()` depends on your vector store: Qdrant recognizes raw `AND` / `OR` / `NOT` keys natively, but pgvector does not, so a logical wrapper passed to `get_all()` on pgvector silently matches nothing. Stick to `search()` for logical trees, or use plain sibling keys (implicitly ANDed) with `get_all()`.
|
||||
</Warning>
|
||||
|
||||
```python
|
||||
# Logical AND
|
||||
results = m.search(
|
||||
@@ -245,25 +257,18 @@ avoid_filters = {
|
||||
When you reorder filters so indexed fields come first (`good_filters` example), queries typically return faster than the `avoid_filters` pattern where expensive text searches run before simple checks.
|
||||
</Info>
|
||||
|
||||
Vector store support varies. Confirm operator coverage before shipping:
|
||||
Vector store support varies widely. This table reflects what each provider's filter-translation code (`mem0/vector_stores/<provider>.py`) actually implements, confirm before shipping if you use a store not listed:
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Qdrant">
|
||||
Full comparison, list, and logical support. Handles deeply nested boolean logic efficiently.
|
||||
</Accordion>
|
||||
<Accordion title="Chroma">
|
||||
Equality and basic comparisons only. Limited nesting: break large trees into smaller calls.
|
||||
</Accordion>
|
||||
<Accordion title="Pinecone">
|
||||
Comparisons plus `in`/`nin`. Text operators are constrained; rely on tags where possible.
|
||||
</Accordion>
|
||||
<Accordion title="Weaviate">
|
||||
Full operator coverage with advanced text filters. Best option when you need hybrid text + metadata queries.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
| Store | `eq`/`ne`/`gt`/`gte`/`lt`/`lte`/`in`/`nin` | `contains`/`icontains` | `AND`/`OR`/`NOT` | `*` wildcard |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| Qdrant | Full support (`in`/`nin` must be a list, or the Qdrant client raises a validation error) | Yes | Yes, nested | No-op: matches every record regardless of whether the field is present |
|
||||
| pgvector | Full support (`in`/`nin` must be a list, or the call raises `ValueError`) | Yes, via SQL `LIKE`/`ILIKE` | Yes, nested | Requires the key to exist in the payload |
|
||||
| Chroma | Full support | No: silently falls back to equality | Yes, one level of nesting | No-op: the filter is dropped |
|
||||
| Pinecone | Full support | Not implemented | Not implemented: filters are only ANDed field-by-field | Not implemented: `"*"` is matched as the literal string `"*"`, not a wildcard |
|
||||
| Weaviate | Not implemented: only `user_id`, `agent_id` and `run_id` are filtered on, as exact equality. Every other key, including all metadata, is silently dropped | Not implemented | Not implemented: only an implicit AND across the three supported keys | Not implemented |
|
||||
|
||||
<Warning>
|
||||
If an operator is unsupported, most stores silently ignore that branch. Add validation before execution so you can fall back to simpler queries instead of returning empty results.
|
||||
If an operator is unsupported, most stores silently ignore it or fall back to equality rather than raising an error. Test filters against your actual store instead of assuming operator parity with Qdrant.
|
||||
</Warning>
|
||||
|
||||
### Migrate from earlier filters
|
||||
@@ -427,4 +432,7 @@ except ValueError as e:
|
||||
<Card title="Tag and Organize Memories" icon="tag" href="/cookbooks/essentials/tagging-and-organizing-memories">
|
||||
Practice building workflows that label and retrieve memories with clear metadata filters.
|
||||
</Card>
|
||||
<Card title="Memory Filters (Platform)" icon="cloud" href="/platform/features/v2-memory-filters">
|
||||
Using the hosted API instead? See the allow-listed top-level fields, the missing `nin` operator, and Platform-only fields like `created_at` and `memory_ids`.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: Multimodal Support
|
||||
description: Extract searchable facts from images and text with self-hosted Mem0 so agents can recall receipts, screenshots, and product photos shared by users.
|
||||
title: "Open Source Multimodal Support"
|
||||
sidebarTitle: "Multimodal Support"
|
||||
description: Capture and recall memories from both text and images.
|
||||
icon: "image"
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: "Overview"
|
||||
description: "Explore Mem0 Open Source features like async memory, multimodal inputs, rerankers, and metadata filters that adapt self-hosted memory for production."
|
||||
title: "Open Source Features Overview"
|
||||
sidebarTitle: "Overview"
|
||||
description: "Self-hosting features that extend Mem0 beyond basic memory storage"
|
||||
icon: "list"
|
||||
---
|
||||
|
||||
@@ -36,7 +37,7 @@ Mem0 Open Source ships with capabilities that adapt memory behavior for producti
|
||||
<Card title="REST API" icon="code" href="/open-source/features/rest-api">
|
||||
HTTP endpoints for language-agnostic integrations.
|
||||
</Card>
|
||||
<Card title="OpenAI Compatibility" icon="message-bot" href="/open-source/features/openai_compatibility">
|
||||
<Card title="OpenAI Compatibility" icon="message-bot" href="/open-source/features/openai-compatibility">
|
||||
Drop-in replacement for OpenAI chat endpoints.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -53,7 +53,7 @@ const memory = new Memory({
|
||||
});
|
||||
|
||||
const results = await memory.search("What are my food preferences?", {
|
||||
filters: { userId: "alice" },
|
||||
filters: { user_id: "alice" },
|
||||
rerank: true,
|
||||
});
|
||||
```
|
||||
@@ -86,7 +86,7 @@ const memory = new Memory({
|
||||
});
|
||||
|
||||
const results = await memory.search("What movies do I like?", {
|
||||
filters: { userId: "alice" },
|
||||
filters: { user_id: "alice" },
|
||||
rerank: true,
|
||||
});
|
||||
```
|
||||
@@ -108,7 +108,7 @@ const memory = new Memory({
|
||||
});
|
||||
|
||||
const results = await memory.search("What movies do I like?", {
|
||||
filters: { userId: "alice" },
|
||||
filters: { user_id: "alice" },
|
||||
rerank: true,
|
||||
});
|
||||
```
|
||||
@@ -155,10 +155,10 @@ const memory = new Memory({
|
||||
<AccordionGroup>
|
||||
<Accordion title="Supported providers">
|
||||
- **[Cohere](/components/rerankers/models/cohere)**: Multilingual hosted reranker with API-based scoring.
|
||||
- **[Sentence Transformer](/components/rerankers/models/sentence_transformer)**: Local Hugging Face cross-encoders for GPU or CPU.
|
||||
- **[Sentence Transformer](/components/rerankers/models/sentence-transformer)**: Local Hugging Face cross-encoders for GPU or CPU.
|
||||
- **[Hugging Face](/components/rerankers/models/huggingface)**: Bring any hosted or on-prem reranker model ID.
|
||||
- **[LLM Reranker](/components/rerankers/models/llm_reranker)**: Use your preferred LLM (OpenAI, etc.) for prompt-driven scoring.
|
||||
- **[Zero Entropy](/components/rerankers/models/zero_entropy)**: High-quality neural reranking tuned for retrieval tasks.
|
||||
- **[LLM Reranker](/components/rerankers/models/llm-reranker)**: Use your preferred LLM (OpenAI, etc.) for prompt-driven scoring.
|
||||
- **[Zero Entropy](/components/rerankers/models/zero-entropy)**: High-quality neural reranking tuned for retrieval tasks.
|
||||
</Accordion>
|
||||
<Accordion title="Provider comparison">
|
||||
| Provider | Latency | Quality | Cost | Local deploy |
|
||||
@@ -548,7 +548,7 @@ results = m.search(
|
||||
<Card title="Configure Rerankers" icon="sliders" href="/components/rerankers/config">
|
||||
Review provider fields, defaults, and environment variables before going live.
|
||||
</Card>
|
||||
<Card title="Build a Custom LLM Reranker" icon="sparkles" href="/components/rerankers/models/llm_reranker">
|
||||
<Card title="Build a Custom LLM Reranker" icon="sparkles" href="/components/rerankers/models/llm-reranker">
|
||||
Extend scoring with prompt-tuned LLM rerankers for niche workflows.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: Reranking
|
||||
description: 'Legacy reranking page that redirects to the canonical Mem0 reranker-enhanced search guide for updated setup steps, configuration, and examples.'
|
||||
---
|
||||
|
||||
<Redirect href="/open-source/features/reranker-search" />
|
||||
@@ -56,7 +56,7 @@ The Mem0 REST API server exposes every OSS memory operation over HTTP. Run it al
|
||||
make bootstrap # starts Compose, creates an admin, issues the first API key
|
||||
```
|
||||
|
||||
Or to start the stack only and finish setup via the browser wizard at http://localhost:3000:
|
||||
Or to start the stack only and finish setup via the browser wizard at `http://localhost:3000`:
|
||||
|
||||
```bash
|
||||
cd server
|
||||
|
||||
@@ -43,7 +43,7 @@ await memory.add(messages, { userId: "alice", metadata: { category: "movie_recom
|
||||
|
||||
<Step title="Search memories">
|
||||
```ts
|
||||
const results = await memory.search("What do you know about me?", { filters: { userId: "alice" } });
|
||||
const results = await memory.search("What do you know about me?", { filters: { user_id: "alice" } });
|
||||
console.log(results);
|
||||
```
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: "Overview"
|
||||
description: "Self-host Mem0 as a Python or Node library or as a REST server, keeping full control over infrastructure, models, and memory data on your own stack."
|
||||
title: "Open Source Overview"
|
||||
sidebarTitle: "Overview"
|
||||
description: "Self-host Mem0 with full control over your infrastructure and data"
|
||||
icon: "house"
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user