Compare commits
353 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b664bb0b65 | |||
| 68cf4e118d | |||
| 12624555b4 | |||
| e8004b93db | |||
| 4e414e4015 | |||
| 16455789d4 | |||
| 3ac4e047de | |||
| a2ffca3266 | |||
| 3a9fcdbec2 | |||
| 515f87b6bd | |||
| 5edc0cc99f | |||
| 7fff26f374 | |||
| 1aecfadf45 | |||
| 7e06aeeada | |||
| 2a59c9fd99 | |||
| 669ed184e4 | |||
| 3c2683c1b5 | |||
| f06e2d744d | |||
| f9e30304d7 | |||
| 7e3b727528 | |||
| 13c7f84eec | |||
| 924ac00c52 | |||
| 2a36960f4c | |||
| 2e0f91e70d | |||
| d1b4b304c7 | |||
| 2868bfe749 | |||
| 5431badfd4 | |||
| bda5b726bd | |||
| 16bcc91716 | |||
| ba63ea4528 | |||
| 5332741961 | |||
| d8a6960b4a | |||
| 316dc67a0a | |||
| 65156d5176 | |||
| c5e8216362 | |||
| ecedbc11d9 | |||
| 9aadfa3221 | |||
| cc45561abd | |||
| 7cebaba0a2 | |||
| 5dabf24809 | |||
| ec326f0f92 | |||
| eb780f4880 | |||
| c39d5ada4d | |||
| 06c25eb00b | |||
| 7a09663156 | |||
| 267bcf2931 | |||
| bf9a5703b1 | |||
| 884e740b53 | |||
| 824032a81d | |||
| abdb07c204 | |||
| 7b26df728d | |||
| 30661ab427 | |||
| 7ad5d6f442 | |||
| 305ce7b6b3 | |||
| 4437c3e8a8 | |||
| 54bdbde6e6 | |||
| 2b9558335b | |||
| 2520edb404 | |||
| f05e50d940 | |||
| 401754ca65 | |||
| 73038900f5 | |||
| 6663b738d5 | |||
| 88abb29de9 | |||
| 66e6f58fc6 | |||
| 22c2545d61 | |||
| 410b79c750 | |||
| 08de18f860 | |||
| 46b4b2e9c8 | |||
| a029cc9d43 | |||
| 348f44b632 | |||
| 0c4d0290cb | |||
| b971b61cbb | |||
| ffd1b96916 | |||
| 4ffe1eaa4e | |||
| a172de9c22 | |||
| 7539463f50 | |||
| 577a5a2feb | |||
| d7a34c24dd | |||
| 214d2a1d0d | |||
| f0eb9e091f | |||
| 3cdcb6564c | |||
| 336fbce60a | |||
| 9eb5b9ed29 | |||
| 8230a5dac7 | |||
| 9864584c21 | |||
| 9eea060db9 | |||
| 15218d4a7f | |||
| 69001d7b1f | |||
| 35fe30aabd | |||
| 11a7d8378c | |||
| b4b73deada | |||
| bfe730aa38 | |||
| 82d67430dd | |||
| 8fcf2b0b29 | |||
| 2e5e290434 | |||
| 06ee1b588c | |||
| dc6122ec3d | |||
| df79a43925 | |||
| a6242710df | |||
| 4e1e4c0c5a | |||
| fa5c85f9f6 | |||
| 7c29eb2645 | |||
| 6f079c313f | |||
| e95090e116 | |||
| 861cbb7289 | |||
| 54aa760720 | |||
| 59c3b050bd | |||
| 5b3acf416b | |||
| 63f587c922 | |||
| 21df43c699 | |||
| 0118198143 | |||
| 36537c8326 | |||
| 7482c48692 | |||
| e219961f9d | |||
| 3ffe43f99f | |||
| 72e2c5c24b | |||
| 34c797d285 | |||
| a0d8a02b94 | |||
| 93c720301e | |||
| db15d5c629 | |||
| aa4a944b51 | |||
| ab5e930cf7 | |||
| 0e76de7bd5 | |||
| 5a93643f12 | |||
| a140829395 | |||
| a6810819ca | |||
| a02205e519 | |||
| 69a832dc58 | |||
| 70baa46cb1 | |||
| 3d3e875d21 | |||
| dba7f0458a | |||
| 27e5db5831 | |||
| 2c90eedfff | |||
| a1db0f6362 | |||
| 90a7b1afa0 | |||
| 69a552d8a8 | |||
| 417ebffadd | |||
| 1dc07d3550 | |||
| 65e22e34d9 | |||
| e08f44c5f2 | |||
| 16d989bbcd | |||
| 0f8654bd40 | |||
| 654089fcfc | |||
| 222c6ceea1 | |||
| 84bd6e3b97 | |||
| 5676bebd5f | |||
| f14132db44 | |||
| 903c3635cc | |||
| cc2894aaec | |||
| 97cbff77ef | |||
| e29220efda | |||
| 3b84a234e1 | |||
| 2bca30ebe6 | |||
| 3297ec1a46 | |||
| 61e2a40d55 | |||
| 9f921e27cb | |||
| 568e97d013 | |||
| ac5660e26d | |||
| 76abd5117d | |||
| 978babd3db | |||
| 2b0a457198 | |||
| 6a7277070f | |||
| 4c53930e47 | |||
| 84687fc3d2 | |||
| 3ca939e210 | |||
| 5f5e64b44b | |||
| 5cb6b31690 | |||
| ee8955d08b | |||
| 80c9139c5b | |||
| 7be32641c7 | |||
| 2c18355dd2 | |||
| 61faf71064 | |||
| ac9598a67f | |||
| f98a17c716 | |||
| 639d26e1ac | |||
| f7d7c53001 | |||
| ec1a60bf8d | |||
| 77c71a134a | |||
| 2692e49d50 | |||
| eb2f8a3738 | |||
| 4a30745592 | |||
| 3b1a4c2e68 | |||
| 5227b0a062 | |||
| 8031f0bf8f | |||
| dd3e5363dd | |||
| d5a130b785 | |||
| 8ede1df10a | |||
| 8ba18bf8bc | |||
| de224dd26d | |||
| 9ef644b95e | |||
| 7afbaae7a3 | |||
| 1090784302 | |||
| 394203d1b5 | |||
| 8f5151c344 | |||
| 41cfb3ab1a | |||
| a40314c971 | |||
| ea22e8d9cd | |||
| ce8a285003 | |||
| 4559623501 | |||
| 37c86aa3c0 | |||
| 335a7d7862 | |||
| 64571002f5 | |||
| 9000576173 | |||
| 922471f43b | |||
| b93ce5548b | |||
| ee0202764b | |||
| 8ba032e029 | |||
| fbf3bd640c | |||
| 51ce6f1347 | |||
| 346d89d244 | |||
| 1104b52d99 | |||
| e19b748ad0 | |||
| 517a266d74 | |||
| cbf56477be | |||
| 58cc44ff38 | |||
| 445286a138 | |||
| d68ed11d58 | |||
| 135883935f | |||
| ed5a1e9fc6 | |||
| dc883b0f9e | |||
| 5616844b9c | |||
| 6e1d02c137 | |||
| a199ee4ff8 | |||
| 88ae952483 | |||
| 9df392b26a | |||
| ead210ffe4 | |||
| a015e2ff4a | |||
| d4e98dba38 | |||
| ac72eb5ecc | |||
| 6b5582f474 | |||
| d38e3f1962 | |||
| a0685f3e8c | |||
| d48b1832c7 | |||
| 21d69307dc | |||
| 9e5810dfb7 | |||
| e3f0277cb9 | |||
| e64488b598 | |||
| f5e0fb9e4b | |||
| 77b4b6a2b9 | |||
| 9477184582 | |||
| b27879bfd4 | |||
| f0e8c3f760 | |||
| 5e8d5e4664 | |||
| c8d864c1b6 | |||
| 617aabe5b3 | |||
| 163dafb216 | |||
| cc15a22bf9 | |||
| 64cbe84089 | |||
| c8f9f20dff | |||
| 97fd320bbf | |||
| 748620f29b | |||
| 0b2aa36e98 | |||
| 3d0ece1bcf | |||
| 458d7ab8a3 | |||
| 84af5ad265 | |||
| 6237a6acb9 | |||
| 8c8368781d | |||
| 3b2d0ad0eb | |||
| 9337a873ec | |||
| 76411e2591 | |||
| d523070cbc | |||
| c72bfc3285 | |||
| ee00bd5731 | |||
| f914dca659 | |||
| b64792590e | |||
| a7ac8bf13b | |||
| 4487785cec | |||
| e4c5582808 | |||
| ff399e5528 | |||
| e7013764f7 | |||
| c8ee17b884 | |||
| 346b913ace | |||
| 49ad64708b | |||
| 3a1eff425b | |||
| ebb411b11a | |||
| 8e8f13a48e | |||
| a6a3928091 | |||
| a883b56aa8 | |||
| 246d9e8f69 | |||
| 192db1844c | |||
| 5e895c240a | |||
| b4bd7b48df | |||
| 1bc31b6ae3 | |||
| 7159221d2e | |||
| c89dc72f79 | |||
| 2145ffdb1c | |||
| 23d31a830b | |||
| ab099312d5 | |||
| 8557533b8f | |||
| 72e5a4fcc4 | |||
| b199186163 | |||
| 9e9dcd70e1 | |||
| dbe909c352 | |||
| d65a39c125 | |||
| b60a208c2f | |||
| c2792c6558 | |||
| 2307dc8613 | |||
| 4c748423fc | |||
| 26732771eb | |||
| 148bbf0a5c | |||
| 6e8c6c1cb7 | |||
| f59ef3f2e2 | |||
| 7a0dc7391e | |||
| 7fac6311f4 | |||
| 0e18f54d36 | |||
| 42e60d6724 | |||
| 57a16aeb4b | |||
| 5ea2d56d88 | |||
| 7d1d0ca806 | |||
| 89b67e0834 | |||
| fbe8a2e90f | |||
| 907328aafe | |||
| 0e03d69ed1 | |||
| 0412e62cb1 | |||
| 724c553a2e | |||
| 08e7ae02de | |||
| d0f61d5995 | |||
| 4433666117 | |||
| 37ee3c5eb2 | |||
| c8892bb1fe | |||
| 1a8d175570 | |||
| 0560d87160 | |||
| 9f3fd06334 | |||
| c1ca366edd | |||
| cba3217280 | |||
| 77ea103b5d | |||
| bcc5f42941 | |||
| 3bc5090371 | |||
| de0513fc9f | |||
| ec9b0688d8 | |||
| 0f5612b96d | |||
| 842903b1b1 | |||
| 70d6f9231b | |||
| aae5989e78 | |||
| 6866e56d7a | |||
| 2992c298cb | |||
| 4491e7f9f4 | |||
| c0a930a7d3 | |||
| 05c404d8d3 | |||
| 7484eed4b2 | |||
| 2c496e6376 | |||
| a20b68fcec | |||
| eb7c712aa6 | |||
| 7476c39257 | |||
| 5b0f1a7cf8 | |||
| b336cdf018 | |||
| 60e4e8a662 | |||
| 6d4a78b7c7 | |||
| d39a1d5541 | |||
| 044ad4f131 | |||
| 75482fdb29 | |||
| 6c69599db9 | |||
| b79bfb7c1e |
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "mem0-plugins",
|
||||
"owner": {
|
||||
"name": "Mem0",
|
||||
"email": "support@mem0.ai"
|
||||
},
|
||||
"metadata": {
|
||||
"description": "Official Mem0 plugins for Claude"
|
||||
},
|
||||
"plugins": [
|
||||
{
|
||||
"name": "mem0",
|
||||
"source": "./mem0-plugin",
|
||||
"description": "Mem0 memory layer for AI applications. Add persistent memory, personalization, and semantic search to Claude workflows.",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "mem0-plugins",
|
||||
"owner": {
|
||||
"name": "Mem0",
|
||||
"email": "support@mem0.ai"
|
||||
},
|
||||
"metadata": {
|
||||
"description": "Official Mem0 plugins for Cursor"
|
||||
},
|
||||
"plugins": [
|
||||
{
|
||||
"name": "mem0",
|
||||
"source": "./mem0-plugin",
|
||||
"description": "Mem0 memory layer for AI applications. Add persistent memory, personalization, and semantic search.",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,41 +1,55 @@
|
||||
name: 🐛 Bug Report
|
||||
description: Create a report to help us reproduce and fix the bug
|
||||
name: Bug Report
|
||||
description: Report a bug in mem0
|
||||
labels: ["bug"]
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: >
|
||||
#### Before submitting a bug, please make sure the issue hasn't been already addressed by searching through [the existing and past issues](https://github.com/embedchain/embedchain/issues?q=is%3Aissue+sort%3Acreated-desc+).
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 🐛 Describe the bug
|
||||
description: |
|
||||
Please provide a clear and concise description of what the bug is.
|
||||
- type: dropdown
|
||||
id: component
|
||||
attributes:
|
||||
label: Component
|
||||
description: Which part of mem0 is affected?
|
||||
options:
|
||||
- Core / Python SDK
|
||||
- TypeScript SDK
|
||||
- Vector Store (Qdrant, PGVector, Redis, Chroma, etc.)
|
||||
- Graph Memory (Neo4j, Memgraph, etc.)
|
||||
- Ollama / Local Models
|
||||
- OpenClaw
|
||||
- REST API
|
||||
- Other
|
||||
validations:
|
||||
required: true
|
||||
|
||||
If relevant, add a minimal example so that we can reproduce the error by running the code. It is very important for the snippet to be as succinct (minimal) as possible, so please take time to trim down any irrelevant code to help us debug efficiently. We are going to copy-paste your code and we expect to get the same result as you did: avoid any external data, and include the relevant imports, etc. For example:
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
value: |
|
||||
### Summary
|
||||
|
||||
```python
|
||||
# All necessary imports at the beginning
|
||||
import embedchain as ec
|
||||
# Your code goes here
|
||||
A clear summary of the bug.
|
||||
|
||||
### Steps to Reproduce
|
||||
|
||||
```
|
||||
```python
|
||||
from mem0 import Memory
|
||||
|
||||
Please also paste or describe the results you observe instead of the expected results. If you observe an error, please paste the error message including the **full** traceback of the exception. It may be relevant to wrap error messages in ```` ```triple quotes blocks``` ````.
|
||||
placeholder: |
|
||||
A clear and concise description of what the bug is.
|
||||
m = Memory()
|
||||
# Your code here...
|
||||
```
|
||||
|
||||
```python
|
||||
Sample code to reproduce the problem
|
||||
```
|
||||
### Expected Behavior
|
||||
|
||||
```
|
||||
The error message you got, with the full traceback.
|
||||
````
|
||||
validations:
|
||||
required: true
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: >
|
||||
Thanks for contributing 🎉!
|
||||
What you expected to happen.
|
||||
|
||||
### Actual Behavior
|
||||
|
||||
What actually happened. Paste the full error traceback if applicable.
|
||||
|
||||
### Environment
|
||||
|
||||
- mem0 version:
|
||||
- Python/Node version:
|
||||
- OS:
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: 1-on-1 Session
|
||||
url: https://cal.com/taranjeetio/ec
|
||||
about: Speak directly with Taranjeet, the founder, to discuss issues, share feedback, or explore improvements for Embedchain
|
||||
- name: Discord
|
||||
- name: Discord Community
|
||||
url: https://discord.gg/6PzXDgEjG5
|
||||
about: General community discussions
|
||||
about: Ask questions and discuss with the community
|
||||
- name: Documentation
|
||||
url: https://docs.mem0.ai
|
||||
about: Read the official mem0 documentation
|
||||
|
||||
@@ -1,11 +1,23 @@
|
||||
name: Documentation
|
||||
description: Report an issue related to the Embedchain docs.
|
||||
title: "DOC: <Please write a comprehensive title after the 'DOC: ' prefix>"
|
||||
name: Documentation Issue
|
||||
description: Report an issue or suggest an improvement to the mem0 docs
|
||||
labels: ["documentation"]
|
||||
|
||||
body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Issue with current documentation:"
|
||||
description: >
|
||||
Please make sure to leave a reference to the document/code you're
|
||||
referring to.
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
value: |
|
||||
### Page
|
||||
|
||||
Link to the docs page: https://docs.mem0.ai/...
|
||||
|
||||
### What's Wrong or Missing
|
||||
|
||||
Describe what's incorrect, unclear, or missing.
|
||||
|
||||
### Suggested Fix
|
||||
|
||||
How should the docs be improved?
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -1,23 +1,41 @@
|
||||
name: 🚀 Feature request
|
||||
description: Submit a proposal/request for a new Embedchain feature
|
||||
name: Feature Request
|
||||
description: Suggest a new feature or improvement for mem0
|
||||
labels: ["enhancement"]
|
||||
|
||||
body:
|
||||
- type: textarea
|
||||
id: feature-request
|
||||
attributes:
|
||||
label: 🚀 The feature
|
||||
description: >
|
||||
A clear and concise description of the feature proposal
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Motivation, pitch
|
||||
description: >
|
||||
Please outline the motivation for the proposal. Is your feature request related to a specific problem? e.g., *"I'm working on X and would like Y to be possible"*. If this is related to another GitHub issue, please link here too.
|
||||
validations:
|
||||
required: true
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: >
|
||||
Thanks for contributing 🎉!
|
||||
- type: dropdown
|
||||
id: component
|
||||
attributes:
|
||||
label: Component
|
||||
description: Which part of mem0 does this relate to?
|
||||
options:
|
||||
- Core / Python SDK
|
||||
- TypeScript SDK
|
||||
- Vector Store (Qdrant, PGVector, Redis, Chroma, etc.)
|
||||
- Graph Memory (Neo4j, Memgraph, etc.)
|
||||
- Ollama / Local Models
|
||||
- OpenClaw
|
||||
- REST API
|
||||
- Benchmarks / Evals
|
||||
- Other
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
value: |
|
||||
### Use Case
|
||||
|
||||
What problem are you trying to solve?
|
||||
|
||||
### Proposed Solution
|
||||
|
||||
How should this work? Include API examples or pseudocode if helpful.
|
||||
|
||||
### Alternatives Considered
|
||||
|
||||
Any workarounds you've tried or other approaches considered.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -1,41 +1,38 @@
|
||||
## Linked Issue
|
||||
|
||||
Closes #<!-- issue number -->
|
||||
|
||||
## Description
|
||||
|
||||
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
|
||||
<!-- What does this PR do? Why is it needed? -->
|
||||
|
||||
Fixes # (issue)
|
||||
## Type of Change
|
||||
|
||||
## Type of change
|
||||
|
||||
Please delete options that are not relevant.
|
||||
|
||||
- [ ] Bug fix (non-breaking change which fixes an issue)
|
||||
- [ ] New feature (non-breaking change which adds functionality)
|
||||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
||||
- [ ] Refactor (does not change functionality, e.g. code style improvements, linting)
|
||||
- [ ] Bug fix (non-breaking change that fixes an issue)
|
||||
- [ ] New feature (non-breaking change that adds functionality)
|
||||
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
|
||||
- [ ] Refactor (no functional changes)
|
||||
- [ ] Documentation update
|
||||
|
||||
## How Has This Been Tested?
|
||||
## Breaking Changes
|
||||
|
||||
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
|
||||
<!-- If this is a breaking change, describe what breaks and the migration path. Delete this section if not applicable. -->
|
||||
|
||||
Please delete options that are not relevant.
|
||||
N/A
|
||||
|
||||
- [ ] Unit Test
|
||||
- [ ] Test Script (please provide)
|
||||
## Test Coverage
|
||||
|
||||
## Checklist:
|
||||
- [ ] I added/updated unit tests
|
||||
- [ ] I added/updated integration tests
|
||||
- [ ] I tested manually (describe below)
|
||||
- [ ] No tests needed (explain why)
|
||||
|
||||
- [ ] My code follows the style guidelines of this project
|
||||
- [ ] I have performed a self-review of my own code
|
||||
- [ ] I have commented my code, particularly in hard-to-understand areas
|
||||
- [ ] I have made corresponding changes to the documentation
|
||||
- [ ] My changes generate no new warnings
|
||||
- [ ] I have added tests that prove my fix is effective or that my feature works
|
||||
- [ ] New and existing unit tests pass locally with my changes
|
||||
- [ ] Any dependent changes have been merged and published in downstream modules
|
||||
- [ ] I have checked my code and corrected any misspellings
|
||||
<!-- Describe how you tested this, or link to CI results. -->
|
||||
|
||||
## Maintainer Checklist
|
||||
## Checklist
|
||||
|
||||
- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
|
||||
- [ ] Made sure Checks passed
|
||||
- [ ] My code follows the project's style guidelines
|
||||
- [ ] I have performed a self-review of my code
|
||||
- [ ] I have added tests that prove my fix/feature works
|
||||
- [ ] New and existing tests pass locally
|
||||
- [ ] I have updated documentation if needed
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# Maps dropdown selections to GitHub labels
|
||||
# Used by the advanced-issue-labeler GitHub Action
|
||||
|
||||
component:
|
||||
- label: "sdk-python"
|
||||
matcher: "Core / Python SDK"
|
||||
- label: "sdk-typescript"
|
||||
matcher: "TypeScript SDK"
|
||||
- label: "vector-store"
|
||||
matcher: "Vector Store"
|
||||
- label: "graph-memory"
|
||||
matcher: "Graph Memory"
|
||||
- label: "ollama"
|
||||
matcher: "Ollama"
|
||||
- label: "openclaw"
|
||||
matcher: "OpenClaw"
|
||||
- label: "rest-api"
|
||||
matcher: "REST API"
|
||||
+18
-11
@@ -7,6 +7,8 @@ on:
|
||||
- 'mem0/**'
|
||||
- 'tests/**'
|
||||
- 'embedchain/**'
|
||||
- '.github/workflows/**'
|
||||
- 'pyproject.toml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'mem0/**'
|
||||
@@ -28,6 +30,8 @@ jobs:
|
||||
mem0:
|
||||
- 'mem0/**'
|
||||
- 'tests/**'
|
||||
- '.github/workflows/**'
|
||||
- 'pyproject.toml'
|
||||
embedchain:
|
||||
- 'embedchain/**'
|
||||
|
||||
@@ -37,13 +41,20 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.10", "3.11"]
|
||||
python-version: ["3.10", "3.11", "3.12"]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Clean up disk space
|
||||
run: |
|
||||
df -h
|
||||
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
|
||||
sudo docker image prune --all --force
|
||||
sudo docker builder prune -a
|
||||
df -h
|
||||
- name: Install Hatch
|
||||
run: pip install hatch
|
||||
- name: Load cached venv
|
||||
@@ -56,16 +67,12 @@ jobs:
|
||||
run: sudo apt-get update && sudo apt-get install -y libgeos-dev
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install --upgrade pip wheel setuptools
|
||||
pip install --only-binary=shapely shapely
|
||||
make install_all
|
||||
pip install -e ".[test]"
|
||||
pip install pinecone pinecone-text
|
||||
pip install --upgrade pip
|
||||
pip install -e ".[test,graph,vector_stores,llms,extras]"
|
||||
pip install ruff
|
||||
if: steps.cached-hatch-dependencies.outputs.cache-hit != 'true'
|
||||
- name: Run Formatting
|
||||
run: |
|
||||
mkdir -p .ruff_cache && chmod -R 777 .ruff_cache
|
||||
hatch run format
|
||||
- name: Run Linting
|
||||
run: make lint
|
||||
- name: Run tests and generate coverage report
|
||||
run: make test
|
||||
|
||||
@@ -75,7 +82,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.9", "3.10", "3.11"]
|
||||
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
name: Auto-label issues
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: stefanbuck/github-issue-parser@v3
|
||||
id: issue-parser
|
||||
with:
|
||||
template-path: .github/ISSUE_TEMPLATE/bug_report.yml
|
||||
|
||||
- uses: redhat-plumbers-in-action/advanced-issue-labeler@v3
|
||||
with:
|
||||
issue-form: ${{ steps.issue-parser.outputs.jsonString }}
|
||||
section: component
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
config-path: .github/advanced-issue-labeler.yml
|
||||
|
||||
- uses: stefanbuck/github-issue-parser@v3
|
||||
id: feature-parser
|
||||
if: contains(github.event.issue.labels.*.name, 'enhancement')
|
||||
with:
|
||||
template-path: .github/ISSUE_TEMPLATE/feature_request.yml
|
||||
|
||||
- uses: redhat-plumbers-in-action/advanced-issue-labeler@v3
|
||||
if: contains(github.event.issue.labels.*.name, 'enhancement')
|
||||
with:
|
||||
issue-form: ${{ steps.feature-parser.outputs.jsonString }}
|
||||
section: component
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
config-path: .github/advanced-issue-labeler.yml
|
||||
@@ -0,0 +1,100 @@
|
||||
name: openclaw checks
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'openclaw/**'
|
||||
- '.github/workflows/openclaw-checks.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'openclaw/**'
|
||||
- '.github/workflows/openclaw-checks.yml'
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: openclaw/pnpm-lock.yaml
|
||||
|
||||
- name: Install dependencies
|
||||
run: cd openclaw && pnpm install --frozen-lockfile
|
||||
|
||||
- name: Type check
|
||||
run: cd openclaw && pnpm exec tsc --noEmit
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20, 22]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- name: Setup Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: openclaw/pnpm-lock.yaml
|
||||
|
||||
- name: Install dependencies
|
||||
run: cd openclaw && pnpm install --frozen-lockfile
|
||||
|
||||
- name: Run tests with coverage
|
||||
run: cd openclaw && pnpm exec vitest run --coverage
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
if: matrix.node-version == 20
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
flags: openclaw
|
||||
directory: openclaw/coverage
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: openclaw/pnpm-lock.yaml
|
||||
|
||||
- name: Install dependencies
|
||||
run: cd openclaw && pnpm install --frozen-lockfile
|
||||
|
||||
- name: Build
|
||||
run: cd openclaw && pnpm build
|
||||
|
||||
- name: Verify dist output exists
|
||||
run: |
|
||||
test -f openclaw/dist/index.js || (echo "Build output missing: dist/index.js" && exit 1)
|
||||
test -f openclaw/dist/index.d.ts || (echo "Build output missing: dist/index.d.ts" && exit 1)
|
||||
@@ -0,0 +1,48 @@
|
||||
name: Close stale issues
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
# Issue settings
|
||||
days-before-issue-stale: 90
|
||||
days-before-issue-close: 14
|
||||
stale-issue-label: 'stale'
|
||||
stale-issue-message: >
|
||||
This issue has been automatically marked as stale because it has not
|
||||
had any activity in 90 days. It will be closed in 14 days if no
|
||||
further activity occurs. If this is still relevant, please leave a
|
||||
comment or remove the `stale` label.
|
||||
close-issue-message: >
|
||||
This issue has been closed due to inactivity. If this is still
|
||||
relevant, feel free to reopen it or create a new issue.
|
||||
|
||||
# PR settings — mark stale but never auto-close
|
||||
days-before-pr-stale: 90
|
||||
days-before-pr-close: -1
|
||||
stale-pr-label: 'stale'
|
||||
stale-pr-message: >
|
||||
This pull request has been automatically marked as stale because it
|
||||
has not had any activity in 90 days. Please update your branch and
|
||||
address any review comments, or it may be closed in the future.
|
||||
|
||||
# Exempt these labels from stale processing
|
||||
exempt-issue-labels: 'P0-critical,P1-high,good first issue,security'
|
||||
exempt-pr-labels: 'P0-critical,P1-high'
|
||||
|
||||
# Remove stale label when there is new activity
|
||||
remove-stale-when-updated: true
|
||||
|
||||
# Process up to 100 issues per run to stay within API limits
|
||||
operations-per-run: 100
|
||||
@@ -0,0 +1,110 @@
|
||||
name: TypeScript SDK CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'mem0-ts/**'
|
||||
- '.github/workflows/ts-sdk-ci.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'mem0-ts/**'
|
||||
|
||||
jobs:
|
||||
check_changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
ts_sdk_changed: ${{ steps.filter.outputs.ts_sdk }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
ts_sdk:
|
||||
- 'mem0-ts/**'
|
||||
|
||||
build_ts_sdk:
|
||||
needs: check_changes
|
||||
if: needs.check_changes.outputs.ts_sdk_changed == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20, 22]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: mem0-ts/pnpm-lock.yaml
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: mem0-ts
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Lint
|
||||
working-directory: mem0-ts
|
||||
run: npx prettier --check .
|
||||
|
||||
- name: Build
|
||||
working-directory: mem0-ts
|
||||
run: pnpm run build
|
||||
|
||||
- name: Run unit tests
|
||||
working-directory: mem0-ts
|
||||
run: pnpm run test:unit
|
||||
|
||||
- name: Verify package exports
|
||||
working-directory: mem0-ts
|
||||
run: |
|
||||
node -e "const m = require('./dist/index.js'); console.log('Client exports:', Object.keys(m).length)"
|
||||
node -e "const m = require('./dist/oss/index.js'); console.log('OSS exports:', Object.keys(m).length)"
|
||||
|
||||
- name: Upload coverage
|
||||
if: matrix.node-version == 20
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: coverage-report
|
||||
path: mem0-ts/coverage/
|
||||
|
||||
integration_ts_sdk:
|
||||
needs: build_ts_sdk
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
node-version: [20, 22]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: mem0-ts/pnpm-lock.yaml
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: mem0-ts
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Build
|
||||
working-directory: mem0-ts
|
||||
run: pnpm run build
|
||||
|
||||
- name: Run integration tests (with cleanup)
|
||||
working-directory: mem0-ts
|
||||
env:
|
||||
MEM0_API_KEY: ${{ secrets.MEM0_API_KEY }}
|
||||
run: pnpm run test:integration
|
||||
@@ -25,6 +25,7 @@ We use `hatch` for managing development environments. To set up:
|
||||
hatch shell dev_py_3_9 # Python 3.9
|
||||
hatch shell dev_py_3_10 # Python 3.10
|
||||
hatch shell dev_py_3_11 # Python 3.11
|
||||
hatch shell dev_py_3_12 # Python 3.12
|
||||
|
||||
# The environment will automatically install all dev dependencies
|
||||
# Run tests within the activated shell:
|
||||
@@ -51,6 +52,7 @@ make test
|
||||
make test-py-3.9 # Python 3.9 environment
|
||||
make test-py-3.10 # Python 3.10 environment
|
||||
make test-py-3.11 # Python 3.11 environment
|
||||
make test-py-3.12 # Python 3.12 environment
|
||||
|
||||
# When using hatch shells, run tests with:
|
||||
make test # After activating a shell with hatch shell test_XX
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
# Migration Guide: Upgrading to mem0 1.0.0
|
||||
|
||||
## TL;DR
|
||||
|
||||
**What changed?** We simplified the API by removing confusing version parameters. Now everything returns a consistent format: `{"results": [...]}`.
|
||||
|
||||
**What you need to do:**
|
||||
1. Upgrade: `pip install mem0ai==1.0.0`
|
||||
2. Remove `version` and `output_format` parameters from your code
|
||||
3. Update response handling to use `result["results"]` instead of treating responses as lists
|
||||
|
||||
**Time needed:** ~5-10 minutes for most projects
|
||||
|
||||
---
|
||||
|
||||
## Quick Migration Guide
|
||||
|
||||
### 1. Install the Update
|
||||
|
||||
```bash
|
||||
pip install mem0ai==1.0.0
|
||||
```
|
||||
|
||||
### 2. Update Your Code
|
||||
|
||||
**If you're using the Memory API:**
|
||||
|
||||
```python
|
||||
# Before
|
||||
memory = Memory(config=MemoryConfig(version="v1.1"))
|
||||
result = memory.add("I like pizza")
|
||||
|
||||
# After
|
||||
memory = Memory() # That's it - version is automatic now
|
||||
result = memory.add("I like pizza")
|
||||
```
|
||||
|
||||
**If you're using the Client API:**
|
||||
|
||||
```python
|
||||
# Before
|
||||
client.add(messages, output_format="v1.1")
|
||||
client.search(query, version="v2", output_format="v1.1")
|
||||
|
||||
# After
|
||||
client.add(messages) # Just remove those extra parameters
|
||||
client.search(query)
|
||||
```
|
||||
|
||||
### 3. Update How You Handle Responses
|
||||
|
||||
All responses now use the same format: a dictionary with `"results"` key.
|
||||
|
||||
```python
|
||||
# Before - you might have done this
|
||||
result = memory.add("I like pizza")
|
||||
for item in result: # Treating it as a list
|
||||
print(item)
|
||||
|
||||
# After - do this instead
|
||||
result = memory.add("I like pizza")
|
||||
for item in result["results"]: # Access the results key
|
||||
print(item)
|
||||
|
||||
# Graph relations (if you use them)
|
||||
if "relations" in result:
|
||||
for relation in result["relations"]:
|
||||
print(relation)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Enhanced Message Handling
|
||||
|
||||
The platform client (MemoryClient) now supports the same flexible message formats as the OSS version:
|
||||
|
||||
```python
|
||||
from mem0 import MemoryClient
|
||||
|
||||
client = MemoryClient(api_key="your-key")
|
||||
|
||||
# All three formats now work:
|
||||
|
||||
# 1. Single string (automatically converted to user message)
|
||||
client.add("I like pizza", user_id="alice")
|
||||
|
||||
# 2. Single message dictionary
|
||||
client.add({"role": "user", "content": "I like pizza"}, user_id="alice")
|
||||
|
||||
# 3. List of messages (conversation)
|
||||
client.add([
|
||||
{"role": "user", "content": "I like pizza"},
|
||||
{"role": "assistant", "content": "I'll remember that!"}
|
||||
], user_id="alice")
|
||||
```
|
||||
|
||||
### Async Mode Configuration
|
||||
|
||||
The `async_mode` parameter now defaults to `True` but can be configured:
|
||||
|
||||
```python
|
||||
# Default behavior (async_mode=True)
|
||||
client.add(messages, user_id="alice")
|
||||
|
||||
# Explicitly set async mode
|
||||
client.add(messages, user_id="alice", async_mode=True)
|
||||
|
||||
# Disable async mode if needed
|
||||
client.add(messages, user_id="alice", async_mode=False)
|
||||
```
|
||||
|
||||
**Note:** `async_mode=True` provides better performance for most use cases. Only set it to `False` if you have specific synchronous processing requirements.
|
||||
|
||||
---
|
||||
|
||||
## That's It!
|
||||
|
||||
For most users, that's all you need to know. The changes are:
|
||||
- ✅ No more `version` or `output_format` parameters
|
||||
- ✅ Consistent `{"results": [...]}` response format
|
||||
- ✅ Cleaner, simpler API
|
||||
|
||||
---
|
||||
|
||||
## Common Issues
|
||||
|
||||
**Getting `KeyError: 'results'`?**
|
||||
|
||||
Your code is still treating the response as a list. Update it:
|
||||
```python
|
||||
# Change this:
|
||||
for memory in response:
|
||||
|
||||
# To this:
|
||||
for memory in response["results"]:
|
||||
```
|
||||
|
||||
**Getting `TypeError: unexpected keyword argument`?**
|
||||
|
||||
You're still passing old parameters. Remove them:
|
||||
```python
|
||||
# Change this:
|
||||
client.add(messages, output_format="v1.1")
|
||||
|
||||
# To this:
|
||||
client.add(messages)
|
||||
```
|
||||
|
||||
**Seeing deprecation warnings?**
|
||||
|
||||
Remove any explicit `version="v1.0"` from your config:
|
||||
```python
|
||||
# Change this:
|
||||
memory = Memory(config=MemoryConfig(version="v1.0"))
|
||||
|
||||
# To this:
|
||||
memory = Memory()
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## What's New in 1.0.0
|
||||
|
||||
- **Better vector stores:** Fixed OpenSearch and improved reliability across all stores
|
||||
- **Cleaner API:** One way to do things, no more confusing options
|
||||
- **Enhanced GCP support:** Better Vertex AI configuration options
|
||||
- **Flexible message input:** Platform client now accepts strings, dicts, and lists (aligned with OSS)
|
||||
- **Configurable async_mode:** Now defaults to `True` but users can override if needed
|
||||
|
||||
---
|
||||
|
||||
## Need Help?
|
||||
|
||||
- Check [GitHub Issues](https://github.com/mem0ai/mem0/issues)
|
||||
- Read the [documentation](https://docs.mem0.ai/)
|
||||
- Open a new issue if you're stuck
|
||||
|
||||
---
|
||||
|
||||
## Advanced: Configuration Changes
|
||||
|
||||
**If you configured vector stores with version:**
|
||||
|
||||
```python
|
||||
# Before
|
||||
config = MemoryConfig(
|
||||
version="v1.1",
|
||||
vector_store=VectorStoreConfig(...)
|
||||
)
|
||||
|
||||
# After
|
||||
config = MemoryConfig(
|
||||
vector_store=VectorStoreConfig(...)
|
||||
)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Testing Your Migration
|
||||
|
||||
Quick sanity check:
|
||||
|
||||
```python
|
||||
from mem0 import Memory
|
||||
|
||||
memory = Memory()
|
||||
|
||||
# Add should return a dict with "results"
|
||||
result = memory.add("I like pizza", user_id="test")
|
||||
assert "results" in result
|
||||
|
||||
# Search should return a dict with "results"
|
||||
search = memory.search("food", user_id="test")
|
||||
assert "results" in search
|
||||
|
||||
# Get all should return a dict with "results"
|
||||
all_memories = memory.get_all(user_id="test")
|
||||
assert "results" in all_memories
|
||||
|
||||
print("✅ Migration successful!")
|
||||
```
|
||||
@@ -12,8 +12,8 @@ install:
|
||||
|
||||
install_all:
|
||||
pip install ruff==0.6.9 groq together boto3 litellm ollama chromadb weaviate weaviate-client sentence_transformers vertexai \
|
||||
google-generativeai elasticsearch opensearch-py vecs "pinecone<7.0.0" pinecone-text faiss-cpu langchain-community \
|
||||
upstash-vector azure-search-documents langchain-memgraph langchain-neo4j rank-bm25 pymochow
|
||||
google-generativeai elasticsearch opensearch-py vecs "pinecone<7.0.0" pinecone-text faiss-cpu langchain-community \
|
||||
upstash-vector azure-search-documents langchain-memgraph langchain-neo4j langchain-aws rank-bm25 pymochow pymongo psycopg kuzu databricks-sdk valkey
|
||||
|
||||
# Format code with ruff
|
||||
format:
|
||||
@@ -50,3 +50,6 @@ test-py-3.10:
|
||||
|
||||
test-py-3.11:
|
||||
hatch run dev_py_3_11:test
|
||||
|
||||
test-py-3.12:
|
||||
hatch run dev_py_3_12:test
|
||||
|
||||
@@ -15,13 +15,11 @@
|
||||
<a href="https://mem0.dev/DiG">Join Discord</a>
|
||||
·
|
||||
<a href="https://mem0.dev/demo">Demo</a>
|
||||
·
|
||||
<a href="https://mem0.dev/openmemory">OpenMemory</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://mem0.dev/DiG">
|
||||
<img src="https://dcbadge.vercel.app/api/server/6PzXDgEjG5?style=flat" alt="Mem0 Discord">
|
||||
<img src="https://img.shields.io/badge/Discord-%235865F2.svg?&logo=discord&logoColor=white" alt="Mem0 Discord">
|
||||
</a>
|
||||
<a href="https://pepy.tech/project/mem0ai">
|
||||
<img src="https://img.shields.io/pypi/dm/mem0ai" alt="Mem0 PyPI - Downloads">
|
||||
@@ -47,6 +45,8 @@
|
||||
<strong>⚡ +26% Accuracy vs. OpenAI Memory • 🚀 91% Faster • 💰 90% Fewer Tokens</strong>
|
||||
</p>
|
||||
|
||||
> **🎉 mem0ai v1.0.0 is now available!** This major release includes API modernization, improved vector store support, and enhanced GCP integration. [See migration guide →](MIGRATION_GUIDE_v1.0.md)
|
||||
|
||||
## 🔥 Research Highlights
|
||||
- **+26% Accuracy** over OpenAI Memory on the LOCOMO benchmark
|
||||
- **91% Faster Responses** than full-context, ensuring low-latency at scale
|
||||
@@ -95,7 +95,7 @@ npm install mem0ai
|
||||
|
||||
### Basic Usage
|
||||
|
||||
Mem0 requires an LLM to function, with `gpt-4o-mini` from OpenAI as the default. However, it supports a variety of LLMs; for details, refer to our [Supported LLMs documentation](https://docs.mem0.ai/components/llms/overview).
|
||||
Mem0 requires an LLM to function, with `gpt-4.1-nano-2025-04-14 from OpenAI as the default. However, it supports a variety of LLMs; for details, refer to our [Supported LLMs documentation](https://docs.mem0.ai/components/llms/overview).
|
||||
|
||||
First step is to instantiate the memory:
|
||||
|
||||
@@ -114,7 +114,7 @@ def chat_with_memories(message: str, user_id: str = "default_user") -> str:
|
||||
# Generate Assistant response
|
||||
system_prompt = f"You are a helpful AI. Answer the question based on query and memories.\nUser Memories:\n{memories_str}"
|
||||
messages = [{"role": "system", "content": system_prompt}, {"role": "user", "content": message}]
|
||||
response = openai_client.chat.completions.create(model="gpt-4o-mini", messages=messages)
|
||||
response = openai_client.chat.completions.create(model="gpt-4.1-nano-2025-04-14", messages=messages)
|
||||
assistant_response = response.choices[0].message.content
|
||||
|
||||
# Create new memories from the conversation
|
||||
@@ -166,4 +166,4 @@ We now have a paper you can cite:
|
||||
|
||||
## ⚖️ License
|
||||
|
||||
Apache 2.0 — see the [LICENSE](LICENSE) file for details.
|
||||
Apache 2.0 — see the [LICENSE](https://github.com/mem0ai/mem0/blob/main/LICENSE) file for details.
|
||||
@@ -0,0 +1,5 @@
|
||||
<Note type="info">
|
||||
📢 Heads up!
|
||||
We're moving to async memory add for a faster experience.
|
||||
If you signed up after July 1st, 2025, your add requests will work in the background and return right away.
|
||||
</Note>
|
||||
@@ -1,3 +1,3 @@
|
||||
<Note type="info">
|
||||
📢 Announcing our research paper: Mem0 achieves <strong>26%</strong> higher accuracy than OpenAI Memory, <strong>91%</strong> lower latency, and <strong>90%</strong> token savings! [Read the paper](https://mem0.ai/research) to learn how we're revolutionizing AI agent memory.
|
||||
<strong>🎉 Mem0 1.0.0 is here!</strong> Enhanced filtering, reranking, and smarter memory management.
|
||||
</Note>
|
||||
+87
-50
@@ -1,71 +1,108 @@
|
||||
---
|
||||
title: Overview
|
||||
icon: "info"
|
||||
title: "Overview"
|
||||
icon: "terminal"
|
||||
iconType: "solid"
|
||||
description: "REST APIs for memory management, search, and entity operations"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
## Mem0 REST API
|
||||
|
||||
Mem0 provides a powerful set of APIs that allow you to integrate advanced memory management capabilities into your applications. Our APIs are designed to be intuitive, efficient, and scalable, enabling you to create, retrieve, update, and delete memories across various entities such as users, agents, apps, and runs.
|
||||
Mem0 provides a comprehensive REST API for integrating advanced memory capabilities into your applications. Create, search, update, and manage memories across users, agents, and custom entities with simple HTTP requests.
|
||||
|
||||
## Key Features
|
||||
<Info>
|
||||
**Quick start:** Get your API key from the [Mem0 Dashboard](https://app.mem0.ai/dashboard/api-keys) and make your first memory operation in minutes.
|
||||
</Info>
|
||||
|
||||
- **Memory Management**: Add, retrieve, update, and delete memories with ease.
|
||||
- **Entity-based Operations**: Perform operations on memories associated with specific users, agents, apps, or runs.
|
||||
- **Advanced Search**: Utilize our search API to find relevant memories based on various criteria.
|
||||
- **History Tracking**: Access the history of memory interactions for comprehensive analysis.
|
||||
- **User Management**: Manage user entities and their associated memories.
|
||||
---
|
||||
|
||||
## API Structure
|
||||
## Quick Start Guide
|
||||
|
||||
Our API is organized into several main categories:
|
||||
Get started with Mem0 API in three simple steps:
|
||||
|
||||
1. **Memory APIs**: Core operations for managing individual memories and collections.
|
||||
2. **Entities APIs**: Manage different entity types (users, agents, etc.) and their associated memories.
|
||||
3. **Search API**: Advanced search functionality to retrieve relevant memories.
|
||||
4. **History API**: Track and retrieve the history of memory interactions.
|
||||
1. **[Add Memories](/api-reference/memory/add-memories)** - Store information and context from user conversations
|
||||
2. **[Search Memories](/api-reference/memory/search-memories)** - Retrieve relevant memories using semantic search
|
||||
3. **[Get Memories](/api-reference/memory/get-memories)** - Fetch all memories for a specific entity
|
||||
|
||||
---
|
||||
|
||||
## Core Operations
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Add Memories" icon="plus" href="/api-reference/memory/add-memories">
|
||||
Store new memories from conversations and interactions
|
||||
</Card>
|
||||
|
||||
<Card title="Search Memories" icon="magnifying-glass" href="/api-reference/memory/search-memories">
|
||||
Find relevant memories using semantic search with filters
|
||||
</Card>
|
||||
|
||||
<Card title="Update Memory" icon="pen" href="/api-reference/memory/update-memory">
|
||||
Modify existing memory content and metadata
|
||||
</Card>
|
||||
|
||||
<Card title="Delete Memory" icon="trash" href="/api-reference/memory/delete-memory">
|
||||
Remove specific memories or batch delete operations
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
---
|
||||
|
||||
## API Categories
|
||||
|
||||
Explore the full API organized by functionality:
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Memory APIs" icon="microchip" href="/api-reference/memory/add-memories">
|
||||
Core and advanced operations: CRUD, search, batch updates, history, and exports
|
||||
</Card>
|
||||
|
||||
<Card title="Events APIs" icon="clock" href="/api-reference/events/get-events">
|
||||
Track and monitor the status of asynchronous memory operations
|
||||
</Card>
|
||||
|
||||
<Card title="Entities APIs" icon="users" href="/api-reference/entities/get-users">
|
||||
Manage users, agents, and their associated memory data
|
||||
</Card>
|
||||
|
||||
<Card title="Organizations & Projects" icon="building" href="/api-reference/organizations-projects">
|
||||
Multi-tenant support, access control, and team collaboration
|
||||
</Card>
|
||||
|
||||
<Card title="Webhooks" icon="webhook" href="/api-reference/webhook/create-webhook">
|
||||
Real-time notifications for memory events and updates
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
<Note>
|
||||
**Building multi-tenant apps?** Learn about [Organizations & Projects](/api-reference/organizations-projects) for team isolation and access control.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Authentication
|
||||
|
||||
All API requests require authentication using HTTP Basic Auth. Ensure you include your API key in the Authorization header of each request.
|
||||
All API requests require authentication using Token-based authentication. Include your API key in the Authorization header:
|
||||
|
||||
## Organizations and projects (optional)
|
||||
|
||||
Organizations and projects provide the following capabilities:
|
||||
|
||||
- **Multi-org/project Support**: Specify organization and project when initializing the Mem0 client to attribute API usage appropriately
|
||||
- **Member Management**: Control access to data through organization and project membership
|
||||
- **Access Control**: Only members can access memories and data within their organization/project scope
|
||||
- **Team Isolation**: Maintain data separation between different teams and projects for secure collaboration
|
||||
|
||||
Example with the mem0 Python package:
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Python">
|
||||
|
||||
```python
|
||||
from mem0 import MemoryClient
|
||||
client = MemoryClient(org_id='YOUR_ORG_ID', project_id='YOUR_PROJECT_ID')
|
||||
```bash
|
||||
Authorization: Token <your-api-key>
|
||||
```
|
||||
|
||||
</Tab>
|
||||
Get your API key from the [Mem0 Dashboard](https://app.mem0.ai/dashboard/api-keys).
|
||||
|
||||
<Tab title="Node.js">
|
||||
<Warning>
|
||||
**Keep your API key secure.** Never expose it in client-side code or public repositories. Use environment variables and server-side requests only.
|
||||
</Warning>
|
||||
|
||||
```javascript
|
||||
import { MemoryClient } from "mem0ai";
|
||||
const client = new MemoryClient({organizationId: "YOUR_ORG_ID", projectId: "YOUR_PROJECT_ID"});
|
||||
```
|
||||
---
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
## Next Steps
|
||||
|
||||
## Getting Started
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Add Your First Memory" icon="rocket" href="/api-reference/memory/add-memories">
|
||||
Start storing memories via the REST API
|
||||
</Card>
|
||||
|
||||
To begin using the Mem0 API, you'll need to:
|
||||
|
||||
1. Sign up for a [Mem0 account](https://app.mem0.ai) and obtain your API key.
|
||||
2. Familiarize yourself with the API endpoints and their functionalities.
|
||||
3. Make your first API call to add or retrieve a memory.
|
||||
|
||||
Explore the detailed documentation for each API endpoint to learn more about request/response formats, parameters, and example usage.
|
||||
<Card title="Search with Filters" icon="filter" href="/api-reference/memory/search-memories">
|
||||
Learn advanced search and filtering techniques
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Delete User'
|
||||
openapi: delete /v1/entities/{entity_type}/{entity_id}/
|
||||
description: "Remove a user entity from the Mem0 platform by entity type and ID using the DELETE endpoint."
|
||||
openapi: delete /v2/entities/{entity_type}/{entity_id}/
|
||||
---
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Get Users'
|
||||
description: "Retrieve a list of all user entities stored in the Mem0 platform using the GET endpoint."
|
||||
openapi: get /v1/entities/
|
||||
---
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
title: 'Get Event'
|
||||
description: "Retrieve details of a specific event by ID, including status and payload for async memory operations."
|
||||
openapi: get /v1/event/{event_id}/
|
||||
---
|
||||
|
||||
Retrieve details about a specific event by passing its `event_id`. This endpoint is particularly helpful for tracking the status, payload, and completion details of asynchronous memory operations.
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
title: 'Get Events'
|
||||
description: "List recent events for your organization and project, useful for dashboards, alerting, and audit logging."
|
||||
openapi: get /v1/events/
|
||||
---
|
||||
|
||||
List recent events for your organization and project.
|
||||
|
||||
## Use Cases
|
||||
|
||||
- **Dashboards**: Summarize adds/searches over time by paging through events.
|
||||
- **Alerting**: Poll for `FAILED` events and trigger follow-up workflows.
|
||||
- **Audit**: Store the returned payload/metadata for compliance logs.
|
||||
|
||||
@@ -1,4 +1,98 @@
|
||||
---
|
||||
title: 'Add Memories'
|
||||
description: "Add facts, messages, or metadata to a user memory store with support for async processing and event tracking."
|
||||
openapi: post /v1/memories/
|
||||
---
|
||||
---
|
||||
|
||||
Add new facts, messages, or metadata to a user’s memory store. The Add Memories endpoint accepts either raw text or conversational turns and commits them asynchronously so the memory is ready for later search, retrieval, and graph queries.
|
||||
|
||||
## Endpoint
|
||||
|
||||
- **Method**: `POST`
|
||||
- **URL**: `/v1/memories/`
|
||||
- **Content-Type**: `application/json`
|
||||
|
||||
Memories are processed asynchronously by default. The response contains queued events you can track while the platform finalizes enrichment.
|
||||
|
||||
## Required headers
|
||||
|
||||
| Header | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `Authorization: Token <MEM0_API_KEY>` | Yes | API key scoped to your workspace. |
|
||||
| `Accept: application/json` | Yes | Ensures a JSON response. |
|
||||
|
||||
## Request body
|
||||
|
||||
Provide at least one message or direct memory string. Most callers supply `messages` so Mem0 can infer structured memories as part of ingestion.
|
||||
|
||||
<CodeGroup>
|
||||
```json Basic request
|
||||
{
|
||||
"user_id": "alice",
|
||||
"messages": [
|
||||
{ "role": "user", "content": "I moved to Austin last month." }
|
||||
],
|
||||
"metadata": {
|
||||
"source": "onboarding_form"
|
||||
}
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
### Common fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `user_id` | string | No* | Associates the memory with a user. Provide when you want the memory scoped to a specific identity. |
|
||||
| `messages` | array | No* | Conversation turns for Mem0 to infer memories from. Each object should include `role` and `content`. |
|
||||
| `metadata` | object | Optional | Custom key/value metadata (e.g., `{"topic": "preferences"}`). |
|
||||
| `infer` | boolean (default `true`) | Optional | Set to `false` to skip inference and store the provided text as-is. |
|
||||
| `async_mode` | boolean (default `true`) | Optional | Controls asynchronous processing. Most clients leave this enabled. |
|
||||
| `output_format` | string (default `v1.1`) | Optional | Response format. `v1.1` wraps results in a `results` array. |
|
||||
|
||||
> \* Provide at least one `messages` entry to describe what you are storing. For scoped memories, include `user_id`. You can also attach `agent_id`, `app_id`, `run_id`, `project_id`, or `org_id` to refine ownership.
|
||||
|
||||
## Response
|
||||
|
||||
Successful requests return an array of events queued for processing. Each event includes the generated memory text and an identifier you can persist for auditing.
|
||||
|
||||
<CodeGroup>
|
||||
```json 200 response
|
||||
[
|
||||
{
|
||||
"id": "mem_01JF8ZS4Y0R0SPM13R5R6H32CJ",
|
||||
"event": "ADD",
|
||||
"data": {
|
||||
"memory": "The user moved to Austin in 2025."
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
```json 400 response
|
||||
{
|
||||
"error": "400 Bad Request",
|
||||
"details": {
|
||||
"message": "Invalid input data. Please refer to the memory creation documentation at https://docs.mem0.ai/platform/quickstart#4-1-create-memories for correct formatting and required fields."
|
||||
}
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
## Graph relationships
|
||||
|
||||
Add Memories can enrich the knowledge graph on write. Set `enable_graph: true` to create entity nodes and relationships for the stored memory. Use this when you want downstream `get_all` or search calls to traverse connected entities.
|
||||
|
||||
<CodeGroup>
|
||||
```json Graph-aware request
|
||||
{
|
||||
"user_id": "alice",
|
||||
"messages": [
|
||||
{ "role": "user", "content": "I met with Dr. Lee at General Hospital." }
|
||||
],
|
||||
"enable_graph": true
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
The response follows the same format, and related entities become available in [Graph Memory](/platform/features/graph-memory) queries.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Batch Delete Memories'
|
||||
description: "Delete multiple memories in a single batch request using the Mem0 API DELETE endpoint."
|
||||
openapi: delete /v1/batch/
|
||||
---
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Batch Update Memories'
|
||||
description: "Update multiple memories in a single batch request using the Mem0 API PUT endpoint."
|
||||
openapi: put /v1/batch/
|
||||
---
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: 'Create Memory Export'
|
||||
description: "Submit an export job to create a structured memory export using a customizable Pydantic schema and filters."
|
||||
openapi: post /v1/exports/
|
||||
---
|
||||
|
||||
Submit a job to create a structured export of memories using a customizable Pydantic schema. This process may take some time to complete, especially if you’re exporting a large number of memories. You can tailor the export by applying various filters (e.g., user_id, agent_id, run_id, or session_id) and by modifying the Pydantic schema to ensure the final data matches your exact needs.
|
||||
Submit a job to create a structured export of memories using a customizable Pydantic schema. This process may take some time to complete, especially if you're exporting a large number of memories. You can tailor the export by applying various filters (e.g., `user_id`, `agent_id`, `run_id`, or `session_id`) and by modifying the Pydantic schema to ensure the final data matches your exact needs.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Delete Memories'
|
||||
description: "Delete all memories matching specified filters from the Mem0 memory store using the DELETE endpoint."
|
||||
openapi: delete /v1/memories/
|
||||
---
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Delete Memory'
|
||||
description: "Delete a single memory by its unique memory ID from the Mem0 platform using the DELETE endpoint."
|
||||
openapi: delete /v1/memories/{memory_id}/
|
||||
---
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Feedback'
|
||||
description: "Submit positive or negative feedback on memory results to help improve memory accuracy and relevance."
|
||||
openapi: post /v1/feedback/
|
||||
---
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
---
|
||||
title: "Get Memories"
|
||||
description: "Retrieve memories with advanced filtering using logical operators like AND, OR, NOT, and comparison queries."
|
||||
openapi: post /v2/memories/
|
||||
---
|
||||
|
||||
The v2 get memories API is powerful and flexible, allowing for more precise memory listing without the need for a search query. It supports complex logical operations (AND, OR, NOT) and comparison operators for advanced filtering capabilities. The comparison operators include:
|
||||
|
||||
- `in`: Matches any of the values specified
|
||||
- `gte`: Greater than or equal to
|
||||
- `lte`: Less than or equal to
|
||||
- `gt`: Greater than
|
||||
- `lt`: Less than
|
||||
- `ne`: Not equal to
|
||||
- `icontains`: Case-insensitive containment check
|
||||
- `*`: Wildcard character that matches everything
|
||||
|
||||
<CodeGroup>
|
||||
```python Code
|
||||
memories = client.get_all(
|
||||
filters={
|
||||
"AND": [
|
||||
{
|
||||
"user_id": "alex"
|
||||
},
|
||||
{
|
||||
"created_at": {"gte": "2024-07-01", "lte": "2024-07-31"}
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
```python Output
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"id": "f4cbdb08-7062-4f3e-8eb2-9f5c80dfe64c",
|
||||
"memory": "Alex is planning a trip to San Francisco from July 1st to July 10th",
|
||||
"created_at": "2024-07-01T12:00:00Z",
|
||||
"updated_at": "2024-07-01T12:00:00Z"
|
||||
},
|
||||
{
|
||||
"id": "a2b8c3d4-5e6f-7g8h-9i0j-1k2l3m4n5o6p",
|
||||
"memory": "Alex prefers vegetarian restaurants",
|
||||
"created_at": "2024-07-05T15:30:00Z",
|
||||
"updated_at": "2024-07-05T15:30:00Z"
|
||||
}
|
||||
],
|
||||
"total": 2
|
||||
}
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
## Graph Memory
|
||||
|
||||
To retrieve graph memory relationships between entities, pass `output_format="v1.1"` in your request. This will return memories with entity and relationship information from the knowledge graph.
|
||||
|
||||
<CodeGroup>
|
||||
```python Code
|
||||
memories = client.get_all(
|
||||
filters={
|
||||
"user_id": "alex"
|
||||
},
|
||||
output_format="v1.1"
|
||||
)
|
||||
```
|
||||
|
||||
```python Output
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"id": "f4cbdb08-7062-4f3e-8eb2-9f5c80dfe64c",
|
||||
"memory": "Alex is planning a trip to San Francisco",
|
||||
"entities": [
|
||||
{
|
||||
"id": "entity-1",
|
||||
"name": "Alex",
|
||||
"type": "person"
|
||||
},
|
||||
{
|
||||
"id": "entity-2",
|
||||
"name": "San Francisco",
|
||||
"type": "location"
|
||||
}
|
||||
],
|
||||
"relations": [
|
||||
{
|
||||
"source": "entity-1",
|
||||
"target": "entity-2",
|
||||
"relationship": "traveling_to"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: 'Get Memory Export'
|
||||
description: "Retrieve the latest structured memory export after submitting an export job, with optional entity filters."
|
||||
openapi: post /v1/exports/get
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Get Memory'
|
||||
description: "Retrieve a single memory by its unique memory ID from the Mem0 platform using the GET endpoint."
|
||||
openapi: get /v1/memories/{memory_id}/
|
||||
---
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Memory History'
|
||||
description: "Retrieve the full change history of a specific memory to track how it has evolved over time."
|
||||
openapi: get /v1/memories/{memory_id}/history/
|
||||
---
|
||||
@@ -0,0 +1,105 @@
|
||||
---
|
||||
title: 'Search Memories'
|
||||
description: "Search memories with semantic queries and advanced filtering using logical and comparison operators."
|
||||
openapi: post /v2/memories/search/
|
||||
---
|
||||
|
||||
The v2 search API is powerful and flexible, allowing for more precise memory retrieval. It supports complex logical operations (AND, OR, NOT) and comparison operators for advanced filtering capabilities. The comparison operators include:
|
||||
- `in`: Matches any of the values specified
|
||||
- `gte`: Greater than or equal to
|
||||
- `lte`: Less than or equal to
|
||||
- `gt`: Greater than
|
||||
- `lt`: Less than
|
||||
- `ne`: Not equal to
|
||||
- `icontains`: Case-insensitive containment check
|
||||
- `*`: Wildcard character that matches everything
|
||||
|
||||
<CodeGroup>
|
||||
```python Platform API Example
|
||||
related_memories = client.search(
|
||||
query="What are Alice's hobbies?",
|
||||
filters={
|
||||
"OR": [
|
||||
{
|
||||
"user_id": "alice"
|
||||
},
|
||||
{
|
||||
"agent_id": {"in": ["travel-agent", "sports-agent"]}
|
||||
}
|
||||
]
|
||||
},
|
||||
)
|
||||
```
|
||||
|
||||
```json Output
|
||||
{
|
||||
"memories": [
|
||||
{
|
||||
"id": "ea925981-272f-40dd-b576-be64e4871429",
|
||||
"memory": "Likes to play cricket and plays cricket on weekends.",
|
||||
"metadata": {
|
||||
"category": "hobbies"
|
||||
},
|
||||
"score": 0.32116443111457704,
|
||||
"created_at": "2024-07-26T10:29:36.630547-07:00",
|
||||
"updated_at": null,
|
||||
"user_id": "alice",
|
||||
"agent_id": "sports-agent"
|
||||
}
|
||||
],
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
<CodeGroup>
|
||||
```python Wildcard Example
|
||||
# Using wildcard to match all run_ids for a specific user
|
||||
all_memories = client.search(
|
||||
query="What are Alice's hobbies?",
|
||||
filters={
|
||||
"AND": [
|
||||
{
|
||||
"user_id": "alice"
|
||||
},
|
||||
{
|
||||
"run_id": "*"
|
||||
}
|
||||
]
|
||||
},
|
||||
)
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
<CodeGroup>
|
||||
```python Categories Filter Examples
|
||||
# Example 1: Using 'contains' for partial matching
|
||||
finance_memories = client.search(
|
||||
query="What are my financial goals?",
|
||||
filters={
|
||||
"AND": [
|
||||
{ "user_id": "alice" },
|
||||
{
|
||||
"categories": {
|
||||
"contains": "finance"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
)
|
||||
|
||||
# Example 2: Using 'in' for exact matching
|
||||
personal_memories = client.search(
|
||||
query="What personal information do you have?",
|
||||
filters={
|
||||
"AND": [
|
||||
{ "user_id": "alice" },
|
||||
{
|
||||
"categories": {
|
||||
"in": ["personal_information"]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
)
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Update Memory'
|
||||
description: "Update the content or metadata of a single memory by its unique ID using the PUT endpoint."
|
||||
openapi: put /v1/memories/{memory_id}/
|
||||
---
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
title: 'Get Memories (v1 - Deprecated)'
|
||||
openapi: get /v1/memories/
|
||||
---
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
title: 'Search Memories (v1 - Deprecated)'
|
||||
openapi: post /v1/memories/search/
|
||||
---
|
||||
@@ -1,65 +0,0 @@
|
||||
---
|
||||
title: 'Get Memories (v2)'
|
||||
openapi: post /v2/memories/
|
||||
---
|
||||
|
||||
The v2 get memories API is powerful and flexible, allowing for more precise memory listing without the need for a search query. It supports complex logical operations (AND, OR, NOT) and comparison operators for advanced filtering capabilities. The comparison operators include:
|
||||
- `in`: Matches any of the values specified
|
||||
- `gte`: Greater than or equal to
|
||||
- `lte`: Less than or equal to
|
||||
- `gt`: Greater than
|
||||
- `lt`: Less than
|
||||
- `ne`: Not equal to
|
||||
- `icontains`: Case-insensitive containment check
|
||||
- `*`: Wildcard character that matches everything
|
||||
|
||||
<CodeGroup>
|
||||
```python Code
|
||||
memories = m.get_all(
|
||||
filters={
|
||||
"AND": [
|
||||
{
|
||||
"user_id": "alex"
|
||||
},
|
||||
{
|
||||
"created_at": {"gte": "2024-07-01", "lte": "2024-07-31"}
|
||||
}
|
||||
]
|
||||
},
|
||||
version="v2"
|
||||
)
|
||||
```
|
||||
|
||||
```json Output
|
||||
[
|
||||
{
|
||||
"id":"f38b689d-6b24-45b7-bced-17fbb4d8bac7",
|
||||
"memory":"Name: Alex. Vegetarian. Allergic to nuts.",
|
||||
"user_id":"alex",
|
||||
"hash":"62bc074f56d1f909f1b4c2b639f56f6a",
|
||||
"metadata":null,
|
||||
"created_at":"2024-07-25T23:57:00.108347-07:00",
|
||||
"updated_at":"2024-07-25T23:57:00.108367-07:00"
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
<CodeGroup>
|
||||
```python Wildcard Example
|
||||
# Using wildcard to get all memories for a specific user across all run_ids
|
||||
memories = m.get_all(
|
||||
filters={
|
||||
"AND": [
|
||||
{
|
||||
"user_id": "alex"
|
||||
},
|
||||
{
|
||||
"run_id": "*"
|
||||
}
|
||||
]
|
||||
},
|
||||
version="v2"
|
||||
)
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -1,72 +0,0 @@
|
||||
---
|
||||
title: 'Search Memories (v2)'
|
||||
openapi: post /v2/memories/search/
|
||||
---
|
||||
|
||||
The v2 search API is powerful and flexible, allowing for more precise memory retrieval. It supports complex logical operations (AND, OR, NOT) and comparison operators for advanced filtering capabilities. The comparison operators include:
|
||||
- `in`: Matches any of the values specified
|
||||
- `gte`: Greater than or equal to
|
||||
- `lte`: Less than or equal to
|
||||
- `gt`: Greater than
|
||||
- `lt`: Less than
|
||||
- `ne`: Not equal to
|
||||
- `icontains`: Case-insensitive containment check
|
||||
- `*`: Wildcard character that matches everything
|
||||
|
||||
<CodeGroup>
|
||||
```python Code
|
||||
related_memories = m.search(
|
||||
query="What are Alice's hobbies?",
|
||||
version="v2",
|
||||
filters={
|
||||
"OR": [
|
||||
{
|
||||
"user_id": "alice"
|
||||
},
|
||||
{
|
||||
"agent_id": {"in": ["travel-agent", "sports-agent"]}
|
||||
}
|
||||
]
|
||||
},
|
||||
)
|
||||
```
|
||||
|
||||
```json Output
|
||||
{
|
||||
"memories": [
|
||||
{
|
||||
"id": "ea925981-272f-40dd-b576-be64e4871429",
|
||||
"memory": "Likes to play cricket and plays cricket on weekends.",
|
||||
"metadata": {
|
||||
"category": "hobbies"
|
||||
},
|
||||
"score": 0.32116443111457704,
|
||||
"created_at": "2024-07-26T10:29:36.630547-07:00",
|
||||
"updated_at": null,
|
||||
"user_id": "alice",
|
||||
"agent_id": "sports-agent"
|
||||
}
|
||||
],
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
<CodeGroup>
|
||||
```python Wildcard Example
|
||||
# Using wildcard to match all run_ids for a specific user
|
||||
all_memories = m.search(
|
||||
query="What are Alice's hobbies?",
|
||||
version="v2",
|
||||
filters={
|
||||
"AND": [
|
||||
{
|
||||
"user_id": "alice"
|
||||
},
|
||||
{
|
||||
"run_id": "*"
|
||||
}
|
||||
]
|
||||
},
|
||||
)
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: 'Add Member'
|
||||
description: "Add a new member to an organization with a specified role such as READER or OWNER access level."
|
||||
openapi: post /api/v1/orgs/organizations/{org_id}/members/
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Create Organization'
|
||||
description: "Create a new organization on the Mem0 platform to manage projects, members, and memory resources."
|
||||
openapi: post /api/v1/orgs/organizations/
|
||||
---
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
title: 'Delete Member'
|
||||
openapi: delete /api/v1/orgs/organizations/{org_id}/members/
|
||||
---
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Delete Organization'
|
||||
description: "Permanently delete an organization and its associated resources from the Mem0 platform."
|
||||
openapi: delete /api/v1/orgs/organizations/{org_id}/
|
||||
---
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Get Members'
|
||||
description: "Retrieve a list of all members belonging to a specific organization on the Mem0 platform."
|
||||
openapi: get /api/v1/orgs/organizations/{org_id}/members/
|
||||
---
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Get Organization'
|
||||
description: "Retrieve details of a specific organization by its ID from the Mem0 platform using the GET endpoint."
|
||||
openapi: get /api/v1/orgs/organizations/{org_id}/
|
||||
---
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Get Organizations'
|
||||
description: "Retrieve a list of all organizations associated with your Mem0 account using the GET endpoint."
|
||||
openapi: get /api/v1/orgs/organizations/
|
||||
---
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
title: 'Update Member'
|
||||
openapi: put /api/v1/orgs/organizations/{org_id}/members/
|
||||
---
|
||||
|
||||
The API provides two roles for organization members:
|
||||
|
||||
- `READER`: Allows viewing of organization resources.
|
||||
- `OWNER`: Grants full administrative access to manage the organization and its resources.
|
||||
@@ -0,0 +1,197 @@
|
||||
---
|
||||
title: Organizations & Projects
|
||||
icon: "building"
|
||||
description: "Manage multi-tenant applications with organization and project APIs"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Organizations and projects provide multi-tenant support, access control, and team collaboration capabilities for Mem0 Platform. Use these APIs to build applications that support multiple teams, customers, or isolated environments.
|
||||
|
||||
<Info>
|
||||
Organizations and projects are **optional** features. You can use Mem0 without them for single-user or simple multi-user applications.
|
||||
</Info>
|
||||
|
||||
## Key Capabilities
|
||||
|
||||
- **Multi-org/project Support**: Specify organization and project when initializing the Mem0 client to attribute API usage appropriately
|
||||
- **Member Management**: Control access to data through organization and project membership
|
||||
- **Access Control**: Only members can access memories and data within their organization/project scope
|
||||
- **Team Isolation**: Maintain data separation between different teams and projects for secure collaboration
|
||||
|
||||
---
|
||||
|
||||
## Using Organizations & Projects
|
||||
|
||||
### Initialize with Org/Project Context
|
||||
|
||||
Example with the mem0 Python package:
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Python">
|
||||
|
||||
```python
|
||||
from mem0 import MemoryClient
|
||||
client = MemoryClient(org_id='YOUR_ORG_ID', project_id='YOUR_PROJECT_ID')
|
||||
```
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab title="Node.js">
|
||||
|
||||
```javascript
|
||||
import { MemoryClient } from "mem0ai";
|
||||
const client = new MemoryClient({
|
||||
organizationId: "YOUR_ORG_ID",
|
||||
projectId: "YOUR_PROJECT_ID"
|
||||
});
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
---
|
||||
|
||||
## Project Management
|
||||
|
||||
The Mem0 client provides comprehensive project management through the `client.project` interface:
|
||||
|
||||
### Get Project Details
|
||||
|
||||
Retrieve information about the current project:
|
||||
|
||||
```python
|
||||
# Get all project details
|
||||
project_info = client.project.get()
|
||||
|
||||
# Get specific fields only
|
||||
project_info = client.project.get(fields=["name", "description", "custom_categories"])
|
||||
```
|
||||
|
||||
### Create a New Project
|
||||
|
||||
Create a new project within your organization:
|
||||
|
||||
```python
|
||||
# Create a project with name and description
|
||||
new_project = client.project.create(
|
||||
name="My New Project",
|
||||
description="A project for managing customer support memories"
|
||||
)
|
||||
```
|
||||
|
||||
### Update Project Settings
|
||||
|
||||
Modify project configuration including custom instructions, categories, and graph settings:
|
||||
|
||||
```python
|
||||
# Update project with custom categories
|
||||
client.project.update(
|
||||
custom_categories=[
|
||||
{"customer_preferences": "Customer likes, dislikes, and preferences"},
|
||||
{"support_history": "Previous support interactions and resolutions"}
|
||||
]
|
||||
)
|
||||
|
||||
# Update project with custom instructions
|
||||
client.project.update(
|
||||
custom_instructions="..."
|
||||
)
|
||||
|
||||
# Enable graph memory for the project
|
||||
client.project.update(enable_graph=True)
|
||||
|
||||
# Update multiple settings at once
|
||||
client.project.update(
|
||||
custom_instructions="...",
|
||||
custom_categories=[
|
||||
{"personal_info": "User personal information and preferences"},
|
||||
{"work_context": "Professional context and work-related information"}
|
||||
],
|
||||
enable_graph=True
|
||||
)
|
||||
```
|
||||
|
||||
### Delete Project
|
||||
|
||||
<Warning>
|
||||
This action will remove all memories, messages, and other related data in the project. **This operation is irreversible.**
|
||||
</Warning>
|
||||
|
||||
Remove a project and all its associated data:
|
||||
|
||||
```python
|
||||
# Delete the current project (irreversible)
|
||||
result = client.project.delete()
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Member Management
|
||||
|
||||
Manage project members and their access levels:
|
||||
|
||||
```python
|
||||
# Get all project members
|
||||
members = client.project.get_members()
|
||||
|
||||
# Add a new member as a reader
|
||||
client.project.add_member(
|
||||
email="colleague@company.com",
|
||||
role="READER" # or "OWNER"
|
||||
)
|
||||
|
||||
# Update a member's role
|
||||
client.project.update_member(
|
||||
email="colleague@company.com",
|
||||
role="OWNER"
|
||||
)
|
||||
|
||||
# Remove a member from the project
|
||||
client.project.remove_member(email="colleague@company.com")
|
||||
```
|
||||
|
||||
### Member Roles
|
||||
|
||||
| Role | Permissions |
|
||||
|------|-------------|
|
||||
| **READER** | Can view and search memories, but cannot modify project settings or manage members |
|
||||
| **OWNER** | Full access including project modification, member management, and all reader permissions |
|
||||
|
||||
---
|
||||
|
||||
## Async Support
|
||||
|
||||
All project methods are available in async mode:
|
||||
|
||||
```python
|
||||
from mem0 import AsyncMemoryClient
|
||||
|
||||
async def manage_project():
|
||||
client = AsyncMemoryClient(org_id='YOUR_ORG_ID', project_id='YOUR_PROJECT_ID')
|
||||
|
||||
# All methods support async/await
|
||||
project_info = await client.project.get()
|
||||
await client.project.update(enable_graph=True)
|
||||
members = await client.project.get_members()
|
||||
|
||||
# To call the async function properly
|
||||
import asyncio
|
||||
asyncio.run(manage_project())
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## API Reference
|
||||
|
||||
For complete API specifications and additional endpoints, see:
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Organizations APIs" icon="building" href="/api-reference/organization/create-org">
|
||||
Create, get, and manage organizations
|
||||
</Card>
|
||||
|
||||
<Card title="Project APIs" icon="folder" href="/api-reference/project/create-project">
|
||||
Full project CRUD and member management endpoints
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: 'Add Member'
|
||||
description: "Add a new member to a project with a specified role such as READER or OWNER access level."
|
||||
openapi: post /api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Create Project'
|
||||
description: "Create a new project within an organization on the Mem0 platform to isolate memory resources."
|
||||
openapi: post /api/v1/orgs/organizations/{org_id}/projects/
|
||||
---
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
title: 'Delete Member'
|
||||
openapi: delete /api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/
|
||||
---
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Delete Project'
|
||||
description: "Permanently delete a project and its associated data from the Mem0 platform by project ID."
|
||||
openapi: delete /api/v1/orgs/organizations/{org_id}/projects/{project_id}/
|
||||
---
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Get Members'
|
||||
description: "Retrieve a list of all members belonging to a specific project on the Mem0 platform."
|
||||
openapi: get /api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/
|
||||
---
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Get Project'
|
||||
description: "Retrieve details of a specific project by its organization and project ID using the GET endpoint."
|
||||
openapi: get /api/v1/orgs/organizations/{org_id}/projects/{project_id}/
|
||||
---
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: 'Get Projects'
|
||||
description: "Retrieve a list of all projects within an organization on the Mem0 platform using the GET endpoint."
|
||||
openapi: get /api/v1/orgs/organizations/{org_id}/projects/
|
||||
---
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
title: 'Update Member'
|
||||
openapi: put /api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/
|
||||
---
|
||||
|
||||
The API provides two roles for project members:
|
||||
|
||||
- `READER`: Allows viewing of project resources.
|
||||
- `OWNER`: Grants full administrative access to manage the project and its resources.
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
title: 'Update Project'
|
||||
openapi: patch /api/v1/orgs/organizations/{org_id}/projects/{project_id}/
|
||||
---
|
||||
@@ -1,9 +1,6 @@
|
||||
---
|
||||
title: 'Create Webhook'
|
||||
description: "Create a new webhook for a project to receive real-time notifications about memory events."
|
||||
openapi: post /api/v1/webhooks/projects/{project_id}/
|
||||
---
|
||||
|
||||
## Create Webhook
|
||||
|
||||
Create a webhook by providing the project ID and the webhook details.
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
---
|
||||
title: 'Delete Webhook'
|
||||
description: "Delete an existing webhook by its ID to stop receiving notifications for memory events."
|
||||
openapi: delete /api/v1/webhooks/{webhook_id}/
|
||||
---
|
||||
|
||||
## Delete Webhook
|
||||
|
||||
Delete a webhook by providing the webhook ID.
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
---
|
||||
title: 'Get Webhook'
|
||||
description: "Retrieve webhook configuration details for a specific project on the Mem0 platform."
|
||||
openapi: get /api/v1/webhooks/projects/{project_id}/
|
||||
---
|
||||
|
||||
## Get Webhook
|
||||
|
||||
Get a webhook by providing the project ID.
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
---
|
||||
title: 'Update Webhook'
|
||||
description: "Update an existing webhook configuration, such as its URL or event subscriptions, by webhook ID."
|
||||
openapi: put /api/v1/webhooks/{webhook_id}/
|
||||
---
|
||||
|
||||
## Update Webhook
|
||||
|
||||
Update a webhook by providing the webhook ID and the fields to update.
|
||||
|
||||
|
||||
+748
-19
@@ -1,13 +1,403 @@
|
||||
---
|
||||
title: "Product Updates"
|
||||
description: "Latest releases, bug fixes, and improvements for the Mem0 Python and TypeScript SDKs."
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Python">
|
||||
|
||||
<Update label="2026-03-26" description="v1.0.8">
|
||||
|
||||
**New Features & Updates:**
|
||||
- **Vector Stores:** Integrated Turbopuffer as a vector database provider ([#4428](https://github.com/mem0ai/mem0/pull/4428))
|
||||
- **LLMs:** Added MiniMax LLM provider ([#4431](https://github.com/mem0ai/mem0/pull/4431))
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Core:** Fixed merging of multiple filter operators for the same key ([#4559](https://github.com/mem0ai/mem0/pull/4559))
|
||||
- **Core:** Prevented in-place mutation of metadata in `_create_memory` ([#4529](https://github.com/mem0ai/mem0/pull/4529))
|
||||
- **Core:** Preserved custom metadata when updating memory ([#4495](https://github.com/mem0ai/mem0/pull/4495))
|
||||
- **Core:** Handled chatty LLM responses in JSON parsing ([#4525](https://github.com/mem0ai/mem0/pull/4525))
|
||||
- **Core:** Prevented double embedding in `mem0.add` ([#3996](https://github.com/mem0ai/mem0/pull/3996))
|
||||
- **Core:** Raised `ValueError` when deleting nonexistent memory ([#4455](https://github.com/mem0ai/mem0/pull/4455))
|
||||
- **Core:** Cleaned up graph store data on `Memory.delete()` ([#4505](https://github.com/mem0ai/mem0/pull/4505))
|
||||
- **Vector Stores:** Prevented SQL injection in Databricks vector store ([#4558](https://github.com/mem0ai/mem0/pull/4558))
|
||||
- **Vector Stores:** Upgraded MongoDB vector store from deprecated `knnVector` to GA `vectorSearch` ([#3995](https://github.com/mem0ai/mem0/pull/3995))
|
||||
- **Vector Stores:** Prevented embedding corruption in Valkey and Redis when vector is `None` ([#4362](https://github.com/mem0ai/mem0/pull/4362))
|
||||
- **Vector Stores:** Accepted default `/tmp/chroma` path in `ChromaDbConfig` validator ([#4179](https://github.com/mem0ai/mem0/pull/4179))
|
||||
- **Vector Stores:** Wrapped vector and payload in lists for `Langchain.update` ([#4446](https://github.com/mem0ai/mem0/pull/4446))
|
||||
- **Graph:** Soft-delete graph relationships instead of hard `DELETE` ([#4188](https://github.com/mem0ai/mem0/pull/4188))
|
||||
- **Graph:** Sanitized hyphens in Neo4j Cypher relationship names ([#4154](https://github.com/mem0ai/mem0/pull/4154))
|
||||
- **Graph:** Used root LLM config as fallback for graph store instead of hardcoded OpenAI default ([#4466](https://github.com/mem0ai/mem0/pull/4466))
|
||||
- **Qdrant:** Fixed `do not remove local path on init` ([#4475](https://github.com/mem0ai/mem0/pull/4475))
|
||||
- **Qdrant:** Implemented enhanced metadata filtering operators ([#4127](https://github.com/mem0ai/mem0/pull/4127))
|
||||
- **Embeddings:** Fixed OpenAI embedding dimensions ([#4481](https://github.com/mem0ai/mem0/pull/4481))
|
||||
- **LLMs:** Omitted `topP` for Anthropic Converse in Bedrock; used `AWSBedrockConfig` in `LlmFactory` ([#4469](https://github.com/mem0ai/mem0/pull/4469))
|
||||
- **LLMs:** Avoided sending both `temperature` and `top_p` to Anthropic API ([#4471](https://github.com/mem0ai/mem0/pull/4471))
|
||||
- **LLMs:** Handled `None` content and empty candidates in `GeminiLLM` parsing ([#4462](https://github.com/mem0ai/mem0/pull/4462))
|
||||
- **LLMs:** Added missing `_parse_response` to `AzureOpenAIStructuredLLM` ([#4434](https://github.com/mem0ai/mem0/pull/4434))
|
||||
- **History:** Added timestamps for `DELETE` operations in history ([#4492](https://github.com/mem0ai/mem0/pull/4492))
|
||||
|
||||
**Improvements:**
|
||||
- **Vector Stores:** Added vector validation to OpenSearchDB to ensure non-null, non-empty, and correct-dimension vectors ([#4472](https://github.com/mem0ai/mem0/pull/4472))
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-03-19" description="v1.0.7">
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Core:** Fixed control characters in LLM JSON responses causing parse failures ([#4420](https://github.com/mem0ai/mem0/pull/4420))
|
||||
- **Core:** Replaced hardcoded US/Pacific timezone references with `timezone.utc` ([#4404](https://github.com/mem0ai/mem0/pull/4404))
|
||||
- **Core:** Preserved `http_auth` in `_safe_deepcopy_config` for OpenSearch ([#4418](https://github.com/mem0ai/mem0/pull/4418))
|
||||
- **Core:** Normalized malformed LLM fact output before embedding ([#4224](https://github.com/mem0ai/mem0/pull/4224))
|
||||
- **Embeddings:** Pass `encoding_format='float'` in OpenAI embeddings for proxy compatibility ([#4058](https://github.com/mem0ai/mem0/pull/4058))
|
||||
- **LLMs:** Fixed Ollama to pass tools to `client.chat` and parse `tool_calls` from response ([#4176](https://github.com/mem0ai/mem0/pull/4176))
|
||||
- **Reranker:** Support nested LLM config in `LLMReranker` for non-OpenAI providers ([#4405](https://github.com/mem0ai/mem0/pull/4405))
|
||||
- **Vector Stores:** Cast `vector_distance` to float in Redis search ([#4377](https://github.com/mem0ai/mem0/pull/4377))
|
||||
|
||||
**Improvements:**
|
||||
- **Embeddings:** Improved Ollama embedder with model name normalization and error handling ([#4403](https://github.com/mem0ai/mem0/pull/4403))
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-03-16" description="v1.0.6">
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Telemetry:** Fixed telemetry vector store initialization still running when `MEM0_TELEMETRY` is disabled (#4351)
|
||||
- **Core:** Removed destructive `vector_store.reset()` call from `delete_all()` that was wiping the entire vector store instead of deleting only the target memories (#4349)
|
||||
- **OSS:** `OllamaLLM` now respects the configured URL instead of always falling back to localhost (#4320)
|
||||
- **Core:** Fixed `KeyError` when LLM omits the `entities` key in tool call response (#4313)
|
||||
- **Prompts:** Ensured JSON instruction is included in prompts when using `json_object` response format (#4271)
|
||||
- **Core:** Fixed incorrect database parameter handling (#3913)
|
||||
|
||||
**Dependencies:**
|
||||
- Updated LangChain dependencies to v1.0.0 (#4353)
|
||||
- Bumped protobuf dependency to 5.29.6 and extended upper bound to `<7.0.0` (#4326)
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-03-03" description="v1.0.5">
|
||||
- **Telemetry Fix**
|
||||
- Fixed an issue where the PostHog client was initialized even after telemetry was disabled. Although events were not captured, the client was unnecessarily initialized.
|
||||
</Update>
|
||||
|
||||
<Update label="2026-02-17" description="v1.0.4">
|
||||
|
||||
**New Features & Updates:**
|
||||
- **Memory Update:**
|
||||
- Added `timestamp` parameter to `update()` — accepts Unix epoch (int/float) or ISO 8601 string
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-01-29" description="v1.0.3">
|
||||
|
||||
**New Features & Updates:**
|
||||
- **Project Settings:**
|
||||
- Added inclusion prompt, exclusion prompt, memory depth, and usecase setting
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-01-13" description="v1.0.2">
|
||||
|
||||
**New Features & Updates:**
|
||||
- **Vector Stores:**
|
||||
- Added DriverInfo metadata to MongoDB vector store
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-11-14" description="v1.0.1">
|
||||
|
||||
**New Features & Updates:**
|
||||
- **Vector Stores:**
|
||||
- Added Apache Cassandra vector store support
|
||||
- **Embeddings:**
|
||||
- Added FastEmbed embedding support for local embeddings
|
||||
- **Graph Store:**
|
||||
- Added configurable embedding similarity threshold for graph store node matching
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Core:**
|
||||
- Fixed condition check for memories_result type in Memory class
|
||||
- Fixed list_memories endpoint Pydantic validation error
|
||||
- Fixed memory deletion not removing from vector store
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-10-16" description="v1.0.0">
|
||||
|
||||
**New Features & Updates:**
|
||||
- **Vector Stores:**
|
||||
- Added Azure MySQL support
|
||||
- Added Azure AI Search Vector Store support
|
||||
- **LLMs:**
|
||||
- Added Tool Call support for LangchainLLM
|
||||
- Enabled custom model and parameters for Hugging Face with huggingface_base_url
|
||||
- Updated default LLM configuration
|
||||
- **Rerankers:**
|
||||
- Added reranker support: Cohere, ZeroEntropy, Hugging Face, Sentence Transformers, and LLMs
|
||||
- **Core:**
|
||||
- Added metadata filtering for OSS
|
||||
- Added Assistant memory retrieval
|
||||
- Enabled async mode as default
|
||||
|
||||
**Improvements:**
|
||||
- **Prompts:**
|
||||
- Improved prompt for better memory retrieval
|
||||
- **Dependencies:**
|
||||
- Updated dependency compatibility with OpenAI 2.x
|
||||
- **Validation:**
|
||||
- Validated embedding_dims for Kuzu integration
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Vector Stores:**
|
||||
- Fixed Databricks Vector Store integration
|
||||
- Fixed Milvus DB bug and added test coverage
|
||||
- Fixed Weaviate search method
|
||||
- **LLMs:**
|
||||
- Fixed bug with thinking LLM in vLLM
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-09-25" description="v0.1.118">
|
||||
|
||||
**New Features & Updates:**
|
||||
- **Vector Stores:**
|
||||
- Added Valkey vector store support
|
||||
- Added support for ChromaDB Cloud
|
||||
- Added Mem0 vector store backend integration for Neptune Analytics
|
||||
- **Graph Store:**
|
||||
- Added Neptune-DB graph store with vector store
|
||||
- **Core:**
|
||||
- Implemented structured exception classes with error codes and suggested actions
|
||||
|
||||
**Improvements:**
|
||||
- **Dependencies:**
|
||||
- Updated OpenAI dependency and improved Ollama compatibility
|
||||
- **Testing:**
|
||||
- Added Weaviate DB test
|
||||
- Added comprehensive test suite for SQLiteManager
|
||||
- **Documentation:**
|
||||
- Updated category docs
|
||||
- Updated Search V2 / Get All V2 filters documentation
|
||||
- Refactored AWS example title
|
||||
- Fixed Quickstart cURL example
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Vector Stores:**
|
||||
- Databricks bug fixes
|
||||
- Fixed S3 Vectors memory initialization issue from configuration
|
||||
- **Core:**
|
||||
- Fixed JSON parsing with new memories
|
||||
- Replaced hardcoded LLM provider with provider from configuration
|
||||
- **LLMs:**
|
||||
- Fixed Bedrock Anthropic models to use system field
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-09-03" description="v0.1.117">
|
||||
|
||||
**New Features & Updates:**
|
||||
- **OpenMemory:**
|
||||
- Added memory export / import feature
|
||||
- Added vector store integrations: Weaviate, FAISS, PGVector, Chroma, Redis, Elasticsearch, Milvus
|
||||
- Added `export_openmemory.sh` migration script
|
||||
- **Vector Stores:**
|
||||
- Added Amazon S3 Vectors support
|
||||
- Added Databricks Mosaic AI vector store support
|
||||
- Added support for OpenAI Store
|
||||
- **Graph Memory:** Added support for graph memory using Kuzu
|
||||
- **Azure:** Added Azure Identity for Azure OpenAI and Azure AI Search authentication
|
||||
- **Elasticsearch:** Added headers configuration support
|
||||
|
||||
**Improvements:**
|
||||
- Added custom connection client to enable connecting to local containers for Weaviate
|
||||
- Updated configuration AWS Bedrock
|
||||
- Fixed dependency issues and tests; updated docstrings
|
||||
- **Documentation:**
|
||||
- Fixed Graph Docs page missing in sidebar
|
||||
- Updated integration documentation
|
||||
- Added version param in Search V2 API documentation
|
||||
- Updated Databricks documentation and refactored docs
|
||||
- Updated favicon logo
|
||||
- Fixed typos and Typescript docs
|
||||
|
||||
**Bug Fixes:**
|
||||
- Baidu: Added missing provider for Baidu vector DB
|
||||
- MongoDB: Replaced `query_vector` args in search method
|
||||
- Fixed new memory mistaken for current
|
||||
- AsyncMemory._add_to_vector_store: handled edge case when no facts found
|
||||
- Fixed missing commas in Kuzu graph INSERT queries
|
||||
- Fixed inconsistent created and updated properties for Graph
|
||||
- Fixed missing `app_id` on client for Neptune Analytics
|
||||
- Correctly pick AWS region from environment variable
|
||||
- Fixed Ollama model existence check
|
||||
|
||||
**Refactoring:**
|
||||
- **PGVector:** Use internal connection pools and context managers
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-08-14" description="v0.1.116">
|
||||
|
||||
**New Features & Updates:**
|
||||
- **Pinecone:** Added namespace support and improved type safety
|
||||
- **Milvus:** Added db_name field to MilvusDBConfig
|
||||
- **Vector Stores:** Added multi-id filters support
|
||||
- **Vercel AI SDK:** Migration to AI SDK V5.0
|
||||
- **Python Support:** Added Python 3.12 support
|
||||
- **Graph Memory:** Added sanitizer methods for nodes and relationships
|
||||
- **LLM Monitoring:** Added monitoring callback support
|
||||
|
||||
**Improvements:**
|
||||
- **Performance:**
|
||||
- Improved async handling in AsyncMemory class
|
||||
- **Documentation:**
|
||||
- Added async add announcement
|
||||
- Added personalized search docs
|
||||
- Added Neptune examples
|
||||
- Added V5 migration docs
|
||||
- **Configuration:**
|
||||
- Refactored base class config for LLMs
|
||||
- Added sslmode for pgvector
|
||||
- **Dependencies:**
|
||||
- Updated psycopg to version 3
|
||||
- Updated Docker compose
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Tests:**
|
||||
- Fixed failing tests
|
||||
- Restricted package versions
|
||||
- **Memgraph:**
|
||||
- Fixed async attribute errors
|
||||
- Fixed n_embeddings usage
|
||||
- Fixed indexing issues
|
||||
- **Vector Stores:**
|
||||
- Fixed Qdrant cloud indexing
|
||||
- Fixed Neo4j Cypher syntax
|
||||
- Fixed LLM parameters
|
||||
- **Graph Store:**
|
||||
- Fixed LM config prioritization
|
||||
- **Dependencies:**
|
||||
- Fixed JSON import for psycopg
|
||||
|
||||
**Refactoring:**
|
||||
- **Google AI:** Refactored from Gemini to Google AI
|
||||
- **Base Classes:** Refactored LLM base class configuration
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-24" description="v0.1.115">
|
||||
|
||||
**New Features & Updates:**
|
||||
- Enhanced project management via `client.project` and `AsyncMemoryClient.project` interfaces
|
||||
- Full support for project CRUD operations (create, read, update, delete)
|
||||
- Project member management: add, update, remove, and list members
|
||||
- Manage project settings including custom instructions, categories, retrieval criteria, and graph enablement
|
||||
- Both sync and async support for all project management operations
|
||||
|
||||
**Improvements:**
|
||||
- **Documentation:**
|
||||
- Added detailed API reference and usage examples for new project management methods.
|
||||
- Updated all docs to use `client.project.get()` and `client.project.update()` instead of deprecated methods.
|
||||
|
||||
- **Deprecation:**
|
||||
- Marked `get_project()` and `update_project()` as deprecated (these methods were already present); added warnings to guide users to the new API.
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Tests:**
|
||||
- Fixed Gemini embedder and LLM test mocks for correct error handling and argument structure.
|
||||
- **vLLM:**
|
||||
- Fixed duplicate import in vLLM module.
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-05" description="v0.1.114">
|
||||
|
||||
**New Features:**
|
||||
- **OpenAI Agents:** Added OpenAI agents SDK support
|
||||
- **Amazon Neptune:** Added Amazon Neptune Analytics graph_store configuration and integration
|
||||
- **vLLM:** Added vLLM support
|
||||
|
||||
**Improvements:**
|
||||
- **Documentation:**
|
||||
- Added SOC2 and HIPAA compliance documentation
|
||||
- Enhanced group chat feature documentation for platform
|
||||
- Added Google AI ADK Integration documentation
|
||||
- Fixed documentation images and links
|
||||
- **Setup:** Fixed Mem0 setup, logging, and documentation issues
|
||||
|
||||
**Bug Fixes:**
|
||||
- **MongoDB:** Fixed MongoDB Vector Store misaligned strings and classes
|
||||
- **vLLM:** Fixed missing OpenAI import in vLLM module and call errors
|
||||
- **Dependencies:** Fixed CI issues related to missing dependencies
|
||||
- **Installation:** Reverted pip install changes
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-30" description="v0.1.113">
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Gemini:** Fixed Gemini embedder configuration
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-27" description="v0.1.112">
|
||||
|
||||
**New Features:**
|
||||
- **Memory:** Added immutable parameter to add method
|
||||
- **OpenMemory:** Added async_mode parameter support
|
||||
|
||||
**Improvements:**
|
||||
- **Documentation:**
|
||||
- Enhanced platform feature documentation
|
||||
- Fixed documentation links
|
||||
- Added async_mode documentation
|
||||
- **MongoDB:** Fixed MongoDB configuration name
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Bedrock:** Fixed Bedrock LLM, embeddings, tools, and temporary credentials
|
||||
- **Memory:** Fixed memory categorization by updating dependencies and correcting API usage
|
||||
- **Gemini:** Fixed Gemini Embeddings and LLM issues
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-23" description="v0.1.111">
|
||||
|
||||
**New Features:**
|
||||
- **OpenMemory:**
|
||||
- Added OpenMemory augment support
|
||||
- Added OpenMemory Local Support using new library
|
||||
- **vLLM:** Added vLLM support integration
|
||||
|
||||
**Improvements:**
|
||||
- **Documentation:**
|
||||
- Added MCP Client Integration Guide and updated installation commands
|
||||
- Improved Agent Id documentation for Mem0 OSS Graph Memory
|
||||
- **Core:** Added JSON parsing to solve hallucination errors
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Gemini:** Fixed Gemini Embeddings migration
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-20" description="v0.1.110">
|
||||
|
||||
**New Features:**
|
||||
- **Baidu:** Added Baidu vector database integration
|
||||
|
||||
**Improvements:**
|
||||
- **Documentation:**
|
||||
- Updated changelog
|
||||
- Fixed example in quickstart page
|
||||
- Updated client.update() method documentation in OpenAPI specification
|
||||
- **OpenSearch:** Updated logger warning
|
||||
|
||||
**Bug Fixes:**
|
||||
- **CI:** Fixed failing CI pipeline
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-19" description="v0.1.109">
|
||||
|
||||
**New Features:**
|
||||
@@ -42,7 +432,7 @@ mode: "wide"
|
||||
<Update label="2025-06-11" description="v0.1.107">
|
||||
|
||||
**Improvements:**
|
||||
- **Documentation:**
|
||||
- **Documentation:**
|
||||
- Updated Livekit documentation migration
|
||||
- Updated OpenMemory hosted version documentation
|
||||
- **Core:** Updated categorization flow
|
||||
@@ -79,7 +469,7 @@ mode: "wide"
|
||||
- **LLM:** Added support for OpenAI compatible LLM providers with baseUrl configuration
|
||||
|
||||
**Improvements:**
|
||||
- **Documentation:**
|
||||
- **Documentation:**
|
||||
- Fixed broken links
|
||||
- Improved Graph Memory features documentation clarity
|
||||
- Updated enable_graph documentation
|
||||
@@ -96,14 +486,14 @@ mode: "wide"
|
||||
- **OpenMemory:** Added LLM and Embedding Providers support
|
||||
|
||||
**Improvements:**
|
||||
- **Documentation:**
|
||||
- **Documentation:**
|
||||
- Updated memory export documentation
|
||||
- Enhanced role-based memory attribution rules documentation
|
||||
- Updated API reference and messages documentation
|
||||
- Added Mastra and Raycast documentation
|
||||
- Added NOT filter documentation for Search and GetAll V2
|
||||
- Announced Claude 4 support
|
||||
- **Core:**
|
||||
- **Core:**
|
||||
- Removed support for passing string as input in client.add()
|
||||
- Added support for sarvam-m model
|
||||
- **TypeScript SDK:** Fixed types from message interface
|
||||
@@ -120,7 +510,7 @@ mode: "wide"
|
||||
- **Neo4j:** Added base label configuration support
|
||||
|
||||
**Improvements:**
|
||||
- **Documentation:**
|
||||
- **Documentation:**
|
||||
- Updated Healthcare example index
|
||||
- Enhanced collaborative task agent documentation clarity
|
||||
- Added criteria-based filtering documentation
|
||||
@@ -216,7 +606,7 @@ mode: "wide"
|
||||
- **Vector Stores:** Added reset function for VectorDBs
|
||||
|
||||
**Improvements:**
|
||||
- **Documentation:**
|
||||
- **Documentation:**
|
||||
- Updated timestamp and expiration_date documentation
|
||||
- Fixed v2 search documentation
|
||||
- Added "memory" in EC "Custom config" section
|
||||
@@ -255,12 +645,12 @@ mode: "wide"
|
||||
|
||||
**New Features:**
|
||||
- **LLM Integrations:** Added Azure OpenAI Embedding Model
|
||||
- **Examples:**
|
||||
- **Examples:**
|
||||
- Added movie recommendation using grok3
|
||||
- Added Voice Assistant using Elevenlabs
|
||||
|
||||
**Improvements:**
|
||||
- **Documentation:**
|
||||
- **Documentation:**
|
||||
- Added keywords AI
|
||||
- Reformatted navbar page URLs
|
||||
- Updated changelog
|
||||
@@ -275,7 +665,7 @@ mode: "wide"
|
||||
- **LLM Integrations:** Added Mistral AI as LLM provider
|
||||
|
||||
**Improvements:**
|
||||
- **Documentation:**
|
||||
- **Documentation:**
|
||||
- Updated changelog
|
||||
- Fixed memory exclusion example
|
||||
- Updated xAI documentation
|
||||
@@ -292,7 +682,7 @@ mode: "wide"
|
||||
|
||||
**New Features:**
|
||||
- **Langchain Integration:** Added support for Langchain VectorStores
|
||||
- **Examples:**
|
||||
- **Examples:**
|
||||
- Added personal assistant example
|
||||
- Added personal study buddy example
|
||||
- Added YouTube assistant Chrome extension example
|
||||
@@ -409,18 +799,149 @@ mode: "wide"
|
||||
|
||||
<Tab title="TypeScript">
|
||||
|
||||
<Update label="2026-03-26" description="v2.4.3">
|
||||
|
||||
**New Features & Updates:**
|
||||
- **OSS:** Added pgvector support to NodeJS OSS `VectorStoreFactory` ([#3997](https://github.com/mem0ai/mem0/pull/3997))
|
||||
|
||||
**Bug Fixes:**
|
||||
- **OSS:** Made pgvector `pg` import compatible with ESM ([#4544](https://github.com/mem0ai/mem0/pull/4544))
|
||||
- **OSS:** Registered pgvector in `VectorStoreFactory` ([#4502](https://github.com/mem0ai/mem0/pull/4502))
|
||||
- **OSS:** Used root LLM config as fallback for graph store instead of hardcoded OpenAI default ([#4466](https://github.com/mem0ai/mem0/pull/4466))
|
||||
- **OSS:** Fixed `toCamelCase` in Redis `get` method for the payload ([#3172](https://github.com/mem0ai/mem0/pull/3172))
|
||||
- **Client:** Fixed Zod Schema incompatibility with OpenAI Structured Outputs API ([#3462](https://github.com/mem0ai/mem0/pull/3462))
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-03-19" description="v2.4.2">
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Client:** Fixed webhook `createWebhook` and `updateWebhook` API serialization
|
||||
- **Client:** Added missing `MEMORY_CATEGORIZED` event type to `WebhookEvent` enum
|
||||
- **Types:** Added `WebhookCreatePayload` and `WebhookUpdatePayload` for better type safety
|
||||
|
||||
**Tests:**
|
||||
- Added end-to-end unit test coverage for the platform client — CRUD, batch, search, webhooks, users, project, and initialization (#4357)
|
||||
- Added real API integration tests for memory CRUD, batch operations, search, user management, project configuration, and webhook lifecycle (#4395)
|
||||
- Deleted obsolete e2e test files replaced by the new structured test suite (#4419)
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-03-16" description="v2.4.1">
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Core:** Fixed code block content extraction — content inside code blocks is now properly extracted instead of being deleted (#4317)
|
||||
|
||||
**Improvements:**
|
||||
- **Code Quality:** Fixed linting issues across the SDK (#4334)
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-03-14" description="v2.4.0">
|
||||
|
||||
**Bug Fixes:**
|
||||
- **OSS Storage:** Fixed `SQLITE_CANTOPEN` errors when running as a LaunchAgent, systemd service, or in containers where `process.cwd()` is read-only (e.g. `/`). Default `vector_store.db` location changed from `process.cwd()/vector_store.db` to `~/.mem0/vector_store.db`.
|
||||
- **OSS Storage:** Fixed `historyDbPath` config being silently ignored — config merging always overwrote it with defaults. Top-level `historyDbPath` is now correctly propagated into `historyStore.config` with proper precedence.
|
||||
- **OSS Storage:** Added `ensureSQLiteDirectory()` — parent directories for SQLite database files are now auto-created before opening, preventing `SQLITE_CANTOPEN` when using nested paths.
|
||||
|
||||
**Improvements:**
|
||||
- **Migration:** Added deprecation warning when an existing `vector_store.db` is found at the old `process.cwd()` location, guiding users to move it or set `vectorStore.config.dbPath` explicitly.
|
||||
- **Config:** Limited default SQLite config spreading to only SQLite history providers, preventing config leaking into Supabase or other providers.
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-03-09" description="v2.3.0">
|
||||
|
||||
**Breaking Changes:**
|
||||
- **Dependencies:** Minimum Node.js version for OSS sqlite features is now Node 20+ (due to `better-sqlite3` v12)
|
||||
|
||||
**Bug Fixes:**
|
||||
- **OSS Storage:** Replaced `sqlite3` with `better-sqlite3` to fix native binding resolution failures under jiti-based loaders (e.g. OpenClaw plugin system). Fixes issues where the `bindings` module walked V8 stack frames with synthetic filenames, failing to locate the native `.node` addon.
|
||||
- **OSS Storage:** Fixed async init race condition in `SQLiteManager` — `init()` is now synchronous
|
||||
- **OSS Vector Store:** Migrated `MemoryVectorStore` from `sqlite3` to `better-sqlite3` with transactional batch inserts
|
||||
|
||||
**Improvements:**
|
||||
- **Performance:** Cached prepared statements in `SQLiteManager` for faster history operations
|
||||
- **Performance:** Batch `insert()` in `MemoryVectorStore` wrapped in a transaction for atomicity
|
||||
- **Build:** Updated `tsup.config.ts` externals from `sqlite3` to `better-sqlite3`
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-02-17" description="v2.2.3">
|
||||
|
||||
**New Features & Updates:**
|
||||
- **Memory Update:**
|
||||
- Added `timestamp` parameter to `update()` — accepts Unix epoch or ISO 8601 string
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-01-29" description="v2.2.2">
|
||||
|
||||
**New Features & Updates:**
|
||||
- **Project Settings:**
|
||||
- Added inclusion prompt, exclusion prompt, memory depth, and usecase setting
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-12-30" description="v2.2.1">
|
||||
|
||||
**Improvements:**
|
||||
- **Client:** Added support for keyword arguments in `add` and `search` methods, allowing additional properties beyond defined options for experimental features
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-12-29" description="v2.2.0">
|
||||
|
||||
**New Features:**
|
||||
- **Vector Stores:** Added Azure AI Search vector store support
|
||||
|
||||
**Improvements:**
|
||||
- **Config:** Fixed embedder config schema to support `embeddingDims` and `url` parameters
|
||||
- **Graph Memory:** Replaced hardcoded LLM provider with provider from configuration
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Embedders:** Fixed hardcoded `embeddingDims` values in embedders (OpenAI, Ollama, Google, Azure)
|
||||
- **Build:** Fixed TypeScript build errors
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-09-04" description="v2.1.38">
|
||||
**New Features:**
|
||||
- **Client:** Added `metadata` param to `update` method.
|
||||
</Update>
|
||||
|
||||
<Update label="2025-08-04" description="v2.1.37">
|
||||
**New Features:**
|
||||
- **OSS:** Added `RedisCloud` search module check
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-08" description="v2.1.36">
|
||||
**New Features:**
|
||||
- **Client:** Added `structured_data_schema` param to `add` method.
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-08" description="v2.1.35">
|
||||
**New Features:**
|
||||
- **Client:** Added `createMemoryExport` and `getMemoryExport` methods.
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-03" description="v2.1.34">
|
||||
**New Features:**
|
||||
- **OSS:** Added Gemini support
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-24" description="v2.1.33">
|
||||
**Improvement :**
|
||||
**Improvement:**
|
||||
- **Client:** Added `immutable` param to `add` method.
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-20" description="v2.1.32">
|
||||
**Improvement :**
|
||||
**Improvement:**
|
||||
- **Client:** Made `api_version` V2 as default.
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-17" description="v2.1.31">
|
||||
**Improvement :**
|
||||
**Improvement:**
|
||||
- **Client:** Added param `filter_memories`.
|
||||
</Update>
|
||||
|
||||
@@ -446,7 +967,6 @@ mode: "wide"
|
||||
**Improvements:**
|
||||
- **OSS:** Added baseURL param in LLM Config.
|
||||
</Update>
|
||||
|
||||
<Update label="2025-05-23" description="v2.1.26">
|
||||
**Improvements:**
|
||||
- **Client:** Removed type `string` from `messages` interface
|
||||
@@ -481,7 +1001,7 @@ mode: "wide"
|
||||
|
||||
<Update label="2025-04-28" description="v2.1.20">
|
||||
**Improvements:**
|
||||
- **Client:** Fixed `organizationId` and `projectId` being asssigned to default in `ping` method
|
||||
- **Client:** Fixed `organizationId` and `projectId` being assigned to default in `ping` method
|
||||
</Update>
|
||||
|
||||
<Update label="2025-04-22" description="v2.1.19">
|
||||
@@ -540,7 +1060,7 @@ mode: "wide"
|
||||
|
||||
<Update label="2025-03-29" description="v2.1.13">
|
||||
**Improvements:**
|
||||
- **Introuced `ping` method to check if API key is valid and populate org/project id**
|
||||
- **Introduced `ping` method to check if API key is valid and populate org/project id**
|
||||
</Update>
|
||||
|
||||
<Update label="2025-03-29" description="AI SDK v1.0.0">
|
||||
@@ -573,6 +1093,185 @@ mode: "wide"
|
||||
|
||||
<Tab title="Platform">
|
||||
|
||||
<Update label="2025-07-23" description="">
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Memory:** Fixed ADD functionality
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-19" description="">
|
||||
|
||||
**New Features:**
|
||||
- **UI:** Added Settings UI and latency display
|
||||
- **Performance:** Neo4j query optimization
|
||||
|
||||
**Bug Fixes:**
|
||||
- **OpenMemory:** Fixed OMM raising unnecessary exceptions
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-18" description="">
|
||||
|
||||
**Improvements:**
|
||||
- **UI:** Updated Event UI
|
||||
- **Performance:** Fixed N+1 query issue in semantic_search_v2 by optimizing MemorySerializer field selection
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Memory:** Fixed duplicate memory index sentry error
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-17" description="">
|
||||
|
||||
**New Features:**
|
||||
- **UI:** New Settings Page
|
||||
- **Memory:** Duplicate memories entities support
|
||||
|
||||
**Improvements:**
|
||||
- **Performance:** Optimized semantic search and get_all APIs by eliminating N+1 queries
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-16" description="">
|
||||
|
||||
**New Features:**
|
||||
- **Database:** Implemented read replica routing with enhanced logging and app-specific DB routing
|
||||
|
||||
**Improvements:**
|
||||
- **Performance:** Improved query performance in search v2 and get all v2 endpoints
|
||||
|
||||
**Bug Fixes:**
|
||||
- **API:** Fixed pagination for get all API
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-12" description="">
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Graph:** Fixed social graph bugs and connection issues
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-11" description="">
|
||||
|
||||
**Improvements:**
|
||||
- **Rate Limiting:** New rate limit for V2 Search
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Slack:** Fixed Slack rate limit error with backend improvements
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-10" description="">
|
||||
|
||||
**Improvements:**
|
||||
- **Performance:**
|
||||
- Changed connection pooling time to 5 minutes
|
||||
- Separated graph lambdas for better performance
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-09" description="">
|
||||
|
||||
**Improvements:**
|
||||
- **Graph:** Graph Optimizations V2 and memory improvements
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-08" description="">
|
||||
|
||||
**New Features:**
|
||||
- **Database:** Added read replica support for improved database performance
|
||||
- **UI:** Implemented UI changes for Users Page
|
||||
- **Feedback:** Enabled feedback functionality
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Serializer:** Fixed GET ALL Serializer
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-05" description="">
|
||||
|
||||
**New Features:**
|
||||
- **UI:** User Page Revamp and New Users Page
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-04" description="">
|
||||
|
||||
**New Features:**
|
||||
- **Users:** New Users Page implementation
|
||||
- **Tools:** Added script to backfill memory categories
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Filters:** Fixed Filters Get All functionality
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-03" description="">
|
||||
|
||||
**Improvements:**
|
||||
- **Graph:** Graph Memory optimization
|
||||
- **Memory:** Fixed exact memories and semantically similar memories retrieval
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-02" description="">
|
||||
|
||||
**Improvements:**
|
||||
- **Categorization:** Refactored categorization logic to utilize Gemini 2.5 Flash and improve message handling
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-07-01" description="">
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Memory:** Fixed old_memory issue in Async memory addition lambda
|
||||
- **Events:** Fixed missing events
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-30" description="">
|
||||
|
||||
**Improvements:**
|
||||
- **Graph:** Improvements to graph memory and added user to LTM-STM
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-28" description="">
|
||||
|
||||
**New Features:**
|
||||
- **Graph:** Added support for SQS in graph memory addition
|
||||
- **Testing:** Added Locust load testing script and Grafana Dashboard
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-27" description="">
|
||||
|
||||
**Improvements:**
|
||||
- **Rate Limiting:** Updated rate limiting for ADD API to 1000/min
|
||||
- **Performance:** Improved Neo4j performance
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-26" description="">
|
||||
|
||||
**New Features:**
|
||||
- **Memory:** Edit Memory From Drawer functionality
|
||||
- **API:** Added Topic Suggestions API Endpoint
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-25" description="">
|
||||
|
||||
**New Features:**
|
||||
- **Group Chat:** Group-Chat v2 with Actor-Aware Memories
|
||||
- **Memory:** Editable Metadata in Memories
|
||||
- **UI:** Memory Actions Badges
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-19" description="">
|
||||
|
||||
**New Features:**
|
||||
@@ -682,6 +1381,36 @@ mode: "wide"
|
||||
|
||||
<Tab title="Vercel AI SDK">
|
||||
|
||||
<Update label="2025-12-26" description="v2.0.5">
|
||||
**Bug Fix:**
|
||||
- **Vercel AI SDK:** Removed unnecessary dependencies to make the package lighter.
|
||||
</Update>
|
||||
|
||||
<Update label="2025-09-25" description="v2.0.4">
|
||||
**Bug Fix:**
|
||||
- **Vercel AI SDK:** Fixed version parameter in the AI SDK to use V2 for addition.
|
||||
</Update>
|
||||
|
||||
<Update label="2025-09-25" description="v2.0.3">
|
||||
**New Features:**
|
||||
- **Vercel AI SDK:** Added file support for multimodal capabilities with memory context
|
||||
</Update>
|
||||
|
||||
<Update label="2025-09-03" description="v2.0.2">
|
||||
**Bug Fix:**
|
||||
- **Vercel AI SDK:** Fixed streaming response in the AI SDK.
|
||||
</Update>
|
||||
|
||||
<Update label="2025-08-05" description="v2.0.1">
|
||||
**New Features:**
|
||||
- **Vercel AI SDK:** Added a new param `host` to the config.
|
||||
</Update>
|
||||
|
||||
<Update label="2025-08-05" description="v2.0.0">
|
||||
**New Features:**
|
||||
- **Vercel AI SDK:** Migration to AI SDK V5.
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-15" description="v1.0.6">
|
||||
**New Features:**
|
||||
- **Vercel AI SDK:** Added param `filter_memories`.
|
||||
@@ -699,7 +1428,7 @@ mode: "wide"
|
||||
|
||||
<Update label="2025-05-08" description="v1.0.3">
|
||||
**Improvements:**
|
||||
- **Vercel AI SDK:** Added support for graceful failure in cases services are down.
|
||||
- **Vercel AI SDK:** Added support for graceful failure in cases services are down.
|
||||
</Update>
|
||||
|
||||
<Update label="2025-05-01" description="v1.0.1">
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
---
|
||||
title: Configurations
|
||||
icon: "gear"
|
||||
iconType: "solid"
|
||||
description: "Reference for embedder configuration options in Mem0, including provider selection and model settings."
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
Config in mem0 is a dictionary that specifies the settings for your embedding models. It allows you to customize the behavior and connection details of your chosen embedder.
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: AWS Bedrock
|
||||
description: "Configure AWS Bedrock as an embedding provider in Mem0 with IAM credentials and boto3 authentication."
|
||||
---
|
||||
|
||||
To use AWS Bedrock embedding models, you need to have the appropriate AWS credentials and permissions. The embeddings implementation relies on the `boto3` library.
|
||||
@@ -41,7 +42,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Azure OpenAI
|
||||
description: "Configure Azure OpenAI as an embedding provider in Mem0 with API key, deployment, and endpoint settings."
|
||||
---
|
||||
|
||||
To use Azure OpenAI embedding models, set the `EMBEDDING_AZURE_OPENAI_API_KEY`, `EMBEDDING_AZURE_DEPLOYMENT`, `EMBEDDING_AZURE_ENDPOINT` and `EMBEDDING_AZURE_API_VERSION` environment variables. You can obtain the Azure OpenAI API key from the Azure.
|
||||
@@ -23,7 +24,7 @@ config = {
|
||||
"embedder": {
|
||||
"provider": "azure_openai",
|
||||
"config": {
|
||||
"model": "text-embedding-3-large"
|
||||
"model": "text-embedding-3-large",
|
||||
"azure_kwargs": {
|
||||
"api_version": "",
|
||||
"azure_deployment": "",
|
||||
@@ -40,7 +41,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
@@ -68,7 +69,7 @@ const memory = new Memory(config);
|
||||
|
||||
const messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
@@ -77,12 +78,60 @@ await memory.add(messages, { userId: "john" });
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
As an alternative to using an API key, the Azure Identity credential chain can be used to authenticate with [Azure OpenAI role-based security](https://learn.microsoft.com/en-us/azure/ai-foundry/openai/how-to/role-based-access-control).
|
||||
|
||||
<Note> If an API key is provided, it will be used for authentication over an Azure Identity </Note>
|
||||
|
||||
Below is a sample configuration for using Mem0 with Azure OpenAI and Azure Identity:
|
||||
|
||||
```python
|
||||
import os
|
||||
from mem0 import Memory
|
||||
# You can set the values directly in the config dictionary or use environment variables
|
||||
|
||||
os.environ["LLM_AZURE_DEPLOYMENT"] = "your-deployment-name"
|
||||
os.environ["LLM_AZURE_ENDPOINT"] = "your-api-base-url"
|
||||
os.environ["LLM_AZURE_API_VERSION"] = "version-to-use"
|
||||
|
||||
config = {
|
||||
"llm": {
|
||||
"provider": "azure_openai_structured",
|
||||
"config": {
|
||||
"model": "your-deployment-name",
|
||||
"temperature": 0.1,
|
||||
"max_tokens": 2000,
|
||||
"azure_kwargs": {
|
||||
"azure_deployment": "<your-deployment-name>",
|
||||
"api_version": "<version-to-use>",
|
||||
"azure_endpoint": "<your-api-base-url>",
|
||||
"default_headers": {
|
||||
"CustomHeader": "your-custom-header",
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Refer to [Azure Identity troubleshooting tips](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/identity/azure-identity/TROUBLESHOOTING.md#troubleshoot-environmentcredential-authentication-issues) for setting up an Azure Identity credential.
|
||||
|
||||
### Config
|
||||
|
||||
Here are the parameters available for configuring Azure OpenAI embedder:
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Python">
|
||||
| Parameter | Description | Default Value |
|
||||
| --- | --- | --- |
|
||||
| `model` | The name of the embedding model to use | `text-embedding-3-small` |
|
||||
| `embedding_dims` | Dimensions of the embedding model | `1536` |
|
||||
| `azure_kwargs` | The Azure OpenAI configs | `config_keys` |
|
||||
</Tab>
|
||||
<Tab title="TypeScript">
|
||||
| Parameter | Description | Default Value |
|
||||
| ----------------- | --------------------------------------------- | -------------------------- |
|
||||
| `model` | The name of the embedding model to use | `text-embedding-3-small` |
|
||||
| `embeddingDims` | Dimensions of the embedding model | `1536` |
|
||||
| `apiKey` | Azure OpenAI API key | `None` |
|
||||
| `modelProperties` | Object containing endpoint and other settings | `{ endpoint: "",...rest }`|
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
---
|
||||
title: Gemini
|
||||
---
|
||||
|
||||
To use Gemini embedding models, set the `GOOGLE_API_KEY` environment variables. You can obtain the Gemini API key from [here](https://aistudio.google.com/app/apikey).
|
||||
|
||||
### Usage
|
||||
|
||||
```python
|
||||
import os
|
||||
from mem0 import Memory
|
||||
|
||||
os.environ["GOOGLE_API_KEY"] = "key"
|
||||
os.environ["OPENAI_API_KEY"] = "your_api_key" # For LLM
|
||||
|
||||
config = {
|
||||
"embedder": {
|
||||
"provider": "gemini",
|
||||
"config": {
|
||||
"model": "models/text-embedding-004",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
m.add(messages, user_id="john")
|
||||
```
|
||||
|
||||
### Config
|
||||
|
||||
Here are the parameters available for configuring Gemini embedder:
|
||||
|
||||
| Parameter | Description | Default Value |
|
||||
| --- | --- | --- |
|
||||
| `model` | The name of the embedding model to use | `models/text-embedding-004` |
|
||||
| `embedding_dims` | Dimensions of the embedding model (output_dimensionality will be considered as embedding_dims, so please set embedding_dims accordingly) | `768` |
|
||||
| `api_key` | The Gemini API key | `None` |
|
||||
@@ -0,0 +1,80 @@
|
||||
---
|
||||
title: Google AI
|
||||
description: "Configure Google AI as an embedding provider in Mem0 using Gemini models and the GOOGLE_API_KEY variable."
|
||||
---
|
||||
|
||||
To use Google AI embedding models, set the `GOOGLE_API_KEY` environment variables. You can obtain the Gemini API key from [here](https://aistudio.google.com/app/apikey).
|
||||
|
||||
### Usage
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
import os
|
||||
from mem0 import Memory
|
||||
|
||||
os.environ["GOOGLE_API_KEY"] = "key"
|
||||
os.environ["OPENAI_API_KEY"] = "your_api_key" # For LLM
|
||||
|
||||
config = {
|
||||
"embedder": {
|
||||
"provider": "gemini",
|
||||
"config": {
|
||||
"model": "models/text-embedding-004",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
m.add(messages, user_id="john")
|
||||
```
|
||||
|
||||
```typescript TypeScript
|
||||
import { Memory } from 'mem0ai/oss';
|
||||
|
||||
const config = {
|
||||
embedder: {
|
||||
provider: "google",
|
||||
config: {
|
||||
apiKey: process.env["GOOGLE_API_KEY"],
|
||||
model: "gemini-embedding-001",
|
||||
embeddingDims: 1536,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const memory = new Memory(config);
|
||||
const messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
await memory.add(messages, { userId: "john" });
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
### Config
|
||||
|
||||
Here are the parameters available for configuring Gemini embedder:
|
||||
<Tabs>
|
||||
<Tab title="Python">
|
||||
| Parameter | Description | Default Value |
|
||||
| ---------------- | ------------------------------------ | ----------------------- |
|
||||
| `model` | The name of the embedding model to use| `models/text-embedding-004` |
|
||||
| `embedding_dims` | Dimensions of the embedding model | `1536` |
|
||||
| `api_key` | The Google API key | `None` |
|
||||
</Tab>
|
||||
<Tab title="TypeScript">
|
||||
| Parameter | Description | Default Value |
|
||||
| ----------------- | --------------------------------------------- | -------------------------- |
|
||||
| `model` | The name of the embedding model to use | `gemini-embedding-001` |
|
||||
| `embeddingDims` | Dimensions of the embedding model | `1536` |
|
||||
| `apiKey` | Google API key | `None` |
|
||||
</Tab>
|
||||
</Tabs>
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Hugging Face
|
||||
description: "Configure Hugging Face as an embedding provider in Mem0 for local embedding generation with open-source models."
|
||||
---
|
||||
|
||||
You can use embedding models from Huggingface to run Mem0 locally.
|
||||
@@ -24,7 +25,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: LangChain
|
||||
description: "Use LangChain as an embedding provider in Mem0 to access a wide range of models through a unified interface."
|
||||
---
|
||||
|
||||
Mem0 supports LangChain as a provider to access a wide range of embedding models. LangChain is a framework for developing applications powered by language models, making it easy to integrate various embedding providers through a consistent interface.
|
||||
@@ -36,7 +37,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
@@ -44,29 +45,33 @@ m.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
```
|
||||
|
||||
```typescript TypeScript
|
||||
import { Memory } from "mem0ai";
|
||||
import { Memory } from 'mem0ai/oss';
|
||||
import { OpenAIEmbeddings } from "@langchain/openai";
|
||||
|
||||
const embeddings = new OpenAIEmbeddings();
|
||||
// Initialize a LangChain embeddings model directly
|
||||
const openaiEmbeddings = new OpenAIEmbeddings({
|
||||
modelName: "text-embedding-3-small",
|
||||
dimensions: 1536,
|
||||
apiKey: process.env.OPENAI_API_KEY,
|
||||
});
|
||||
|
||||
const config = {
|
||||
"embedder": {
|
||||
"provider": "langchain",
|
||||
"config": {
|
||||
"model": embeddings
|
||||
}
|
||||
}
|
||||
}
|
||||
embedder: {
|
||||
provider: 'langchain',
|
||||
config: {
|
||||
model: openaiEmbeddings,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const memory = new Memory(config);
|
||||
|
||||
const messages = [
|
||||
{ role: "user", content: "I'm planning to watch a movie tonight. Any recommendations?" },
|
||||
{ role: "assistant", content: "How about a thriller movies? They can be quite engaging." },
|
||||
{ role: "user", content: "I'm not a big fan of thriller movies but I love sci-fi movies." },
|
||||
{ role: "assistant", content: "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future." }
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
|
||||
memory.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
await memory.add(messages, { userId: "alice", metadata: { category: "movies" } });
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -96,9 +101,10 @@ When using LangChain as an embedder provider, you'll need to:
|
||||
|
||||
### Examples with Different Providers
|
||||
|
||||
<CodeGroup>
|
||||
#### HuggingFace Embeddings
|
||||
|
||||
```python
|
||||
```python Python
|
||||
from langchain_huggingface import HuggingFaceEmbeddings
|
||||
|
||||
# Initialize a HuggingFace embeddings model
|
||||
@@ -117,9 +123,33 @@ config = {
|
||||
}
|
||||
```
|
||||
|
||||
```typescript TypeScript
|
||||
import { Memory } from 'mem0ai/oss';
|
||||
import { HuggingFaceEmbeddings } from "@langchain/community/embeddings/hf";
|
||||
|
||||
// Initialize a HuggingFace embeddings model
|
||||
const hfEmbeddings = new HuggingFaceEmbeddings({
|
||||
modelName: "BAAI/bge-small-en-v1.5",
|
||||
encode: {
|
||||
normalize_embeddings: true,
|
||||
},
|
||||
});
|
||||
|
||||
const config = {
|
||||
embedder: {
|
||||
provider: 'langchain',
|
||||
config: {
|
||||
model: hfEmbeddings,
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
<CodeGroup>
|
||||
#### Ollama Embeddings
|
||||
|
||||
```python
|
||||
```python Python
|
||||
from langchain_ollama import OllamaEmbeddings
|
||||
|
||||
# Initialize an Ollama embeddings model
|
||||
@@ -137,6 +167,27 @@ config = {
|
||||
}
|
||||
```
|
||||
|
||||
```typescript TypeScript
|
||||
import { Memory } from 'mem0ai/oss';
|
||||
import { OllamaEmbeddings } from "@langchain/community/embeddings/ollama";
|
||||
|
||||
// Initialize an Ollama embeddings model
|
||||
const ollamaEmbeddings = new OllamaEmbeddings({
|
||||
model: "nomic-embed-text",
|
||||
baseUrl: "http://localhost:11434", // Ollama server URL
|
||||
});
|
||||
|
||||
const config = {
|
||||
embedder: {
|
||||
provider: 'langchain',
|
||||
config: {
|
||||
model: ollamaEmbeddings,
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
<Note>
|
||||
Make sure to install the necessary LangChain packages and any provider-specific dependencies.
|
||||
</Note>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
---
|
||||
title: "LM Studio"
|
||||
description: "Configure LM Studio as an embedding provider in Mem0 for local embedding generation with models like nomic-embed-text."
|
||||
---
|
||||
You can use embedding models from LM Studio to run Mem0 locally.
|
||||
|
||||
### Usage
|
||||
@@ -20,7 +24,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
@@ -29,10 +33,10 @@ m.add(messages, user_id="john")
|
||||
|
||||
### Config
|
||||
|
||||
Here are the parameters available for configuring Ollama embedder:
|
||||
Here are the parameters available for configuring LM Studio embedder:
|
||||
|
||||
| Parameter | Description | Default Value |
|
||||
| --- | --- | --- |
|
||||
| `model` | The name of the OpenAI model to use | `nomic-embed-text-v1.5-GGUF/nomic-embed-text-v1.5.f16.gguf` |
|
||||
| `model` | The name of the LM Studio model to use | `nomic-embed-text-v1.5-GGUF/nomic-embed-text-v1.5.f16.gguf` |
|
||||
| `embedding_dims` | Dimensions of the embedding model | `1536` |
|
||||
| `lmstudio_base_url` | Base URL for LM Studio connection | `http://localhost:1234/v1` |
|
||||
@@ -1,8 +1,13 @@
|
||||
---
|
||||
title: "Ollama"
|
||||
description: "Configure Ollama as an embedding provider in Mem0 to generate embeddings locally using open-source models."
|
||||
---
|
||||
You can use embedding models from Ollama to run Mem0 locally.
|
||||
|
||||
### Usage
|
||||
|
||||
```python
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
import os
|
||||
from mem0 import Memory
|
||||
|
||||
@@ -20,19 +25,54 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
m.add(messages, user_id="john")
|
||||
```
|
||||
|
||||
```typescript TypeScript
|
||||
import { Memory } from 'mem0ai/oss';
|
||||
|
||||
const config = {
|
||||
embedder: {
|
||||
provider: 'ollama',
|
||||
config: {
|
||||
model: 'nomic-embed-text:latest', // or any other Ollama embedding model
|
||||
url: 'http://localhost:11434', // Ollama server URL
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const memory = new Memory(config);
|
||||
const messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
await memory.add(messages, { userId: "john" });
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
### Config
|
||||
|
||||
Here are the parameters available for configuring Ollama embedder:
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Python">
|
||||
| Parameter | Description | Default Value |
|
||||
| --- | --- | --- |
|
||||
| `model` | The name of the OpenAI model to use | `nomic-embed-text` |
|
||||
| `model` | The name of the Ollama model to use | `nomic-embed-text` |
|
||||
| `embedding_dims` | Dimensions of the embedding model | `512` |
|
||||
| `ollama_base_url` | Base URL for ollama connection | `None` |
|
||||
| `ollama_base_url` | Base URL for ollama connection | `None` |
|
||||
</Tab>
|
||||
<Tab title="TypeScript">
|
||||
| Parameter | Description | Default Value |
|
||||
| --- | --- | --- |
|
||||
| `model` | The name of the Ollama model to use | `nomic-embed-text:latest` |
|
||||
| `url` | Base URL for Ollama server | `http://localhost:11434` |
|
||||
| `embeddingDims` | Dimensions of the embedding model | 768
|
||||
</Tab>
|
||||
</Tabs>
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: OpenAI
|
||||
description: "Configure OpenAI as an embedding provider in Mem0 using models like text-embedding-3-large for vector generation."
|
||||
---
|
||||
|
||||
To use OpenAI embedding models, set the `OPENAI_API_KEY` environment variable. You can obtain the OpenAI API key from the [OpenAI Platform](https://platform.openai.com/account/api-keys).
|
||||
@@ -25,7 +26,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Together
|
||||
description: "Configure Together AI as an embedding provider in Mem0 with support for 768-dimensional embedding models."
|
||||
---
|
||||
|
||||
To use Together embedding models, set the `TOGETHER_API_KEY` environment variable. You can obtain the Together API key from the [Together Platform](https://api.together.xyz/settings/api-keys).
|
||||
@@ -27,7 +28,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
---
|
||||
title: "Vertex AI"
|
||||
description: "Configure Google Cloud Vertex AI as an embedding provider in Mem0 with support for task-specific embedding types."
|
||||
---
|
||||
### Vertex AI
|
||||
|
||||
To use Google Cloud's Vertex AI for text embedding models, set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to point to the path of your service account's credentials JSON file. These credentials can be created in the [Google Cloud Console](https://console.cloud.google.com/).
|
||||
@@ -27,7 +31,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
---
|
||||
title: Overview
|
||||
icon: "info"
|
||||
iconType: "solid"
|
||||
description: "Overview of all supported embedding model providers in Mem0, including OpenAI, Azure, Ollama, and more."
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
Mem0 offers support for various embedding models, allowing users to choose the one that best suits their needs.
|
||||
|
||||
## Supported Embedders
|
||||
@@ -21,7 +18,7 @@ See the list of supported embedders below.
|
||||
<Card title="Azure OpenAI" href="/components/embedders/models/azure_openai"></Card>
|
||||
<Card title="Ollama" href="/components/embedders/models/ollama"></Card>
|
||||
<Card title="Hugging Face" href="/components/embedders/models/huggingface"></Card>
|
||||
<Card title="Gemini" href="/components/embedders/models/gemini"></Card>
|
||||
<Card title="Google AI" href="/components/embedders/models/google_AI"></Card>
|
||||
<Card title="Vertex AI" href="/components/embedders/models/vertexai"></Card>
|
||||
<Card title="Together" href="/components/embedders/models/together"></Card>
|
||||
<Card title="LM Studio" href="/components/embedders/models/lmstudio"></Card>
|
||||
@@ -31,6 +28,6 @@ See the list of supported embedders below.
|
||||
|
||||
## Usage
|
||||
|
||||
To utilize a embedder, you must provide a configuration to customize its usage. If no configuration is supplied, a default configuration will be applied, and `OpenAI` will be used as the embedder.
|
||||
To utilize an embedding model, you must provide a configuration to customize its usage. If no configuration is supplied, a default configuration will be applied, and `OpenAI` will be used as the embedding model.
|
||||
|
||||
For a comprehensive list of available parameters for embedder configuration, please refer to [Config](./config).
|
||||
For a comprehensive list of available parameters for embedding model configuration, please refer to [Config](./config).
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
---
|
||||
title: Configurations
|
||||
icon: "gear"
|
||||
iconType: "solid"
|
||||
description: "Reference for LLM configuration options in Mem0 for Python and TypeScript, including value precedence rules."
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
## How to define configurations?
|
||||
|
||||
<Tabs>
|
||||
@@ -119,6 +116,7 @@ Here's a comprehensive list of all parameters that can be used across different
|
||||
| `seed` | Seed for deterministic sampling | Sarvam |
|
||||
| `stop` | Stop sequences (max 4) | Sarvam |
|
||||
| `lmstudio_base_url` | Base URL for LM Studio API | LM Studio |
|
||||
| `response_callback` | LLM response callback function | OpenAI |
|
||||
</Tab>
|
||||
<Tab title="TypeScript">
|
||||
| Parameter | Description | Provider |
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
title: Anthropic
|
||||
description: "Configure Anthropic Claude models as the LLM provider in Mem0 with API key setup and usage examples."
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
To use anthropic's models, please set the `ANTHROPIC_API_KEY` which you find on their [Account Settings Page](https://console.anthropic.com/account/keys).
|
||||
To use Anthropic's models, please set the `ANTHROPIC_API_KEY` which you find on their [Account Settings Page](https://console.anthropic.com/account/keys).
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -30,7 +30,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
@@ -55,7 +55,7 @@ const config = {
|
||||
const memory = new Memory(config);
|
||||
const messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
title: AWS Bedrock
|
||||
description: "Configure AWS Bedrock as an LLM provider in Mem0 with IAM authentication and Claude model support."
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
### Setup
|
||||
- Before using the AWS Bedrock LLM, make sure you have the appropriate model access from [Bedrock Console](https://us-east-1.console.aws.amazon.com/bedrock/home?region=us-east-1#/modelaccess).
|
||||
- You will also need to authenticate the `boto3` client by using a method in the [AWS documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html#configuring-credentials)
|
||||
@@ -33,7 +32,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
---
|
||||
title: Azure OpenAI
|
||||
description: "Configure Azure OpenAI as an LLM provider in Mem0 with Azure Identity authentication and deployment settings."
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
<Note> Mem0 Now Supports Azure OpenAI Models in TypeScript SDK </Note>
|
||||
|
||||
To use Azure OpenAI models, you have to set the `LLM_AZURE_OPENAI_API_KEY`, `LLM_AZURE_ENDPOINT`, `LLM_AZURE_DEPLOYMENT` and `LLM_AZURE_API_VERSION` environment variables. You can obtain the Azure API key from the [Azure](https://azure.microsoft.com/).
|
||||
|
||||
Optionally, you can use Azure Identity to authenticate with Azure OpenAI, which allows you to use managed identities or service principals for production and Azure CLI login for development instead of an API key. If an Azure Identity is to be used, ***do not*** set the `LLM_AZURE_OPENAI_API_KEY` environment variable or the api_key in the config dictionary.
|
||||
|
||||
> **Note**: The following are currently unsupported with reasoning models `Parallel tool calling`,`temperature`, `top_p`, `presence_penalty`, `frequency_penalty`, `logprobs`, `top_logprobs`, `logit_bias`, `max_tokens`
|
||||
|
||||
|
||||
@@ -48,7 +49,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
@@ -77,7 +78,7 @@ const config = {
|
||||
const memory = new Memory(config);
|
||||
const messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
@@ -118,6 +119,44 @@ config = {
|
||||
}
|
||||
```
|
||||
|
||||
As an alternative to using an API key, the Azure Identity credential chain can be used to authenticate with [Azure OpenAI role-based security](https://learn.microsoft.com/en-us/azure/ai-foundry/openai/how-to/role-based-access-control).
|
||||
|
||||
<Note> If an API key is provided, it will be used for authentication over an Azure Identity </Note>
|
||||
|
||||
Below is a sample configuration for using Mem0 with Azure OpenAI and Azure Identity:
|
||||
|
||||
```python
|
||||
import os
|
||||
from mem0 import Memory
|
||||
# You can set the values directly in the config dictionary or use environment variables
|
||||
|
||||
os.environ["LLM_AZURE_DEPLOYMENT"] = "your-deployment-name"
|
||||
os.environ["LLM_AZURE_ENDPOINT"] = "your-api-base-url"
|
||||
os.environ["LLM_AZURE_API_VERSION"] = "version-to-use"
|
||||
|
||||
config = {
|
||||
"llm": {
|
||||
"provider": "azure_openai_structured",
|
||||
"config": {
|
||||
"model": "your-deployment-name",
|
||||
"temperature": 0.1,
|
||||
"max_tokens": 2000,
|
||||
"azure_kwargs": {
|
||||
"azure_deployment": "<your-deployment-name>",
|
||||
"api_version": "<version-to-use>",
|
||||
"azure_endpoint": "<your-api-base-url>",
|
||||
"default_headers": {
|
||||
"CustomHeader": "your-custom-header",
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Refer to [Azure Identity troubleshooting tips](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/identity/azure-identity/TROUBLESHOOTING.md#troubleshoot-environmentcredential-authentication-issues) for setting up an Azure Identity credential.
|
||||
|
||||
|
||||
## Config
|
||||
|
||||
All available parameters for the `azure_openai` config are present in [Master List of All Params in Config](../config).
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
title: DeepSeek
|
||||
description: "Configure DeepSeek as an LLM provider in Mem0 with API key setup and optional custom endpoint configuration."
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
To use DeepSeek LLM models, you have to set the `DEEPSEEK_API_KEY` environment variable. You can also optionally set `DEEPSEEK_API_BASE` if you need to use a different API endpoint (defaults to "https://api.deepseek.com").
|
||||
|
||||
## Usage
|
||||
@@ -30,7 +29,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
---
|
||||
title: Gemini
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
To use the Gemini model, set the `GEMINI_API_KEY` environment variable. You can obtain the Gemini API key from [Google AI Studio](https://aistudio.google.com/app/apikey).
|
||||
|
||||
> **Note:** As of the latest release, Mem0 uses the new `google.genai` SDK instead of the deprecated `google.generativeai`. All message formatting and model interaction now use the updated `types` module from `google.genai`.
|
||||
|
||||
> **Note:** Some Gemini models are being deprecated and will retire soon. It is recommended to migrate to the latest stable models like `"gemini-2.0-flash-001"` or `"gemini-2.0-flash-lite-001"` to ensure ongoing support and improvements.
|
||||
|
||||
## Usage
|
||||
|
||||
```python
|
||||
import os
|
||||
from mem0 import Memory
|
||||
|
||||
os.environ["OPENAI_API_KEY"] = "your-openai-api-key" # Used for embedding model
|
||||
os.environ["GEMINI_API_KEY"] = "your-gemini-api-key"
|
||||
|
||||
config = {
|
||||
"llm": {
|
||||
"provider": "gemini",
|
||||
"config": {
|
||||
"model": "gemini-2.0-flash-001",
|
||||
"temperature": 0.2,
|
||||
"max_tokens": 2000,
|
||||
"top_p": 1.0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m = Memory.from_config(config)
|
||||
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thrillers, but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thrillers and suggest sci-fi movies instead."}
|
||||
]
|
||||
|
||||
m.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
|
||||
```
|
||||
|
||||
## Config
|
||||
|
||||
All available parameters for the `Gemini` config are present in [Master List of All Params in Config](../config).
|
||||
@@ -1,41 +1,75 @@
|
||||
---
|
||||
title: Google AI
|
||||
description: "Configure Google Gemini as an LLM provider in Mem0 using the google.genai SDK and GOOGLE_API_KEY variable."
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
To use the Gemini model, set the `GOOGLE_API_KEY` environment variable. You can obtain the Google/Gemini API key from [Google AI Studio](https://aistudio.google.com/app/apikey).
|
||||
|
||||
To use Google AI model, you have to set the `GOOGLE_API_KEY` environment variable. You can obtain the Google API key from the [Google Maker Suite](https://makersuite.google.com/app/apikey)
|
||||
> **Note:** As of the latest release, Mem0 uses the new `google.genai` SDK instead of the deprecated `google.generativeai`. All message formatting and model interaction now use the updated `types` module from `google.genai`.
|
||||
|
||||
> **Note:** Some Gemini models are being deprecated and will retire soon. It is recommended to migrate to the latest stable models like `"gemini-2.0-flash-001"` or `"gemini-2.0-flash-lite-001"` to ensure ongoing support and improvements.
|
||||
|
||||
## Usage
|
||||
|
||||
```python
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
import os
|
||||
from mem0 import Memory
|
||||
|
||||
os.environ["OPENAI_API_KEY"] = "your-api-key" # used for embedding model
|
||||
os.environ["GEMINI_API_KEY"] = "your-api-key"
|
||||
os.environ["OPENAI_API_KEY"] = "your-openai-api-key" # Used for embedding model
|
||||
os.environ["GOOGLE_API_KEY"] = "your-gemini-api-key"
|
||||
|
||||
config = {
|
||||
"llm": {
|
||||
"provider": "litellm",
|
||||
"provider": "gemini",
|
||||
"config": {
|
||||
"model": "gemini/gemini-pro",
|
||||
"model": "gemini-2.0-flash-001",
|
||||
"temperature": 0.2,
|
||||
"max_tokens": 2000,
|
||||
"top_p": 1.0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m = Memory.from_config(config)
|
||||
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thrillers, but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thrillers and suggest sci-fi movies instead."}
|
||||
]
|
||||
|
||||
m.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
|
||||
```
|
||||
```typescript TypeScript
|
||||
import { Memory } from "mem0ai/oss";
|
||||
|
||||
const config = {
|
||||
llm: {
|
||||
// You can also use "google" as provider ( for backward compatibility )
|
||||
provider: "gemini",
|
||||
config: {
|
||||
model: "gemini-2.0-flash-001",
|
||||
temperature: 0.1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const memory = new Memory(config);
|
||||
|
||||
const messages = [
|
||||
{ role: "user", content: "I'm planning to watch a movie tonight. Any recommendations?" },
|
||||
{ role: "assistant", content: "How about thriller movies? They can be quite engaging." },
|
||||
{ role: "user", content: "I’m not a big fan of thrillers, but I love sci-fi movies." },
|
||||
{ role: "assistant", content: "Got it! I'll avoid thrillers and suggest sci-fi movies instead." }
|
||||
]
|
||||
|
||||
await memory.add(messages, { userId: "alice", metadata: { category: "movies" } });
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
## Config
|
||||
|
||||
All available parameters for the `litellm` config are present in [Master List of All Params in Config](../config).
|
||||
All available parameters for the `Gemini` config are present in [Master List of All Params in Config](../config).
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
title: Groq
|
||||
description: "Configure Groq as an LLM provider in Mem0 for high-speed inference using LPU-powered language models."
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
[Groq](https://groq.com/) is the creator of the world's first Language Processing Unit (LPU), providing exceptional speed performance for AI workloads running on their LPU Inference Engine.
|
||||
|
||||
In order to use LLMs from Groq, go to their [platform](https://console.groq.com/keys) and get the API key. Set the API key as `GROQ_API_KEY` environment variable to use the model as given below in the example.
|
||||
@@ -32,7 +31,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
@@ -57,7 +56,7 @@ const config = {
|
||||
const memory = new Memory(config);
|
||||
const messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
---
|
||||
title: LangChain
|
||||
description: "Use LangChain as an LLM provider in Mem0 to integrate with various chat models through a unified interface."
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
Mem0 supports LangChain as a provider to access a wide range of LLM models. LangChain is a framework for developing applications powered by language models, making it easy to integrate various LLM providers through a consistent interface.
|
||||
|
||||
@@ -21,7 +21,7 @@ os.environ["OPENAI_API_KEY"] = "your-api-key"
|
||||
|
||||
# Initialize a LangChain model directly
|
||||
openai_model = ChatOpenAI(
|
||||
model="gpt-4o",
|
||||
model="gpt-4.1-nano-2025-04-14",
|
||||
temperature=0.2,
|
||||
max_tokens=2000
|
||||
)
|
||||
@@ -39,7 +39,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
@@ -47,34 +47,34 @@ m.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
```
|
||||
|
||||
```typescript TypeScript
|
||||
import { Memory } from "mem0ai";
|
||||
import { Memory } from 'mem0ai/oss';
|
||||
import { ChatOpenAI } from "@langchain/openai";
|
||||
|
||||
const openai_model = new ChatOpenAI({
|
||||
model: "gpt-4o",
|
||||
// Initialize a LangChain model directly
|
||||
const openaiModel = new ChatOpenAI({
|
||||
modelName: "gpt-4",
|
||||
temperature: 0.2,
|
||||
max_tokens: 2000
|
||||
})
|
||||
maxTokens: 2000,
|
||||
apiKey: process.env.OPENAI_API_KEY,
|
||||
});
|
||||
|
||||
const config = {
|
||||
"llm": {
|
||||
"provider": "langchain",
|
||||
"config": {
|
||||
"model": openai_model
|
||||
}
|
||||
}
|
||||
}
|
||||
llm: {
|
||||
provider: 'langchain',
|
||||
config: {
|
||||
model: openaiModel,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const memory = new Memory(config);
|
||||
|
||||
const messages = [
|
||||
{ role: "user", content: "I'm planning to watch a movie tonight. Any recommendations?" },
|
||||
{ role: "assistant", content: "How about a thriller movies? They can be quite engaging." },
|
||||
{ role: "user", content: "I'm not a big fan of thriller movies but I love sci-fi movies." },
|
||||
{ role: "assistant", content: "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future." }
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
|
||||
memory.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
await memory.add(messages, { userId: "alice", metadata: { category: "movies" } });
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
---
|
||||
title: "LiteLLM"
|
||||
description: "Use LiteLLM as an LLM provider in Mem0 to access over 100 language models through a unified interface."
|
||||
---
|
||||
[Litellm](https://litellm.vercel.app/docs/) is compatible with over 100 large language models (LLMs), all using a standardized input/output format. You can explore the [available models](https://litellm.vercel.app/docs/providers) to use with Litellm. Ensure you set the `API_KEY` for the model you choose to use.
|
||||
|
||||
## Usage
|
||||
@@ -14,7 +16,7 @@ config = {
|
||||
"llm": {
|
||||
"provider": "litellm",
|
||||
"config": {
|
||||
"model": "gpt-4o-mini",
|
||||
"model": "gpt-4.1-nano-2025-04-14",
|
||||
"temperature": 0.2,
|
||||
"max_tokens": 2000,
|
||||
}
|
||||
@@ -24,7 +26,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
title: LM Studio
|
||||
description: "Configure LM Studio as an LLM provider in Mem0 for running local language models via an OpenAI-compatible API."
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
To use LM Studio with Mem0, you'll need to have LM Studio running locally with its server enabled. LM Studio provides a way to run local LLMs with an OpenAI-compatible API.
|
||||
|
||||
## Usage
|
||||
@@ -31,7 +30,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
@@ -59,7 +58,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
---
|
||||
title: MiniMax
|
||||
description: "Configure MiniMax as an LLM provider in Mem0 with API key setup and optional custom endpoint configuration."
|
||||
---
|
||||
|
||||
To use MiniMax LLM models, you have to set the `MINIMAX_API_KEY` environment variable. You can also optionally set `MINIMAX_API_BASE` if you need to use a different API endpoint (defaults to "https://api.minimax.io/v1").
|
||||
|
||||
## Usage
|
||||
|
||||
```python
|
||||
import os
|
||||
from mem0 import Memory
|
||||
|
||||
os.environ["MINIMAX_API_KEY"] = "your-api-key"
|
||||
os.environ["OPENAI_API_KEY"] = "your-api-key" # for embedder model
|
||||
|
||||
config = {
|
||||
"llm": {
|
||||
"provider": "minimax",
|
||||
"config": {
|
||||
"model": "MiniMax-M2.7", # default model
|
||||
"temperature": 0.2,
|
||||
"max_tokens": 2000,
|
||||
"top_p": 1.0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
m.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
```
|
||||
|
||||
You can also configure the API base URL in the config:
|
||||
|
||||
```python
|
||||
config = {
|
||||
"llm": {
|
||||
"provider": "minimax",
|
||||
"config": {
|
||||
"model": "MiniMax-M2.7",
|
||||
"minimax_base_url": "https://your-custom-endpoint.com",
|
||||
"api_key": "your-api-key" # alternatively to using environment variable
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Config
|
||||
|
||||
All available parameters for the `minimax` config are present in [Master List of All Params in Config](../config).
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
title: Mistral AI
|
||||
description: "Configure Mistral AI as an LLM provider in Mem0 using the litellm integration and Mixtral model family."
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
To use mistral's models, please obtain the Mistral AI api key from their [console](https://console.mistral.ai/). Set the `MISTRAL_API_KEY` environment variable to use the model as given below in the example.
|
||||
|
||||
## Usage
|
||||
@@ -30,7 +29,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
@@ -55,7 +54,7 @@ const config = {
|
||||
const memory = new Memory(config);
|
||||
const messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
<Snippet file="paper-release.mdx" />
|
||||
---
|
||||
title: Ollama
|
||||
description: "Configure Ollama as an LLM provider in Mem0 for running local language models with tool-calling support."
|
||||
---
|
||||
|
||||
You can use LLMs from Ollama to run Mem0 locally. These [models](https://ollama.com/search?c=tools) support tool support.
|
||||
You can use LLMs from Ollama to run Mem0 locally. These [models](https://ollama.com/search?c=tools) support tool calling.
|
||||
|
||||
## Usage
|
||||
|
||||
```python
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
import os
|
||||
from mem0 import Memory
|
||||
|
||||
@@ -24,13 +28,38 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
m.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
```
|
||||
|
||||
```typescript TypeScript
|
||||
import { Memory } from 'mem0ai/oss';
|
||||
|
||||
const config = {
|
||||
llm: {
|
||||
provider: 'ollama',
|
||||
config: {
|
||||
model: 'llama3.1:8b', // or any other Ollama model
|
||||
url: 'http://localhost:11434', // Ollama server URL
|
||||
temperature: 0.1,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const memory = new Memory(config);
|
||||
const messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
await memory.add(messages, { userId: "alice", metadata: { category: "movies" } });
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
## Config
|
||||
|
||||
All available parameters for the `ollama` config are present in [Master List of All Params in Config](../config).
|
||||
@@ -1,11 +1,12 @@
|
||||
---
|
||||
title: OpenAI
|
||||
description: "Configure OpenAI as an LLM provider in Mem0 with support for GPT models and Openrouter compatibility."
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
To use OpenAI LLM models, you have to set the `OPENAI_API_KEY` environment variable. You can obtain the OpenAI API key from the [OpenAI Platform](https://platform.openai.com/account/api-keys).
|
||||
|
||||
> **Note**: The following are currently unsupported with reasoning models `Parallel tool calling`,`temperature`, `top_p`, `presence_penalty`, `frequency_penalty`, `logprobs`, `top_logprobs`, `logit_bias`, `max_tokens`
|
||||
|
||||
## Usage
|
||||
|
||||
<CodeGroup>
|
||||
@@ -19,7 +20,7 @@ config = {
|
||||
"llm": {
|
||||
"provider": "openai",
|
||||
"config": {
|
||||
"model": "gpt-4o",
|
||||
"model": "gpt-4.1-nano-2025-04-14",
|
||||
"temperature": 0.2,
|
||||
"max_tokens": 2000,
|
||||
}
|
||||
@@ -40,7 +41,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
@@ -65,7 +66,7 @@ const config = {
|
||||
const memory = new Memory(config);
|
||||
const messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
@@ -85,7 +86,7 @@ config = {
|
||||
"llm": {
|
||||
"provider": "openai_structured",
|
||||
"config": {
|
||||
"model": "gpt-4o-2024-08-06",
|
||||
"model": "gpt-4.1-nano-2025-04-14",
|
||||
"temperature": 0.0,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
title: Sarvam AI
|
||||
description: "Configure Sarvam AI as an LLM provider in Mem0, specializing in Indian language support with the Sarvam-M model."
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
**Sarvam AI** is an Indian AI company developing language models with a focus on Indian languages and cultural context. Their latest model **Sarvam-M** is designed to understand and generate content in multiple Indian languages while maintaining high performance in English.
|
||||
|
||||
To use Sarvam AI's models, please set the `SARVAM_API_KEY` which you can get from their [platform](https://dashboard.sarvam.ai/).
|
||||
@@ -30,7 +29,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<Snippet file="paper-release.mdx" />
|
||||
---
|
||||
title: Together
|
||||
description: "Configure Together AI as an LLM provider in Mem0 with API key setup and Mixtral model configuration."
|
||||
---
|
||||
|
||||
To use TogetherAI LLM models, you have to set the `TOGETHER_API_KEY` environment variable. You can obtain the TogetherAI API key from their [Account settings page](https://api.together.xyz/settings/api-keys).
|
||||
To use Together LLM models, you have to set the `TOGETHER_API_KEY` environment variable. You can obtain the Together API key from their [Account settings page](https://api.together.xyz/settings/api-keys).
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -25,7 +28,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
@@ -34,4 +37,4 @@ m.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
|
||||
## Config
|
||||
|
||||
All available parameters for the `togetherai` config are present in [Master List of All Params in Config](../config).
|
||||
All available parameters for the `together` config are present in [Master List of All Params in Config](../config).
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
title: vLLM
|
||||
description: "Configure vLLM as an LLM provider in Mem0 for high-performance local inference with GPU-optimized serving."
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
[vLLM](https://docs.vllm.ai/) is a high-performance inference engine for large language models that provides significant performance improvements for local inference. It's designed to maximize throughput and memory efficiency for serving LLMs.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
title: xAI
|
||||
description: "Configure xAI Grok models as an LLM provider in Mem0 with API key setup and usage examples."
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
[xAI](https://x.ai/) is a new AI company founded by Elon Musk that develops large language models, including Grok. Grok is trained on real-time data from X (formerly Twitter) and aims to provide accurate, up-to-date responses with a touch of wit and humor.
|
||||
|
||||
In order to use LLMs from xAI, go to their [platform](https://console.x.ai) and get the API key. Set the API key as `XAI_API_KEY` environment variable to use the model as given below in the example.
|
||||
@@ -31,7 +30,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
---
|
||||
title: Overview
|
||||
icon: "info"
|
||||
iconType: "solid"
|
||||
description: "Overview of all supported LLM providers in Mem0, including OpenAI, Anthropic, Groq, Ollama, and more."
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
Mem0 includes built-in support for various popular large language models. Memory can utilize the LLM provided by the user, ensuring efficient use for specific needs.
|
||||
|
||||
## Usage
|
||||
@@ -30,11 +27,11 @@ See the list of supported LLMs below.
|
||||
<Card title="Together" href="/components/llms/models/together" />
|
||||
<Card title="Groq" href="/components/llms/models/groq" />
|
||||
<Card title="Litellm" href="/components/llms/models/litellm" />
|
||||
<Card title="Mistral AI" href="/components/llms/models/mistral_ai" />
|
||||
<Card title="Google AI" href="/components/llms/models/google_ai" />
|
||||
<Card title="Mistral AI" href="/components/llms/models/mistral_AI" />
|
||||
<Card title="Google AI" href="/components/llms/models/google_AI" />
|
||||
<Card title="AWS bedrock" href="/components/llms/models/aws_bedrock" />
|
||||
<Card title="Gemini" href="/components/llms/models/gemini" />
|
||||
<Card title="DeepSeek" href="/components/llms/models/deepseek" />
|
||||
<Card title="MiniMax" href="/components/llms/models/minimax" />
|
||||
<Card title="xAI" href="/components/llms/models/xAI" />
|
||||
<Card title="Sarvam AI" href="/components/llms/models/sarvam" />
|
||||
<Card title="LM Studio" href="/components/llms/models/lmstudio" />
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
---
|
||||
title: Config
|
||||
description: "Reference for shared and provider-specific reranker configuration options in Mem0, including top_k and API key settings."
|
||||
---
|
||||
|
||||
## Common Configuration Parameters
|
||||
|
||||
All rerankers share these common configuration parameters:
|
||||
|
||||
| Parameter | Description | Type | Default |
|
||||
| ---------- | --------------------------------------------------- | ----- | -------- |
|
||||
| `provider` | Reranker provider name | `str` | Required |
|
||||
| `top_k` | Maximum number of results to return after reranking | `int` | `None` |
|
||||
| `api_key` | API key for the reranker service | `str` | `None` |
|
||||
|
||||
## Provider-Specific Configuration
|
||||
|
||||
### Zero Entropy
|
||||
|
||||
| Parameter | Description | Type | Default |
|
||||
| --------- | -------------------------------------------- | ----- | ------------ |
|
||||
| `model` | Model to use: `zerank-1` or `zerank-1-small` | `str` | `"zerank-1"` |
|
||||
| `api_key` | Zero Entropy API key | `str` | `None` |
|
||||
|
||||
### Cohere
|
||||
|
||||
| Parameter | Description | Type | Default |
|
||||
| -------------------- | -------------------------------------------- | ------ | ----------------------- |
|
||||
| `model` | Cohere rerank model | `str` | `"rerank-english-v3.0"` |
|
||||
| `api_key` | Cohere API key | `str` | `None` |
|
||||
| `return_documents` | Whether to return document texts in response | `bool` | `False` |
|
||||
| `max_chunks_per_doc` | Maximum chunks per document | `int` | `None` |
|
||||
|
||||
### Sentence Transformer
|
||||
|
||||
| Parameter | Description | Type | Default |
|
||||
| ------------------- | -------------------------------------------- | ------ | ---------------------------------------- |
|
||||
| `model` | HuggingFace cross-encoder model name | `str` | `"cross-encoder/ms-marco-MiniLM-L-6-v2"` |
|
||||
| `device` | Device to run model on (`cpu`, `cuda`, etc.) | `str` | `None` |
|
||||
| `batch_size` | Batch size for processing | `int` | `32` |
|
||||
| `show_progress_bar` | Show progress during processing | `bool` | `False` |
|
||||
|
||||
### Hugging Face
|
||||
|
||||
| Parameter | Description | Type | Default |
|
||||
| --------- | -------------------------------------------- | ----- | --------------------------- |
|
||||
| `model` | HuggingFace reranker model name | `str` | `"BAAI/bge-reranker-large"` |
|
||||
| `api_key` | HuggingFace API token | `str` | `None` |
|
||||
| `device` | Device to run model on (`cpu`, `cuda`, etc.) | `str` | `None` |
|
||||
|
||||
### LLM-based
|
||||
|
||||
| Parameter | Description | Type | Default |
|
||||
| ---------------- | ------------------------------------------ | ------- | ---------------------- |
|
||||
| `model` | LLM model to use for scoring | `str` | `"gpt-4o-mini"` |
|
||||
| `provider` | LLM provider (`openai`, `anthropic`, etc.) | `str` | `"openai"` |
|
||||
| `api_key` | API key for LLM provider | `str` | `None` |
|
||||
| `temperature` | Temperature for LLM generation | `float` | `0.0` |
|
||||
| `max_tokens` | Maximum tokens for LLM response | `int` | `100` |
|
||||
| `scoring_prompt` | Custom prompt template for scoring | `str` | Default scoring prompt |
|
||||
|
||||
### LLM Reranker
|
||||
|
||||
| Parameter | Description | Type | Default |
|
||||
| -------------- | --------------------------- | ------ | -------- |
|
||||
| `llm.provider` | LLM provider for reranking | `str` | Required |
|
||||
| `llm.config` | LLM configuration object | `dict` | Required |
|
||||
| `top_n` | Number of results to return | `int` | `None` |
|
||||
|
||||
## Environment Variables
|
||||
|
||||
You can set API keys using environment variables:
|
||||
|
||||
- `ZERO_ENTROPY_API_KEY` - Zero Entropy API key
|
||||
- `COHERE_API_KEY` - Cohere API key
|
||||
- `HUGGINGFACE_API_KEY` - HuggingFace API token
|
||||
- `OPENAI_API_KEY` - OpenAI API key (for LLM-based reranker)
|
||||
- `ANTHROPIC_API_KEY` - Anthropic API key (for LLM-based reranker)
|
||||
|
||||
## Basic Configuration Example
|
||||
|
||||
```python Python
|
||||
config = {
|
||||
"vector_store": {
|
||||
"provider": "chroma",
|
||||
"config": {
|
||||
"collection_name": "my_memories",
|
||||
"path": "./chroma_db"
|
||||
}
|
||||
},
|
||||
"llm": {
|
||||
"provider": "openai",
|
||||
"config": {
|
||||
"model": "gpt-4.1-nano-2025-04-14"
|
||||
}
|
||||
},
|
||||
"reranker": {
|
||||
"provider": "zero_entropy",
|
||||
"config": {
|
||||
"model": "zerank-1",
|
||||
"top_k": 5
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user