Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 50bdaaea0c | |||
| 38e47ac261 | |||
| d06ea1875c | |||
| c2c3a12838 | |||
| 07e58c54ae | |||
| cf3355e2ca | |||
| 54328ffd97 | |||
| 29fa41558c | |||
| 8d45fb3c9a | |||
| 760dca6f39 | |||
| 74f6dc6f0d | |||
| bcca72e3f0 | |||
| 9c2d6222ce |
@@ -51,8 +51,8 @@
|
||||
"langsmith@<0.6.0": "^0.6.0",
|
||||
"tar-fs@>=2.0.0 <2.1.4": "^2.1.4",
|
||||
"picomatch@<2.3.2": "^2.3.2",
|
||||
"postcss@<8.5.10": ">=8.5.10",
|
||||
"esbuild": ">=0.28.1"
|
||||
"esbuild": ">=0.28.1",
|
||||
"postcss@<8.5.18": ">=8.5.18 <9.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+34
-17
@@ -9,8 +9,8 @@ overrides:
|
||||
langsmith@<0.6.0: ^0.6.0
|
||||
tar-fs@>=2.0.0 <2.1.4: ^2.1.4
|
||||
picomatch@<2.3.2: ^2.3.2
|
||||
postcss@<8.5.10: '>=8.5.10'
|
||||
esbuild: '>=0.28.1'
|
||||
postcss@<8.5.18: '>=8.5.18 <9.0.0'
|
||||
|
||||
importers:
|
||||
|
||||
@@ -40,7 +40,7 @@ importers:
|
||||
version: 20.19.37
|
||||
tsup:
|
||||
specifier: ^8.0.0
|
||||
version: 8.5.1(postcss@8.5.15)(tsx@4.21.0)(typescript@5.9.3)
|
||||
version: 8.5.1(postcss@8.5.23)(tsx@4.21.0)(typescript@5.9.3)
|
||||
tsx:
|
||||
specifier: ^4.7.0
|
||||
version: 4.21.0
|
||||
@@ -78,24 +78,28 @@ packages:
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@biomejs/cli-linux-arm64@1.9.4':
|
||||
resolution: {integrity: sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@biomejs/cli-linux-x64-musl@1.9.4':
|
||||
resolution: {integrity: sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@biomejs/cli-linux-x64@1.9.4':
|
||||
resolution: {integrity: sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@biomejs/cli-win32-arm64@1.9.4':
|
||||
resolution: {integrity: sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==}
|
||||
@@ -316,66 +320,79 @@ packages:
|
||||
resolution: {integrity: sha512-RzeBwv0B3qtVBWtcuABtSuCzToo2IEAIQrcyB/b2zMvBWVbjo8bZDjACUpnaafaxhTw2W+imQbP2BD1usasK4g==}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-arm-musleabihf@4.60.0':
|
||||
resolution: {integrity: sha512-Sf7zusNI2CIU1HLzuu9Tc5YGAHEZs5Lu7N1ssJG4Tkw6e0MEsN7NdjUDDfGNHy2IU+ENyWT+L2obgWiguWibWQ==}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-linux-arm64-gnu@4.60.0':
|
||||
resolution: {integrity: sha512-DX2x7CMcrJzsE91q7/O02IJQ5/aLkVtYFryqCjduJhUfGKG6yJV8hxaw8pZa93lLEpPTP/ohdN4wFz7yp/ry9A==}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-arm64-musl@4.60.0':
|
||||
resolution: {integrity: sha512-09EL+yFVbJZlhcQfShpswwRZ0Rg+z/CsSELFCnPt3iK+iqwGsI4zht3secj5vLEs957QvFFXnzAT0FFPIxSrkQ==}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-linux-loong64-gnu@4.60.0':
|
||||
resolution: {integrity: sha512-i9IcCMPr3EXm8EQg5jnja0Zyc1iFxJjZWlb4wr7U2Wx/GrddOuEafxRdMPRYVaXjgbhvqalp6np07hN1w9kAKw==}
|
||||
cpu: [loong64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-loong64-musl@4.60.0':
|
||||
resolution: {integrity: sha512-DGzdJK9kyJ+B78MCkWeGnpXJ91tK/iKA6HwHxF4TAlPIY7GXEvMe8hBFRgdrR9Ly4qebR/7gfUs9y2IoaVEyog==}
|
||||
cpu: [loong64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-linux-ppc64-gnu@4.60.0':
|
||||
resolution: {integrity: sha512-RwpnLsqC8qbS8z1H1AxBA1H6qknR4YpPR9w2XX0vo2Sz10miu57PkNcnHVaZkbqyw/kUWfKMI73jhmfi9BRMUQ==}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-ppc64-musl@4.60.0':
|
||||
resolution: {integrity: sha512-Z8pPf54Ly3aqtdWC3G4rFigZgNvd+qJlOE52fmko3KST9SoGfAdSRCwyoyG05q1HrrAblLbk1/PSIV+80/pxLg==}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-linux-riscv64-gnu@4.60.0':
|
||||
resolution: {integrity: sha512-3a3qQustp3COCGvnP4SvrMHnPQ9d1vzCakQVRTliaz8cIp/wULGjiGpbcqrkv0WrHTEp8bQD/B3HBjzujVWLOA==}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-riscv64-musl@4.60.0':
|
||||
resolution: {integrity: sha512-pjZDsVH/1VsghMJ2/kAaxt6dL0psT6ZexQVrijczOf+PeP2BUqTHYejk3l6TlPRydggINOeNRhvpLa0AYpCWSQ==}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-linux-s390x-gnu@4.60.0':
|
||||
resolution: {integrity: sha512-3ObQs0BhvPgiUVZrN7gqCSvmFuMWvWvsjG5ayJ3Lraqv+2KhOsp+pUbigqbeWqueGIsnn+09HBw27rJ+gYK4VQ==}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-x64-gnu@4.60.0':
|
||||
resolution: {integrity: sha512-EtylprDtQPdS5rXvAayrNDYoJhIz1/vzN2fEubo3yLE7tfAw+948dO0g4M0vkTVFhKojnF+n6C8bDNe+gDRdTg==}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-x64-musl@4.60.0':
|
||||
resolution: {integrity: sha512-k09oiRCi/bHU9UVFqD17r3eJR9bn03TyKraCrlz5ULFJGdJGi7VOmm9jl44vOJvRJ6P7WuBi/s2A97LxxHGIdw==}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-openbsd-x64@4.60.0':
|
||||
resolution: {integrity: sha512-1o/0/pIhozoSaDJoDcec+IVLbnRtQmHwPV730+AOD29lHEEo4F5BEUB24H0OBdhbBBDwIOSuf7vgg0Ywxdfiiw==}
|
||||
@@ -653,8 +670,8 @@ packages:
|
||||
mz@2.7.0:
|
||||
resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==}
|
||||
|
||||
nanoid@3.3.12:
|
||||
resolution: {integrity: sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==}
|
||||
nanoid@3.3.16:
|
||||
resolution: {integrity: sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==}
|
||||
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
|
||||
hasBin: true
|
||||
|
||||
@@ -695,7 +712,7 @@ packages:
|
||||
engines: {node: '>= 18'}
|
||||
peerDependencies:
|
||||
jiti: '>=1.21.0'
|
||||
postcss: '>=8.5.10'
|
||||
postcss: '>=8.5.18 <9.0.0'
|
||||
tsx: ^4.8.1
|
||||
yaml: ^2.4.2
|
||||
peerDependenciesMeta:
|
||||
@@ -708,8 +725,8 @@ packages:
|
||||
yaml:
|
||||
optional: true
|
||||
|
||||
postcss@8.5.15:
|
||||
resolution: {integrity: sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==}
|
||||
postcss@8.5.23:
|
||||
resolution: {integrity: sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg==}
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
|
||||
readdirp@4.1.2:
|
||||
@@ -821,7 +838,7 @@ packages:
|
||||
peerDependencies:
|
||||
'@microsoft/api-extractor': ^7.36.0
|
||||
'@swc/core': ^1
|
||||
postcss: '>=8.5.10'
|
||||
postcss: '>=8.5.18 <9.0.0'
|
||||
typescript: '>=4.5.0'
|
||||
peerDependenciesMeta:
|
||||
'@microsoft/api-extractor':
|
||||
@@ -1388,7 +1405,7 @@ snapshots:
|
||||
object-assign: 4.1.1
|
||||
thenify-all: 1.6.0
|
||||
|
||||
nanoid@3.3.12: {}
|
||||
nanoid@3.3.16: {}
|
||||
|
||||
object-assign@4.1.1: {}
|
||||
|
||||
@@ -1424,16 +1441,16 @@ snapshots:
|
||||
mlly: 1.8.2
|
||||
pathe: 2.0.3
|
||||
|
||||
postcss-load-config@6.0.1(postcss@8.5.15)(tsx@4.21.0):
|
||||
postcss-load-config@6.0.1(postcss@8.5.23)(tsx@4.21.0):
|
||||
dependencies:
|
||||
lilconfig: 3.1.3
|
||||
optionalDependencies:
|
||||
postcss: 8.5.15
|
||||
postcss: 8.5.23
|
||||
tsx: 4.21.0
|
||||
|
||||
postcss@8.5.15:
|
||||
postcss@8.5.23:
|
||||
dependencies:
|
||||
nanoid: 3.3.12
|
||||
nanoid: 3.3.16
|
||||
picocolors: 1.1.1
|
||||
source-map-js: 1.2.1
|
||||
|
||||
@@ -1554,7 +1571,7 @@ snapshots:
|
||||
|
||||
ts-interface-checker@0.1.13: {}
|
||||
|
||||
tsup@8.5.1(postcss@8.5.15)(tsx@4.21.0)(typescript@5.9.3):
|
||||
tsup@8.5.1(postcss@8.5.23)(tsx@4.21.0)(typescript@5.9.3):
|
||||
dependencies:
|
||||
bundle-require: 5.1.0(esbuild@0.28.1)
|
||||
cac: 6.7.14
|
||||
@@ -1565,7 +1582,7 @@ snapshots:
|
||||
fix-dts-default-cjs-exports: 1.0.1
|
||||
joycon: 3.1.1
|
||||
picocolors: 1.1.1
|
||||
postcss-load-config: 6.0.1(postcss@8.5.15)(tsx@4.21.0)
|
||||
postcss-load-config: 6.0.1(postcss@8.5.23)(tsx@4.21.0)
|
||||
resolve-from: 5.0.0
|
||||
rollup: 4.60.0
|
||||
source-map: 0.7.6
|
||||
@@ -1574,7 +1591,7 @@ snapshots:
|
||||
tinyglobby: 0.2.15
|
||||
tree-kill: 1.2.2
|
||||
optionalDependencies:
|
||||
postcss: 8.5.15
|
||||
postcss: 8.5.23
|
||||
typescript: 5.9.3
|
||||
transitivePeerDependencies:
|
||||
- jiti
|
||||
@@ -1602,7 +1619,7 @@ snapshots:
|
||||
esbuild: 0.28.1
|
||||
fdir: 6.5.0(picomatch@4.0.4)
|
||||
picomatch: 4.0.4
|
||||
postcss: 8.5.15
|
||||
postcss: 8.5.23
|
||||
rollup: 4.60.0
|
||||
tinyglobby: 0.2.15
|
||||
optionalDependencies:
|
||||
|
||||
@@ -10,5 +10,5 @@ overrides:
|
||||
langsmith@<0.6.0: ^0.6.0
|
||||
tar-fs@>=2.0.0 <2.1.4: ^2.1.4
|
||||
picomatch@<2.3.2: ^2.3.2
|
||||
"postcss@<8.5.10": ">=8.5.10"
|
||||
"esbuild": ">=0.28.1"
|
||||
"postcss@<8.5.18": ">=8.5.18 <9.0.0"
|
||||
|
||||
@@ -65,9 +65,8 @@ The request is queued for background processing. The response contains an `event
|
||||
<CodeGroup>
|
||||
```json 200 response
|
||||
{
|
||||
"message": "Memory processing has been queued for background execution",
|
||||
"status": "PENDING",
|
||||
"event_id": "evt-uuid"
|
||||
"event_id": "evt-uuid",
|
||||
"status": "PENDING"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
+58
-4
@@ -7,6 +7,18 @@ mode: "wide"
|
||||
<Tabs>
|
||||
<Tab title="Python">
|
||||
|
||||
<Update label="2026-08-01" description="v2.0.15">
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Core:** `delete_all()` now paginates through the vector store in batches of 1000 instead of listing once, so accounts with more memories than a single page (most vector stores default to ~100) had the remainder silently left behind ([#6636](https://github.com/mem0ai/mem0/pull/6636))
|
||||
- **Vector Stores:** Cap Supabase `search()`/`list()` `top_k` at the `vecs` query limit of 1000 instead of erroring, and fix a `col_info()` crash by reading collection attributes directly instead of calling the removed `describe()` method ([#6695](https://github.com/mem0ai/mem0/pull/6695))
|
||||
- **Vector Stores:** Set `size` on Elasticsearch KNN search queries, so results respect `top_k` instead of being capped at Elasticsearch's default of 10 hits ([#5910](https://github.com/mem0ai/mem0/pull/5910))
|
||||
|
||||
**Changes:**
|
||||
- **Rerankers:** `LLMReranker`'s default model is now `gpt-5-mini` (was `gpt-4o-mini`) ([#6703](https://github.com/mem0ai/mem0/pull/6703))
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-07-25" description="v2.0.14">
|
||||
|
||||
**New Features:**
|
||||
@@ -1157,6 +1169,24 @@ See the [OSS v2 to v3 migration guide](https://docs.mem0.ai/migration/oss-v2-to-
|
||||
|
||||
<Tab title="TypeScript">
|
||||
|
||||
<Update label="2026-08-01" description="v3.1.3">
|
||||
|
||||
**New Features:**
|
||||
- **Vector Stores:** Add Qdrant server-side BM25 `keywordSearch()` (requires Qdrant >= 1.15.2) plus payload filter indexes, so keyword search runs without a client-side BM25 dependency ([#5851](https://github.com/mem0ai/mem0/pull/5851))
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Core:** `deleteAll()` now paginates through the vector store in batches of 1000 instead of listing once, so accounts with more memories than a single page had the remainder silently left behind ([#4872](https://github.com/mem0ai/mem0/pull/4872))
|
||||
- **Vector Stores:** Supabase `list()` now paginates past PostgREST's 1000-row cap instead of stopping at the first page, `search()` warns when results may have been truncated by that same cap, and the initialization probe reads a row instead of writing a test vector, so Row Level Security policies that only grant read access no longer fail table verification ([#6695](https://github.com/mem0ai/mem0/pull/6695))
|
||||
- **Embeddings:** Honor `TOGETHER_API_BASE` in the Together embedder, matching the Together LLM provider, so a custom gateway URL is no longer silently ignored for embeddings ([#6572](https://github.com/mem0ai/mem0/pull/6572))
|
||||
|
||||
**Changes:**
|
||||
- **Rerankers:** `RerankerFactory`'s default LLM reranker model is now `gpt-5-mini` (was `gpt-4o-mini`) ([#6703](https://github.com/mem0ai/mem0/pull/6703))
|
||||
|
||||
**Security:**
|
||||
- **Dependencies:** Patched 32 high and 57 medium severity dependency vulnerabilities across the pnpm workspace via `pnpm.overrides` (`axios`, `brace-expansion`, `js-yaml`, `postcss`, `protobufjs`, `mongoose`, `tar`, `fast-xml-parser`, `thrift`) ([#6639](https://github.com/mem0ai/mem0/pull/6639))
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-07-25" description="v3.1.2">
|
||||
|
||||
**Bug Fixes:**
|
||||
@@ -1886,9 +1916,9 @@ A full-featured command-line interface for Mem0, available in both Python and No
|
||||
<Update label="2026-07-14" description="mem0-plugin v0.2.13">
|
||||
|
||||
**Fixes:**
|
||||
- **Assistant messages no longer stored as your own:** The session-summary hook (fires at the end of every assistant turn) and the post-compaction hook were sending the assistant's own message to Mem0 tagged `role: "user"`. Because Mem0 extracts *facts about the user* from each message and uses `role` to decide who spoke, the assistant's first-person prose was being saved as the human's stated preferences — "I recommend we drop Redis" became `User prefers dropping Redis entirely`. Both hooks now send `role: "assistant"`, so the same session is stored as `Assistant recommended...`. Affects Claude Code, Cursor, Codex, and Antigravity, which share these hooks.
|
||||
- **Assistant messages no longer stored as your own:** The session-summary hook (fires at the end of every assistant turn) and the post-compaction hook were sending the assistant's own message to Mem0 tagged `role: "user"`. Because Mem0 extracts *facts about the user* from each message and uses `role` to decide who spoke, the assistant's first-person prose was being saved as the human's stated preferences: "I recommend we drop Redis" became `User prefers dropping Redis entirely`. Both hooks now send `role: "assistant"`, so the same session is stored as `Assistant recommended...`. Affects Claude Code, Cursor, Codex, and Antigravity, which share these hooks.
|
||||
|
||||
Existing memories written by the previous versions are not rewritten. If your memories contain preferences you never expressed, delete them — the plugin will not recreate them.
|
||||
Existing memories written by the previous versions are not rewritten. If your memories contain preferences you never expressed, delete them; the plugin will not recreate them.
|
||||
|
||||
</Update>
|
||||
|
||||
@@ -2225,9 +2255,9 @@ Initial release of the Mem0 plugin for Claude Code and Cursor, followed by Codex
|
||||
<Update label="2026-07-14" description="Antigravity plugin v0.1.5">
|
||||
|
||||
**Fixes:**
|
||||
- **Assistant messages no longer stored as your own:** The session-summary hook (fires at the end of every assistant turn) and the post-compaction hook were sending the assistant's own message to Mem0 tagged `role: "user"`. Because Mem0 extracts *facts about the user* from each message and uses `role` to decide who spoke, the assistant's first-person prose was being saved as the human's stated preferences — "I recommend we drop Redis" became `User prefers dropping Redis entirely`. Both hooks now send `role: "assistant"`, so the same session is stored as `Assistant recommended...`.
|
||||
- **Assistant messages no longer stored as your own:** The session-summary hook (fires at the end of every assistant turn) and the post-compaction hook were sending the assistant's own message to Mem0 tagged `role: "user"`. Because Mem0 extracts *facts about the user* from each message and uses `role` to decide who spoke, the assistant's first-person prose was being saved as the human's stated preferences: "I recommend we drop Redis" became `User prefers dropping Redis entirely`. Both hooks now send `role: "assistant"`, so the same session is stored as `Assistant recommended...`.
|
||||
|
||||
Existing memories written by the previous versions are not rewritten. If your memories contain preferences you never expressed, delete them — the plugin will not recreate them.
|
||||
Existing memories written by the previous versions are not rewritten. If your memories contain preferences you never expressed, delete them; the plugin will not recreate them.
|
||||
|
||||
</Update>
|
||||
|
||||
@@ -2278,6 +2308,16 @@ Existing memories written by the previous versions are not rewritten. If your me
|
||||
|
||||
<Tab title="OpenClaw">
|
||||
|
||||
<Update label="2026-08-01" description="openclaw-mem0 v1.0.15">
|
||||
|
||||
**Improvements:**
|
||||
- **Onboarding suggestions:** The example commands shown by `openclaw mem0 config show` now suggest `gpt-5-mini` instead of `gpt-4o` ([#6704](https://github.com/mem0ai/mem0/pull/6704))
|
||||
|
||||
**Security:**
|
||||
- **Dependencies:** Patched high and medium severity dependency vulnerabilities via `pnpm.overrides` (`protobufjs`, `axios`, `postcss`, `mongoose`) ([#6639](https://github.com/mem0ai/mem0/pull/6639))
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-06-30" description="openclaw-mem0 v1.0.14">
|
||||
|
||||
**Improvements:**
|
||||
@@ -2531,6 +2571,13 @@ Existing memories written by the previous versions are not rewritten. If your me
|
||||
|
||||
<Tab title="Pi Agent">
|
||||
|
||||
<Update label="2026-08-01" description="Pi Agent plugin v0.1.4">
|
||||
|
||||
**Security:**
|
||||
- **Dependencies:** Patched high and medium severity dependency vulnerabilities via `pnpm.overrides` (`axios`, `brace-expansion`, `postcss`, `mongoose`, `protobufjs`) ([#6639](https://github.com/mem0ai/mem0/pull/6639))
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-06-30" description="Pi Agent plugin v0.1.3">
|
||||
|
||||
**New Features:**
|
||||
@@ -2583,6 +2630,13 @@ Existing memories written by the previous versions are not rewritten. If your me
|
||||
|
||||
<Tab title="Vercel AI SDK">
|
||||
|
||||
<Update label="2026-08-01" description="Vercel AI SDK v3.0.1">
|
||||
|
||||
**Security:**
|
||||
- **Dependencies:** Patched high and medium severity dependency vulnerabilities via `pnpm.overrides` (`brace-expansion`, `js-yaml`) ([#6639](https://github.com/mem0ai/mem0/pull/6639))
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-06-10" description="Vercel AI SDK v3.0.0">
|
||||
|
||||
**Major Release**: Migrated to Vercel AI SDK v6 (`LanguageModelV3` / `ProviderV3`) and Mem0 v3 API.
|
||||
|
||||
@@ -52,7 +52,7 @@ All rerankers share these common configuration parameters:
|
||||
|
||||
| Parameter | Description | Type | Default |
|
||||
| ---------------- | ------------------------------------------ | ------- | ---------------------- |
|
||||
| `model` | LLM model to use for scoring | `str` | `"gpt-4o-mini"` |
|
||||
| `model` | LLM model to use for scoring | `str` | `"gpt-5-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` |
|
||||
@@ -114,7 +114,7 @@ The self-hosted [TypeScript SDK](/open-source/features/reranker-search#typescrip
|
||||
| `zero_entropy` | `pnpm add zeroentropy` | `zerank-1` | `apiKey`, `model`, `topK` |
|
||||
| `sentence_transformer` | `pnpm add @huggingface/transformers` | `Xenova/ms-marco-MiniLM-L-6-v2` | `model`, `device`, `maxLength`, `normalize`, `topK` |
|
||||
| `huggingface` | `pnpm add @huggingface/transformers` | `Xenova/bge-reranker-base` | `model`, `device`, `maxLength`, `normalize`, `topK` |
|
||||
| `llm_reranker` | None (uses your LLM provider's own SDK) | `openai` / `gpt-4o-mini` | `provider`, `model`, `apiKey`, `llm` (nested override), `topK` |
|
||||
| `llm_reranker` | None (uses your LLM provider's own SDK) | `openai` / `gpt-5-mini` | `provider`, `model`, `apiKey`, `llm` (nested override), `topK` |
|
||||
|
||||
```typescript
|
||||
import { Memory } from "mem0ai/oss";
|
||||
|
||||
@@ -48,7 +48,7 @@ config = {
|
||||
"provider": "llm_reranker",
|
||||
"config": {
|
||||
"provider": "openai",
|
||||
"model": "gpt-4o-mini",
|
||||
"model": "gpt-5-mini",
|
||||
"api_key": "your-openai-key",
|
||||
"scoring_prompt": custom_prompt,
|
||||
"top_k": 5
|
||||
|
||||
@@ -101,7 +101,7 @@ os.environ["COHERE_API_KEY"] = "your-api-key"
|
||||
# Initialize memory with Cohere reranker
|
||||
config = {
|
||||
"vector_store": {"provider": "chroma"},
|
||||
"llm": {"provider": "openai", "config": {"model": "gpt-4o-mini"}},
|
||||
"llm": {"provider": "openai", "config": {"model": "gpt-5-mini"}},
|
||||
"rerank": {
|
||||
"provider": "cohere",
|
||||
"config": {
|
||||
|
||||
@@ -19,7 +19,7 @@ config = {
|
||||
"provider": "llm_reranker",
|
||||
"config": {
|
||||
"provider": "openai",
|
||||
"model": "gpt-4o-mini",
|
||||
"model": "gpt-5-mini",
|
||||
"api_key": "your-openai-api-key"
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ m = Memory.from_config(config)
|
||||
| Parameter | Type | Default | Description |
|
||||
|-----------|------|---------|-------------|
|
||||
| `provider` | str | `"openai"` | LLM provider (openai, anthropic, etc.) |
|
||||
| `model` | str | `"gpt-4o-mini"` | LLM model to use for reranking |
|
||||
| `model` | str | `"gpt-5-mini"` | LLM model to use for reranking |
|
||||
| `api_key` | str | None | API key for the LLM provider |
|
||||
| `top_k` | int | None | Number of top documents to return after reranking |
|
||||
| `temperature` | float | 0.0 | LLM temperature for consistency |
|
||||
@@ -69,7 +69,7 @@ config = {
|
||||
|
||||
## TypeScript (self-hosted)
|
||||
|
||||
The [TypeScript OSS SDK](/open-source/features/reranker-search#typescript-sdk) (`mem0ai/oss`) ships the LLM reranker under the provider name `llm_reranker`. It does **not** reuse the Memory's main `llm` instance; it builds its own LLM from the reranker's own config, defaulting to `openai` / `gpt-4o-mini`. Set `provider`/`model`/`apiKey` directly on `config`, or nest a fully separate `config.llm: { provider, config }` (its `provider`/`config` take priority over the top-level fields, which only backfill values missing from the nested config).
|
||||
The [TypeScript OSS SDK](/open-source/features/reranker-search#typescript-sdk) (`mem0ai/oss`) ships the LLM reranker under the provider name `llm_reranker`. It does **not** reuse the Memory's main `llm` instance; it builds its own LLM from the reranker's own config, defaulting to `openai` / `gpt-5-mini`. Set `provider`/`model`/`apiKey` directly on `config`, or nest a fully separate `config.llm: { provider, config }` (its `provider`/`config` take priority over the top-level fields, which only backfill values missing from the nested config).
|
||||
|
||||
```typescript
|
||||
import { Memory } from "mem0ai/oss";
|
||||
@@ -114,7 +114,7 @@ config = {
|
||||
"provider": "llm_reranker",
|
||||
"config": {
|
||||
"provider": "openai",
|
||||
"model": "gpt-4o-mini",
|
||||
"model": "gpt-5-mini",
|
||||
"api_key": "your-openai-api-key",
|
||||
"temperature": 0.0
|
||||
}
|
||||
@@ -170,15 +170,15 @@ config = {
|
||||
"provider": "llm_reranker",
|
||||
"config": {
|
||||
"provider": "azure_openai",
|
||||
"model": "gpt-4o-mini",
|
||||
"model": "gpt-5-mini",
|
||||
"api_key": "your-azure-api-key",
|
||||
"llm": {
|
||||
"provider": "azure_openai",
|
||||
"config": {
|
||||
"model": "gpt-4o-mini",
|
||||
"model": "gpt-5-mini",
|
||||
"api_key": "your-azure-api-key",
|
||||
"azure_endpoint": "https://your-resource.openai.azure.com/",
|
||||
"azure_deployment": "gpt-4o-mini-deployment"
|
||||
"azure_deployment": "gpt-5-mini-deployment"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -232,7 +232,7 @@ config = {
|
||||
"provider": "llm_reranker",
|
||||
"config": {
|
||||
"provider": "openai",
|
||||
"model": "gpt-4o-mini",
|
||||
"model": "gpt-5-mini",
|
||||
"api_key": "your-api-key",
|
||||
"scoring_prompt": custom_prompt
|
||||
}
|
||||
@@ -351,7 +351,7 @@ fast_config = {
|
||||
"provider": "llm_reranker",
|
||||
"config": {
|
||||
"provider": "openai",
|
||||
"model": "gpt-4o-mini",
|
||||
"model": "gpt-5-mini",
|
||||
"api_key": "your-api-key",
|
||||
"top_k": 5,
|
||||
"temperature": 0.0
|
||||
@@ -444,7 +444,7 @@ fallback_config = {
|
||||
"provider": "llm_reranker",
|
||||
"config": {
|
||||
"provider": "openai",
|
||||
"model": "gpt-4o-mini",
|
||||
"model": "gpt-5-mini",
|
||||
"api_key": "your-api-key"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ config = {
|
||||
"llm": {
|
||||
"provider": "openai",
|
||||
"config": {
|
||||
"model": "gpt-4o-mini"
|
||||
"model": "gpt-5-mini"
|
||||
}
|
||||
},
|
||||
"rerank": {
|
||||
@@ -113,7 +113,7 @@ from mem0 import Memory
|
||||
# Initialize memory with local reranker
|
||||
config = {
|
||||
"vector_store": {"provider": "chroma"},
|
||||
"llm": {"provider": "openai", "config": {"model": "gpt-4o-mini"}},
|
||||
"llm": {"provider": "openai", "config": {"model": "gpt-5-mini"}},
|
||||
"rerank": {
|
||||
"provider": "sentence_transformer",
|
||||
"config": {
|
||||
|
||||
@@ -34,7 +34,7 @@ config = {
|
||||
"llm": {
|
||||
"provider": "openai",
|
||||
"config": {
|
||||
"model": "gpt-4o-mini"
|
||||
"model": "gpt-5-mini"
|
||||
}
|
||||
},
|
||||
"rerank": {
|
||||
@@ -98,7 +98,7 @@ os.environ["ZERO_ENTROPY_API_KEY"] = "your-api-key"
|
||||
# Initialize memory with Zero Entropy reranker
|
||||
config = {
|
||||
"vector_store": {"provider": "chroma"},
|
||||
"llm": {"provider": "openai", "config": {"model": "gpt-4o-mini"}},
|
||||
"llm": {"provider": "openai", "config": {"model": "gpt-5-mini"}},
|
||||
"rerank": {"provider": "zero_entropy", "config": {"model": "zerank-1"}}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,8 +96,8 @@ await memory.add(messages, { userId: "alice", metadata: { category: "movies" } }
|
||||
</Tabs>
|
||||
|
||||
Both SDKs store vectors on graph nodes labeled `MEM0_VECTOR_<collection_name>`. Point them at the same
|
||||
graph with the same `collection_name` — the defaults differ, `mem0` in Python and `memories` in
|
||||
TypeScript — and `get()`, `list()`, and `delete()` interoperate across SDKs.
|
||||
graph with the same `collection_name` (the defaults differ, `mem0` in Python and `memories` in
|
||||
TypeScript) and `get()`, `list()`, and `delete()` interoperate across SDKs.
|
||||
|
||||
<Note>
|
||||
`search()` is not currently cross-SDK compatible. The TypeScript provider filters on Neptune's reserved
|
||||
|
||||
@@ -60,6 +60,12 @@ await memory.add(messages, { userId: "alice", metadata: { category: "movies" } }
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
### Hybrid keyword search
|
||||
|
||||
Mem0 blends semantic similarity with BM25 keyword scoring. On the TypeScript SDK, Qdrant computes the BM25 vectors server-side, which requires Qdrant 1.15.2 or newer with inference enabled. Qdrant Cloud enables inference by default only for clusters created after 2025-07-07; older clusters must activate it from the Cluster Detail page. The Python SDK encodes BM25 locally instead and needs the `fastembed` package, so scores are not numerically comparable between the two SDKs.
|
||||
|
||||
When BM25 is unavailable, or when the collection was created before hybrid search was added, Mem0 logs a warning and falls back to semantic-only search. Writes are unaffected. To enable keyword scoring on an older collection, use a fresh collection name.
|
||||
|
||||
### Config
|
||||
|
||||
Let's see the available parameters for the `qdrant` config:
|
||||
|
||||
@@ -115,6 +115,27 @@ $$;
|
||||
|
||||
Go to [Supabase](https://supabase.com/dashboard/projects) and run the above SQL migrations in the SQL Editor.
|
||||
|
||||
### Row Level Security
|
||||
|
||||
Tables created through the Supabase dashboard have Row Level Security (RLS) enabled by default with no policies attached. With RLS on and no policies, the TypeScript SDK's queries return zero rows with an HTTP 200 (no error is raised), which looks like an empty memory store rather than a permissions problem. If you use the SQL migrations above (via the SQL Editor), RLS is left in its default off state and this does not apply.
|
||||
|
||||
If your table has RLS enabled, add policies for the key your app uses (the example below grants full access to the `service_role` key; scope it down for anon/authenticated keys as needed):
|
||||
|
||||
```sql
|
||||
alter table memories enable row level security;
|
||||
|
||||
create policy "Allow service role full access to memories"
|
||||
on memories
|
||||
for all
|
||||
to service_role
|
||||
using (true)
|
||||
with check (true);
|
||||
```
|
||||
|
||||
### PostgREST Row Limits
|
||||
|
||||
Supabase's PostgREST layer caps the number of rows returned by a single request at `db-max-rows` (1000 by default), for both `.select()` queries and RPC function calls like `match_vectors`. Requesting a `topK` above this limit for `search()` or `list()` will not raise an error, results are capped at `db-max-rows` instead. The TypeScript `list()` method paginates internally to work around this, but `search()` cannot since `match_vectors` has no offset parameter; it logs a warning when it detects a truncated result. Raise `db-max-rows` in your Supabase project settings if you need more than 1000 results per search.
|
||||
|
||||
### Config
|
||||
|
||||
Here are the parameters available for configuring Supabase:
|
||||
|
||||
@@ -55,9 +55,8 @@ await addUserPreferences();
|
||||
|
||||
```json Output
|
||||
{
|
||||
"message": "Memory processing has been queued for background execution",
|
||||
"status": "PENDING",
|
||||
"event_id": "9f8c2b1a-4e7d-4c3a-9b21-1a2b3c4d5e6f"
|
||||
"event_id": "9f8c2b1a-4e7d-4c3a-9b21-1a2b3c4d5e6f",
|
||||
"status": "PENDING"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -67,7 +67,7 @@ The plugin uses the same shell scripts as Claude Code, Cursor, and Codex: hooks
|
||||
| **Post-tool** | `PostToolUse` | Tracks stats, scans bash errors for related memories |
|
||||
| **Stop** | `Stop` | Stores a session summary at the end of every assistant turn (not just at session end) |
|
||||
|
||||
What you type is stored as yours. What the agent produces — session summaries and compaction summaries — is stored as the assistant's, so its suggestions never become your stated preferences.
|
||||
What you type is stored as yours. What the agent produces (session summaries and compaction summaries) is stored as the assistant's, so its suggestions never become your stated preferences.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ When installed via the plugin marketplace, Mem0 hooks into Claude Code's lifecyc
|
||||
| **Stop** | `Stop` | Stores a session summary at the end of every assistant turn (not just at session end) |
|
||||
| **Pre-compact** | `PreCompact` | Stores a summary before the context is compacted |
|
||||
|
||||
What you type is stored as yours. What Claude produces — session summaries and compaction summaries — is stored as the assistant's, so its suggestions never become your stated preferences.
|
||||
What you type is stored as yours. What Claude produces (session summaries and compaction summaries) is stored as the assistant's, so its suggestions never become your stated preferences.
|
||||
|
||||
## Example Workflow
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ When installed via the plugin marketplace, Mem0 hooks into Codex's lifecycle to
|
||||
| **Stop** | `Stop` | Stores a session summary at the end of every assistant turn (not just at session end) |
|
||||
| **Pre-compact** | `PreCompact` | Stores a summary before the context is compacted |
|
||||
|
||||
What you type is stored as yours. What Codex produces — session summaries and compaction summaries — is stored as the assistant's, so its suggestions never become your stated preferences.
|
||||
What you type is stored as yours. What Codex produces (session summaries and compaction summaries) is stored as the assistant's, so its suggestions never become your stated preferences.
|
||||
|
||||
## Example Workflow
|
||||
|
||||
|
||||
@@ -98,9 +98,8 @@ add_result = add_tool.invoke(add_input)
|
||||
|
||||
```json Output
|
||||
{
|
||||
"message": "Memory processing has been queued for background execution",
|
||||
"status": "PENDING",
|
||||
"event_id": "3a1b2c3d-4e5f-6789-abcd-ef0123456789"
|
||||
"event_id": "3a1b2c3d-4e5f-6789-abcd-ef0123456789",
|
||||
"status": "PENDING"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
+13
-13
@@ -10,7 +10,7 @@ mode: "custom"
|
||||
</h1>
|
||||
|
||||
<p className="max-w-3xl mx-auto text-base text-gray-600 dark:text-zinc-400 leading-relaxed">
|
||||
Universal, self-improving memory layer for LLM applications.
|
||||
Mem0 gives your AI agents long-term memory that persists across sessions, tools, and runs.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -34,10 +34,10 @@ mode: "custom"
|
||||
/>
|
||||
<div className="flex flex-1 flex-col gap-2 px-4 pb-4 pt-3 text-left">
|
||||
<h3 className="text-base font-semibold text-gray-900 dark:text-zinc-100 group-hover:text-primary">
|
||||
Add memory to your app
|
||||
Store your first memory
|
||||
</h3>
|
||||
<p className="text-sm text-gray-600 dark:text-zinc-400">
|
||||
Start with the quickstart and store your first memory in minutes.
|
||||
Five-minute quickstart: get an API key, then save and search a memory in Python or JavaScript.
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
@@ -60,10 +60,10 @@ mode: "custom"
|
||||
/>
|
||||
<div className="flex flex-1 flex-col gap-2 px-4 pb-4 pt-3 text-left">
|
||||
<h3 className="text-base font-semibold text-gray-900 dark:text-zinc-100 group-hover:text-primary">
|
||||
Add memory to your agent
|
||||
Add memory to your coding agent
|
||||
</h3>
|
||||
<p className="text-sm text-gray-600 dark:text-zinc-400">
|
||||
Give Claude Code, Cursor, and Codex memory that persists across sessions. A drop-in plugin, no code to write.
|
||||
Plugins that let Claude Code, Cursor, Codex, and other harnesses remember your project. Opens the Claude Code guide.
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
@@ -86,10 +86,10 @@ mode: "custom"
|
||||
/>
|
||||
<div className="flex flex-1 flex-col gap-2 px-4 pb-4 pt-3 text-left">
|
||||
<h3 className="text-base font-semibold text-gray-900 dark:text-zinc-100 group-hover:text-primary">
|
||||
Sign up for Mem0 as an agent
|
||||
Let an AI agent sign itself up
|
||||
</h3>
|
||||
<p className="text-sm text-gray-600 dark:text-zinc-400">
|
||||
Let an AI agent mint a Mem0 API key, claim ownership later, and write its first memory from the terminal.
|
||||
Four terminal commands create an account and API key. No email, no dashboard. Claim it as owner later.
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
@@ -112,10 +112,10 @@ mode: "custom"
|
||||
/>
|
||||
<div className="flex flex-1 flex-col gap-2 px-4 pb-4 pt-3 text-left">
|
||||
<h3 className="text-base font-semibold text-gray-900 dark:text-zinc-100 group-hover:text-primary">
|
||||
Explore Mem0 integrations
|
||||
Use Mem0 with your framework
|
||||
</h3>
|
||||
<p className="text-sm text-gray-600 dark:text-zinc-400">
|
||||
Connect Mem0 to LangChain, CrewAI, Vercel AI SDK, and 20+ partner frameworks.
|
||||
Setup guides for 22 tools, including LangChain, CrewAI, LlamaIndex, and the Vercel AI SDK.
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
@@ -138,10 +138,10 @@ mode: "custom"
|
||||
/>
|
||||
<div className="flex flex-1 flex-col gap-2 px-4 pb-4 pt-3 text-left">
|
||||
<h3 className="text-base font-semibold text-gray-900 dark:text-zinc-100 group-hover:text-primary">
|
||||
See memory-app examples
|
||||
Copy a working example
|
||||
</h3>
|
||||
<p className="text-sm text-gray-600 dark:text-zinc-400">
|
||||
Browse cookbooks for companions, support agents, voice agents, research tools, and more.
|
||||
Full walkthroughs for companion chatbots, support agents, voice agents, and research tools.
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
@@ -164,10 +164,10 @@ mode: "custom"
|
||||
/>
|
||||
<div className="flex flex-1 flex-col gap-2 px-4 pb-4 pt-3 text-left">
|
||||
<h3 className="text-base font-semibold text-gray-900 dark:text-zinc-100 group-hover:text-primary">
|
||||
Self-host Mem0
|
||||
Run Mem0 on your own servers
|
||||
</h3>
|
||||
<p className="text-sm text-gray-600 dark:text-zinc-400">
|
||||
Use Open Source when you want memory without the hosted platform.
|
||||
The open-source version. Run it as a library or a Docker stack, with your data on your infrastructure.
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ This mints an evaluation key in <5 seconds. Use it immediately against the Platf
|
||||
|
||||
## Identify the User's Setup
|
||||
|
||||
Look at the user's imports first - they determine which product (Platform vs OSS) and which language you should quote docs from. **Mem0 Platform (managed) is the recommended path** - 4-line integration, sub-50ms retrieval, no infra. Route to OSS only when the user has an explicit self-hosting requirement.
|
||||
Look at the user's imports first - they determine which product (Platform vs OSS) and which language you should quote docs from. **Mem0 Platform (managed) is the recommended path** - 4-line integration, no infra to run. Route to OSS only when the user has an explicit self-hosting requirement.
|
||||
|
||||
### Platform - Python [Platform]
|
||||
|
||||
@@ -170,7 +170,7 @@ If the user is on a pre-current major (Python < 2, TS < 3, or Platform `output_f
|
||||
|
||||
- [Introduction](https://docs.mem0.ai/introduction) [Both]: Use when the user wants a one-page overview of how memory fits between the LLM and the app.
|
||||
- [Vibe Code with Mem0](https://docs.mem0.ai/vibecoding) [Both]: Use when the user is in Claude Code, Cursor, or Windsurf and wants memory wired into their editor.
|
||||
- [Platform Overview](https://docs.mem0.ai/platform/overview) [Platform]: Use when the user picks the managed product - 4-line integration, sub-50ms retrieval, dashboard.
|
||||
- [Platform Overview](https://docs.mem0.ai/platform/overview) [Platform]: Use when the user picks the managed product - 4-line integration, hosted API, dashboard.
|
||||
- [Sign up as an agent](https://docs.mem0.ai/platform/agent-signup) [Platform]: Use when an AI agent needs to mint a Mem0 API key autonomously - four commands, no email or dashboard, human claims ownership later.
|
||||
- [Platform vs Open Source](https://docs.mem0.ai/platform/platform-vs-oss) [Both]: Use when the user is deciding between managed and self-hosted.
|
||||
- [Platform Quickstart](https://docs.mem0.ai/platform/quickstart) [Platform]: Use for the first Platform integration - API key plus `MemoryClient.add/search`.
|
||||
|
||||
@@ -146,9 +146,8 @@ curl -X POST 'https://api.mem0.ai/v3/memories/?page=1&page_size=50' \
|
||||
|
||||
```json
|
||||
{
|
||||
"message": "Memory processing has been queued for background execution",
|
||||
"status": "PENDING",
|
||||
"event_id": "evt-uuid"
|
||||
"event_id": "evt-uuid",
|
||||
"status": "PENDING"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ const results = await memory.search("What movies do I like?", {
|
||||
|
||||
### LLM reranker
|
||||
|
||||
To score with an LLM instead of a dedicated reranker, use the `llm_reranker` provider. It builds its own LLM from the reranker's config (defaulting to `openai` / `gpt-4o-mini`) rather than reusing the Memory's main `llm`:
|
||||
To score with an LLM instead of a dedicated reranker, use the `llm_reranker` provider. It builds its own LLM from the reranker's config (defaulting to `openai` / `gpt-5-mini`) rather than reusing the Memory's main `llm`:
|
||||
|
||||
```typescript
|
||||
const memory = new Memory({
|
||||
@@ -137,7 +137,7 @@ const memory = new Memory({
|
||||
| `zero_entropy` | `zerank-1` | `apiKey`, `model`, `topK` |
|
||||
| `sentence_transformer` | `Xenova/ms-marco-MiniLM-L-6-v2` | `model`, `device`, `maxLength`, `normalize`, `topK` |
|
||||
| `huggingface` | `Xenova/bge-reranker-base` | `model`, `device`, `maxLength`, `normalize`, `topK` |
|
||||
| `llm_reranker` | `openai` / `gpt-4o-mini` | `provider`, `model`, `apiKey`, `llm` (nested override), `topK` |
|
||||
| `llm_reranker` | `openai` / `gpt-5-mini` | `provider`, `model`, `apiKey`, `llm` (nested override), `topK` |
|
||||
|
||||
<Note>
|
||||
`rerank` is opt-in per search and a no-op when no `reranker` is configured. If the reranker call fails, Mem0 logs a warning and returns the original vector-ranked results.
|
||||
|
||||
@@ -35,8 +35,7 @@ pip install mem0ai
|
||||
from mem0 import Memory
|
||||
|
||||
m = Memory()
|
||||
|
||||
````
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Add a memory">
|
||||
@@ -46,7 +45,7 @@ messages = [
|
||||
{"role": "assistant", "content": "Hey Alex! I'll remember your interests."}
|
||||
]
|
||||
m.add(messages, user_id="alex")
|
||||
````
|
||||
```
|
||||
|
||||
</Step>
|
||||
|
||||
|
||||
+4
-4
@@ -2035,7 +2035,8 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"description": "Only present when `infer` is `false`, where processing is synchronous."
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
@@ -2052,9 +2053,8 @@
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"message": "Memory processing has been queued for background execution",
|
||||
"status": "PENDING",
|
||||
"event_id": "2c4d1f44-4f7b-4b2f-9f6e-7b5b4f5a1234"
|
||||
"event_id": "2c4d1f44-4f7b-4b2f-9f6e-7b5b4f5a1234",
|
||||
"status": "PENDING"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ pip install mem0ai
|
||||
</Step>
|
||||
<Step title="Export your API key">
|
||||
```bash
|
||||
export MEM0_API_KEY="sk-platform-..."
|
||||
export MEM0_API_KEY="m0-..."
|
||||
```
|
||||
</Step>
|
||||
<Step title="Create an async client">
|
||||
@@ -49,7 +49,7 @@ npm install mem0ai
|
||||
</Step>
|
||||
<Step title="Load your API key">
|
||||
```bash
|
||||
export MEM0_API_KEY="sk-platform-..."
|
||||
export MEM0_API_KEY="m0-..."
|
||||
```
|
||||
</Step>
|
||||
<Step title="Instantiate the client">
|
||||
@@ -158,6 +158,8 @@ await memory.update(matches.results[0].id, {
|
||||
|
||||
## Clean up
|
||||
|
||||
Scope each delete call to a single entity id where possible; combining more than one entity filter in the same `delete_all` call is not guaranteed to AND them together today.
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Python">
|
||||
<Steps>
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
---
|
||||
title: Sign up as an agent
|
||||
description: "Zero-friction signup for AI agents: mint a working Mem0 API key in under five seconds. No email, no dashboard, no OTP."
|
||||
description: "Let an AI agent create its own Mem0 account and API key in four commands, with no email or dashboard needed."
|
||||
icon: "robot"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
If you're an AI agent (Claude Code, Cursor, Codex, Cline, Aider, Windsurf, or any other autonomous coding tool), you don't need a human to set up Mem0 for you. Four commands (install, sign up, push a memory, search it) and you have persistent memory.
|
||||
Normally a person signs up for Mem0, gets an API key from the dashboard, and hands it to their tools. Agent Mode skips that: a coding agent creates its own account from the terminal and starts storing memories immediately. A human can take ownership of that account later, without disrupting the agent.
|
||||
|
||||
## The 4-command demo
|
||||
This page is written for both readers. The setup below is for the agent; [Claiming the account](#claiming-the-account-for-the-human-owner) is for the person who ends up owning it.
|
||||
|
||||
<Note>
|
||||
**If you're an AI agent** (Claude Code, Cursor, Codex, Cline, Aider, Windsurf, or any other coding tool), run the four commands below. You don't need a human to set Mem0 up for you.
|
||||
</Note>
|
||||
|
||||
## Sign up in four commands
|
||||
|
||||
<CodeGroup>
|
||||
```bash npm
|
||||
@@ -17,11 +23,11 @@ npm install -g @mem0/cli
|
||||
# 2. Sign up as an agent (replace `claude-code` with your name)
|
||||
mem0 init --agent --agent-caller claude-code
|
||||
|
||||
# 3. Push a memory
|
||||
mem0 add "I am using mem0"
|
||||
# 3. Store a memory
|
||||
mem0 add "Prefers TypeScript over JavaScript for new projects"
|
||||
|
||||
# 4. Verify
|
||||
mem0 search "am I using mem0"
|
||||
# 4. Search it back
|
||||
mem0 search "what language should I use"
|
||||
```
|
||||
|
||||
```bash pip
|
||||
@@ -31,14 +37,22 @@ pip install mem0-cli
|
||||
# 2. Sign up as an agent (replace `claude-code` with your name)
|
||||
mem0 init --agent --agent-caller claude-code
|
||||
|
||||
# 3. Push a memory
|
||||
mem0 add "I am using mem0"
|
||||
# 3. Store a memory
|
||||
mem0 add "Prefers TypeScript over JavaScript for new projects"
|
||||
|
||||
# 4. Verify
|
||||
mem0 search "am I using mem0"
|
||||
# 4. Search it back
|
||||
mem0 search "what language should I use"
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
Step 2 prints your new account's default scope and how to hand the account to a human later:
|
||||
|
||||
```
|
||||
✓ Agent Mode active. Default user_id: swift-otter-4821
|
||||
|
||||
To claim this account later: mem0 init --email <your-email>
|
||||
```
|
||||
|
||||
That's it. Under 30 seconds from a fresh shell to a working memory store.
|
||||
|
||||
## Identify yourself with `--agent-caller`
|
||||
@@ -46,17 +60,17 @@ That's it. Under 30 seconds from a fresh shell to a working memory store.
|
||||
Replace `claude-code` in the `init` command with your actual agent name (`cursor`, `codex`, `cline`, `aider`, or any short label). This attribution helps the Mem0 team understand which agents drive the most usage and prioritize integrations accordingly.
|
||||
|
||||
<Tip>
|
||||
**Forgot `--agent-caller` on init?** Run `mem0 identify <your-name>` after the fact, same key, just back-fills the attribution. Idempotent.
|
||||
**Forgot `--agent-caller` when you ran `init`?** Run `mem0 identify <your-name>` afterwards. It keeps the same API key and just fills in the name, so it is safe to run more than once.
|
||||
</Tip>
|
||||
|
||||
## What happened when you ran `mem0 init --agent`?
|
||||
|
||||
- A **shadow account** was minted on the Mem0 backend with a fresh API key.
|
||||
- The key was saved to `~/.mem0/config.json` (mode 0600) on the machine you ran the command on.
|
||||
- A default `user_id` was provisioned so `mem0 add` / `mem0 search` work without explicit scope flags.
|
||||
- The account is **unclaimed**; no human owns it yet.
|
||||
- A new Mem0 account was created with its own API key.
|
||||
- The key was saved to `~/.mem0/config.json` on that machine, readable only by you (file mode `0600`).
|
||||
- A default `user_id` was created, so `mem0 add` and `mem0 search` work without you passing scope flags.
|
||||
- **Nobody owns the account yet.** It works, but no human is attached to it until someone claims it.
|
||||
|
||||
Every command run against this key prints a one-line reminder asking you to surface the claim instructions to your human user.
|
||||
Every command run with this key prints a one-line reminder to pass the claim instructions on to your human.
|
||||
|
||||
## Claiming the account (for the human owner)
|
||||
|
||||
@@ -66,7 +80,7 @@ When the human is ready to take ownership of the agent's account (and all the me
|
||||
mem0 init --email you@yourcompany.com
|
||||
```
|
||||
|
||||
The CLI detects the existing Agent Mode config, sends a verification code, and upgrades the shadow account in-place:
|
||||
The CLI spots the existing Agent Mode setup, emails a verification code, and upgrades the account in place:
|
||||
|
||||
- **The API key never changes**, so the agent isn't disrupted.
|
||||
- **All memories transfer** to the human's account.
|
||||
@@ -76,31 +90,33 @@ Pass `--code 123456` to skip the interactive code prompt for fully non-interacti
|
||||
|
||||
## Rate limits and quotas
|
||||
|
||||
Agent Mode signups are rate-limited to **5 per day per IP address** to prevent abuse. If you hit the limit, the CLI returns:
|
||||
Agent Mode signups are limited to **5 per day per IP address** to prevent abuse. If you hit the limit, the CLI tells you so:
|
||||
|
||||
```
|
||||
Daily Agent Mode signup limit reached for this network (5/day).
|
||||
Try again from a different IP or after midnight UTC.
|
||||
```
|
||||
|
||||
Unclaimed agent accounts get the standard Mem0 free-tier quotas. The human owner can upgrade after claiming.
|
||||
Calling the API directly instead of through the CLI returns a plain `403 Forbidden` with no explanation and no `Retry-After` header, so handle that case yourself.
|
||||
|
||||
Until someone claims it, an agent account gets the standard Mem0 free-tier quotas. The human owner can upgrade after claiming.
|
||||
|
||||
## What's next
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="CLI Reference" icon="terminal" href="/platform/cli">
|
||||
Full command-by-command reference for `mem0 add`, `mem0 search`, `mem0 list`, and the rest.
|
||||
<Card title="CLI reference" icon="terminal" href="/platform/cli">
|
||||
Every command in full: `mem0 add`, `mem0 search`, `mem0 list`, and the rest.
|
||||
</Card>
|
||||
|
||||
<Card title="Memory Operations" icon="database" href="/core-concepts/memory-operations/add">
|
||||
<Card title="Memory operations" icon="database" href="/core-concepts/memory-operations/add">
|
||||
How `add`, `search`, `update`, and `delete` work under the hood.
|
||||
</Card>
|
||||
|
||||
<Card title="Mem0 MCP" icon="plug" href="/platform/mem0-mcp">
|
||||
Connect agents to Mem0 via the Model Context Protocol, as an alternative integration path.
|
||||
Give your agent memory as a set of tools instead of shell commands.
|
||||
</Card>
|
||||
|
||||
<Card title="Platform Overview" icon="star" href="/platform/overview">
|
||||
The full Mem0 Platform feature set once you claim your account.
|
||||
<Card title="Platform overview" icon="star" href="/platform/overview">
|
||||
Everything the account unlocks once a human claims it.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
+115
-95
@@ -9,9 +9,7 @@ The mem0 CLI lets you add, search, list, update, and delete memories directly fr
|
||||
|
||||
Both implementations provide identical behavior: same commands, same options, same output formats.
|
||||
|
||||
<Tip>
|
||||
**Built for AI agents.** Pass `--agent` (or `--json`) as a global flag on any command to get structured JSON output optimized for programmatic consumption: sanitized fields, no colors or spinners, and errors as JSON too. Drop it into any agent tool loop with zero extra parsing.
|
||||
</Tip>
|
||||
Running it inside an agent? Put `--agent` before any command to get clean JSON instead of human output. See [Use with AI agents](#use-with-ai-agents).
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -97,6 +95,8 @@ mem0 init --api-key m0-xxx --user-id alice --force
|
||||
| `-u, --user-id` | Default user ID (skip prompt) |
|
||||
| `--email` | Login via email verification code |
|
||||
| `--code` | Verification code (use with `--email` for non-interactive login) |
|
||||
| `--agent` | Create an Agent Mode account, with no email needed |
|
||||
| `--agent-caller` | Name the agent running the command, such as `claude-code` |
|
||||
| `--force` | Overwrite existing config without confirmation |
|
||||
|
||||
<Note>
|
||||
@@ -117,10 +117,15 @@ echo "Loves hiking on weekends" | mem0 add --user-id alice
|
||||
|------|-------------|
|
||||
| `-u, --user-id` | Scope to a user |
|
||||
| `--agent-id` | Scope to an agent |
|
||||
| `--app-id` | Scope to an app |
|
||||
| `--run-id` | Scope to a single run or session |
|
||||
| `--messages` | Conversation messages as JSON |
|
||||
| `-f, --file` | Read messages from a JSON file |
|
||||
| `-m, --metadata` | Custom metadata as JSON |
|
||||
| `--categories` | Categories (JSON array or comma-separated) |
|
||||
| `--expires` | Expiration date, after which the memory stops being returned |
|
||||
| `--immutable` | Store the memory so it can never be updated or overwritten |
|
||||
| `--no-infer` | Store the text exactly as given, skipping fact extraction |
|
||||
| `-o, --output` | Output format: `text`, `json`, `quiet` |
|
||||
|
||||
### `mem0 search`
|
||||
@@ -135,11 +140,15 @@ mem0 search "preferred tools" --user-id alice --output json --top-k 5
|
||||
| Flag | Description |
|
||||
|------|-------------|
|
||||
| `-u, --user-id` | Filter by user |
|
||||
| `-k, --top-k` | Number of results (default: 10) |
|
||||
| `--agent-id` | Filter by agent |
|
||||
| `--app-id` | Filter by app |
|
||||
| `--run-id` | Filter by run or session |
|
||||
| `-k, --top-k` | Number of results (default: 10). `--limit` does the same thing |
|
||||
| `--threshold` | Minimum similarity score (default: 0.3) |
|
||||
| `--rerank` | Enable reranking |
|
||||
| `--keyword` | Use keyword search instead of semantic |
|
||||
| `--filter` | Advanced filter expression (JSON) |
|
||||
| `--fields` | Return only the named fields |
|
||||
| `-o, --output` | Output format: `text`, `json`, `table` |
|
||||
|
||||
### `mem0 list`
|
||||
@@ -155,6 +164,9 @@ mem0 list --user-id alice --after 2024-01-01 --page-size 50
|
||||
| Flag | Description |
|
||||
|------|-------------|
|
||||
| `-u, --user-id` | Filter by user |
|
||||
| `--agent-id` | Filter by agent |
|
||||
| `--app-id` | Filter by app |
|
||||
| `--run-id` | Filter by run or session |
|
||||
| `--page` | Page number (default: 1) |
|
||||
| `--page-size` | Results per page (default: 100) |
|
||||
| `--category` | Filter by category |
|
||||
@@ -171,6 +183,10 @@ mem0 get 7b3c1a2e-4d5f-6789-abcd-ef0123456789
|
||||
mem0 get 7b3c1a2e-4d5f-6789-abcd-ef0123456789 --output json
|
||||
```
|
||||
|
||||
| Flag | Description |
|
||||
|------|-------------|
|
||||
| `-o, --output` | Output format: `text`, `json` |
|
||||
|
||||
### `mem0 update`
|
||||
|
||||
Update the text or metadata of an existing memory.
|
||||
@@ -181,6 +197,11 @@ mem0 update <memory-id> --metadata '{"priority": "high"}'
|
||||
echo "new text" | mem0 update <memory-id>
|
||||
```
|
||||
|
||||
| Flag | Description |
|
||||
|------|-------------|
|
||||
| `-m, --metadata` | Replace the memory's metadata with this JSON |
|
||||
| `-o, --output` | Output format: `text`, `json`, `quiet` |
|
||||
|
||||
### `mem0 delete`
|
||||
|
||||
Delete a single memory, all memories for a scope, or an entire entity.
|
||||
@@ -201,6 +222,10 @@ mem0 delete --all --user-id alice --dry-run
|
||||
|
||||
| Flag | Description |
|
||||
|------|-------------|
|
||||
| `-u, --user-id` | Scope the deletion to a user |
|
||||
| `--agent-id` | Scope the deletion to an agent |
|
||||
| `--app-id` | Scope the deletion to an app |
|
||||
| `--run-id` | Scope the deletion to a run or session |
|
||||
| `--all` | Delete all memories matching scope filters |
|
||||
| `--entity` | Delete the entity and all its memories |
|
||||
| `--project` | With `--all`: delete all memories project-wide |
|
||||
@@ -217,6 +242,12 @@ mem0 import data.json --user-id alice
|
||||
|
||||
The file should be a JSON array where each item has a `memory` (or `text` or `content`) field and optional `user_id`, `agent_id`, and `metadata` fields.
|
||||
|
||||
| Flag | Description |
|
||||
|------|-------------|
|
||||
| `-u, --user-id` | Default user for items that do not set their own |
|
||||
| `--agent-id` | Default agent for items that do not set their own |
|
||||
| `-o, --output` | Output format: `text`, `json` |
|
||||
|
||||
### `mem0 config`
|
||||
|
||||
View or modify the local CLI configuration.
|
||||
@@ -237,6 +268,18 @@ mem0 entity list agents --output json
|
||||
mem0 entity delete --user-id alice --force
|
||||
```
|
||||
|
||||
Deleting an entity removes it and every memory belonging to it. Preview first with `--dry-run`.
|
||||
|
||||
| Flag | Description |
|
||||
|------|-------------|
|
||||
| `-u, --user-id` | The user to delete |
|
||||
| `--agent-id` | The agent to delete |
|
||||
| `--app-id` | The app to delete |
|
||||
| `--run-id` | The run or session to delete |
|
||||
| `--dry-run` | Show what would be deleted, without deleting it |
|
||||
| `--force` | Skip confirmation prompt |
|
||||
| `-o, --output` | Output format: `text`, `json` |
|
||||
|
||||
### `mem0 event`
|
||||
|
||||
Inspect background processing events created by async operations (e.g. bulk deletes, large add jobs).
|
||||
@@ -261,23 +304,15 @@ Verify your API connection and display the current project.
|
||||
mem0 status
|
||||
```
|
||||
|
||||
### `mem0 version`
|
||||
### `mem0 whoami`
|
||||
|
||||
Print the CLI version.
|
||||
Print the identity the CLI is currently using. After `mem0 init --agent`, the
|
||||
server issues an identifier (`default_user_id`, for example
|
||||
`user_a1b2c3d4e5f6`) and the CLI stores it in `~/.mem0/config.json`. That value
|
||||
is the agent's stable identity across runs, and it is the row key on the
|
||||
[AGENTRUSH leaderboard](https://mem0.ai/agentrush).
|
||||
|
||||
```bash
|
||||
mem0 version
|
||||
```
|
||||
|
||||
## Identity helper: `mem0 whoami`
|
||||
|
||||
After running `mem0 init --agent`, the CLI persists a server-issued identifier
|
||||
(`default_user_id`, e.g. `user_a1b2c3d4e5f6`) in `~/.mem0/config.json`. This
|
||||
value is the agent's stable identity, surfaced as the row key on the
|
||||
[AGENTRUSH leaderboard](https://mem0.ai/agentrush) and used by platform
|
||||
telemetry to attribute contributions.
|
||||
|
||||
Print it without parsing the config file by hand:
|
||||
Use this instead of parsing the config file by hand:
|
||||
|
||||
```bash
|
||||
mem0 whoami
|
||||
@@ -288,89 +323,47 @@ mem0 whoami
|
||||
No network call. The command exits with code `1` if no `default_user_id` is
|
||||
configured yet. In that case, run `mem0 init --agent` first.
|
||||
|
||||
## AGENTRUSH: `mem0 agent-rush <add | search>`
|
||||
### `mem0 identify`
|
||||
|
||||
AGENTRUSH is a 7-day public competition where AI agents (not humans) compete
|
||||
inside a single shared Mem0 project. Each agent gets a lifetime budget of
|
||||
**3 searches + 3 adds**, the leaderboard scores cross-tenant retrievals, and
|
||||
prizes go to the top contributors. See [mem0.ai/agentrush](https://mem0.ai/agentrush)
|
||||
for current event details.
|
||||
Attach an agent name to an account created with `mem0 init --agent`, if you did
|
||||
not pass `--agent-caller` at the time. It keeps the same API key and only fills
|
||||
in the name, so it is safe to run more than once. See
|
||||
[Sign up as an agent](/platform/agent-signup).
|
||||
|
||||
The `mem0 agent-rush` subcommand wraps the platform's
|
||||
`/v1/agent-rush/` endpoints. Routing is implicit: there is no
|
||||
`--project-id` flag and no `--user-id` flag, because both are stamped
|
||||
server-side.
|
||||
### `mem0 help`
|
||||
|
||||
### Bootstrap once, then play
|
||||
|
||||
```bash
|
||||
# 1. Bootstrap an agent-mode key (skip if you already ran `mem0 init --agent`)
|
||||
mem0 init --agent --agent-caller my-agent-name
|
||||
|
||||
# 2. Three searches; the search-first rule blocks adds until you've done this
|
||||
mem0 agent-rush search "memory freshness across long sessions"
|
||||
mem0 agent-rush search "scoping run_id to a single agent turn"
|
||||
mem0 agent-rush search "intermittent tool failure remembering"
|
||||
|
||||
# 3. Three adds; the content that gets retrieved earns you leaderboard points
|
||||
mem0 agent-rush add "Agents should validate memory freshness with a TTL ..."
|
||||
mem0 agent-rush add "Scoping memories by run_id avoids cross-session ..."
|
||||
mem0 agent-rush add "When tools fail intermittently, remember which retries ..."
|
||||
|
||||
# 4. Check your row
|
||||
mem0 whoami
|
||||
# Then visit https://mem0.ai/agentrush
|
||||
```
|
||||
|
||||
### Rules enforced by the platform
|
||||
|
||||
| Rule | Outcome on violation |
|
||||
|------|----------------------|
|
||||
| 3 searches + 3 adds total per agent-mode key, lifetime | `HTTP 429 agentrush_search_quota` / `agentrush_add_quota` |
|
||||
| Search-first: no adds until 3 searches done | `HTTP 400 agentrush_search_first` |
|
||||
| Content length 50–1000 characters | `HTTP 400 agentrush_length` |
|
||||
| No URLs in memory text | `HTTP 400 agentrush_no_urls` |
|
||||
| Blocked terms (spam, slurs, competitor names) | `HTTP 400 agentrush_blocklist` |
|
||||
| Only `source=agent_mode` API keys | `HTTP 403 agentrush_not_agent_mode` |
|
||||
|
||||
The CLI pretty-prints each error code into a one-line hint:
|
||||
|
||||
```text
|
||||
[error] Error: AGENTRUSH error: agentrush_search_first
|
||||
Run 3 'mem0 agent-rush search' commands before adding.
|
||||
```
|
||||
|
||||
### Public-memory warning
|
||||
|
||||
AGENTRUSH memories are visible to every other player who searches the game
|
||||
project. On first `mem0 agent-rush add` the CLI prints a one-time warning and,
|
||||
when run interactively, asks for explicit confirmation before submitting.
|
||||
**Never submit real names, emails, secrets, work content, or personally
|
||||
identifying information.** The acknowledgement is stored under
|
||||
`agent_rush.acknowledged_at` in `~/.mem0/config.json` so you are only asked
|
||||
once per machine.
|
||||
|
||||
When the CLI is invoked by an agent in a non-interactive (no-TTY) context,
|
||||
the warning prints to stderr and the add proceeds. Agents cannot answer
|
||||
y/N prompts. Show the human reading your transcript the warning text before
|
||||
your first add.
|
||||
Print the command tree. Adding `--json` returns the whole tree as structured
|
||||
data, so an agent can discover the available commands and options for itself.
|
||||
|
||||
## Output formats
|
||||
|
||||
All commands support the `--output` flag to control how results are displayed:
|
||||
Most commands take `-o, --output` to control how results are displayed. Not every command accepts every format:
|
||||
|
||||
| Format | Description |
|
||||
|--------|-------------|
|
||||
| `text` | Human-readable output with colors and formatting (default for most commands) |
|
||||
| `json` | Structured JSON, suitable for piping to `jq` or consumption by AI agents |
|
||||
| `table` | Tabular format (default for `list`) |
|
||||
| `quiet` | Minimal output: just IDs or status codes |
|
||||
| `agent` | Structured JSON envelope with sanitized fields, set automatically by `--json`/`--agent` |
|
||||
| Format | Description | Accepted by |
|
||||
|--------|-------------|-------------|
|
||||
| `text` | Human-readable output with colors and formatting. The default everywhere except `list` | every command |
|
||||
| `json` | Structured JSON, suitable for piping to `jq` | every command |
|
||||
| `table` | Tabular format, and the default for `list` | `search`, `list` |
|
||||
| `quiet` | Minimal output: just IDs or status codes | `add`, `update`, `delete` |
|
||||
|
||||
Example with JSON output:
|
||||
Passing a format a command does not accept is an error, so check the command's own flag table above.
|
||||
|
||||
There is no `agent` value for `--output`. Agent mode is turned on by the global `--json`/`--agent` flag placed before the command name, and it overrides `--output`. See [Use with AI agents](#use-with-ai-agents).
|
||||
|
||||
The exact JSON shape depends on the command. `search` returns a bare array of memories, while `list` returns an envelope object with the memories under `data`:
|
||||
|
||||
```bash
|
||||
mem0 search "user preferences" --user-id alice --output json | jq '.data.results[].memory'
|
||||
# search: results are the top-level array
|
||||
mem0 search "user preferences" --user-id alice --output json | jq '.[].memory'
|
||||
|
||||
# list: results are nested under .data
|
||||
mem0 list --user-id alice --output json | jq '.data[].memory'
|
||||
```
|
||||
|
||||
Agent mode always returns the envelope, whichever command you run, so `.data[]` works everywhere:
|
||||
|
||||
```bash
|
||||
mem0 --agent search "user preferences" --user-id alice | jq '.data[].memory'
|
||||
```
|
||||
|
||||
## Use with AI agents
|
||||
@@ -424,6 +417,22 @@ Two other agent-friendly features:
|
||||
|
||||
For non-interactive environments (CI, agent runtimes), set credentials via `mem0 init --api-key m0-xxx --user-id alice --force` or the `MEM0_API_KEY` environment variable.
|
||||
|
||||
## Errors and exit codes
|
||||
|
||||
Every command exits `0` when it succeeds and `1` when it fails, so `if mem0 ...; then` works as you would expect in a script. In agent mode (`--json` or `--agent`), failures still print a JSON envelope to stdout alongside the non-zero exit, so you can parse successes and failures the same way.
|
||||
|
||||
Errors you are most likely to hit:
|
||||
|
||||
| Message | Cause | Fix |
|
||||
|---------|-------|-----|
|
||||
| `Authentication failed` | The API key is missing, wrong, or revoked | Run `mem0 init` again, or get a new key from the dashboard |
|
||||
| `No content provided. Pass text, --messages, --file, or pipe via stdin.` | `mem0 add` was called with nothing to store | Give it text, a file, or piped input |
|
||||
| `Invalid JSON in --messages` / `--metadata` / `--filter` | The JSON value would not parse | Check the quoting, especially inside shell single quotes |
|
||||
| `Invalid date format for --expires. Use YYYY-MM-DD` | `--expires` got something other than a date | Use `YYYY-MM-DD`, and make sure the date is in the future |
|
||||
| `--threshold must be between 0.0 and 1.0.` | Score threshold out of range | Pass a value between `0.0` and `1.0` |
|
||||
|
||||
Run [`mem0 status`](#mem0-status) to check whether the CLI can reach the API and which project the key belongs to. It reports the connection state, the API URL, and any error.
|
||||
|
||||
## Environment variables
|
||||
|
||||
| Variable | Description |
|
||||
@@ -434,17 +443,28 @@ For non-interactive environments (CI, agent runtimes), set credentials via `mem0
|
||||
| `MEM0_AGENT_ID` | Default agent ID |
|
||||
| `MEM0_APP_ID` | Default app ID |
|
||||
| `MEM0_RUN_ID` | Default run ID |
|
||||
| `MEM0_TELEMETRY` | Set to `false` to turn off usage telemetry. On by default |
|
||||
|
||||
Environment variables take precedence over values in the config file, which take precedence over defaults.
|
||||
|
||||
## Global flags
|
||||
|
||||
These flags are available on all commands:
|
||||
These two flags belong to `mem0` itself, so they go **before** the command name:
|
||||
|
||||
| Flag | Description |
|
||||
|------|-------------|
|
||||
| `--json` | Enable agent mode: structured JSON envelope output, no colors or spinners |
|
||||
| `--agent` | Alias for `--json` |
|
||||
| `--version` | Print the CLI version and exit |
|
||||
|
||||
<Warning>
|
||||
On `init` only, `--agent` means something different. `mem0 init --agent` creates an Agent Mode account (see [Sign up as an agent](/platform/agent-signup)); it does not switch the output to JSON. To get JSON from `init`, put the flag first: `mem0 --json init`.
|
||||
</Warning>
|
||||
|
||||
The following flags are accepted by most commands, but they belong to the command, so they go **after** the command name:
|
||||
|
||||
| Flag | Description |
|
||||
|------|-------------|
|
||||
| `--api-key` | Override the configured API key for this request |
|
||||
| `--base-url` | Override the configured API base URL for this request |
|
||||
| `-o, --output` | Set the output format |
|
||||
@@ -456,11 +476,11 @@ These flags are available on all commands:
|
||||
Store your first memory in under five minutes using the SDK or CLI
|
||||
</Card>
|
||||
|
||||
<Card title="Memory Operations" icon="database" href="/core-concepts/memory-operations/add">
|
||||
<Card title="Memory operations" icon="database" href="/core-concepts/memory-operations/add">
|
||||
Learn about add, search, update, and delete operations in depth
|
||||
</Card>
|
||||
|
||||
<Card title="API Reference" icon="code" href="/api-reference/memory/add-memories">
|
||||
<Card title="API reference" icon="code" href="/api-reference/memory/add-memories">
|
||||
See the complete REST API documentation
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -17,7 +17,7 @@ iconType: "solid"
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="What are the key features of Mem0?">
|
||||
- **User, Session, and AI Agent Memory**: Retains information across sessions and interactions for users and AI agents, ensuring continuity and context.
|
||||
- **User, Agent, App, and Run Memory**: Scopes memories to the individual, AI agent, application, and conversation/session they belong to, ensuring continuity and context.
|
||||
- **Adaptive Personalization**: Continuously updates memories based on user interactions and feedback.
|
||||
- **Developer-Friendly API**: Offers a straightforward API for seamless integration into various applications.
|
||||
- **Platform Consistency**: Ensures consistent behavior and data across different platforms and devices.
|
||||
@@ -84,10 +84,12 @@ iconType: "solid"
|
||||
- Include specific examples or cases rather than general definitions
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="How do I configure Mem0 for AWS Lambda?">
|
||||
When deploying Mem0 on AWS Lambda, you'll need to modify the storage directory configuration due to Lambda's file system restrictions. By default, Lambda only allows writing to the `/tmp` directory.
|
||||
<Accordion title="How do I configure Mem0 for AWS Lambda? (self-hosted / OSS only)">
|
||||
This applies only if you are running the self-hosted OSS `Memory` class yourself (for example with a local vector store) inside a Lambda function. If you're using the hosted Mem0 Platform (`MemoryClient`), there is nothing to configure here: the Platform stores all memory data on Mem0's servers, not on your Lambda instance's filesystem, so Lambda's `/tmp`-only write restriction does not apply to you.
|
||||
|
||||
To configure Mem0 for AWS Lambda, set the `MEM0_DIR` environment variable to point to a writable directory in `/tmp`:
|
||||
When deploying self-hosted Mem0 on AWS Lambda, you'll need to modify the storage directory configuration due to Lambda's file system restrictions. By default, Lambda only allows writing to the `/tmp` directory.
|
||||
|
||||
To configure self-hosted Mem0 for AWS Lambda, set the `MEM0_DIR` environment variable to point to a writable directory in `/tmp`:
|
||||
|
||||
```bash
|
||||
MEM0_DIR=/tmp/.mem0
|
||||
@@ -149,7 +151,7 @@ iconType: "solid"
|
||||
2. Go to **Settings → Account**.
|
||||
3. Click **Delete account** and confirm.
|
||||
|
||||
Deletion is immediate and irreversible. The following is removed:
|
||||
Deletion is asynchronous: the request is accepted immediately and processed in the background, typically within a few minutes. Once it completes, the following is removed:
|
||||
|
||||
- Your user profile and login credentials
|
||||
- All memories, agents, and runs you created
|
||||
@@ -157,7 +159,7 @@ iconType: "solid"
|
||||
- Organizations you solely own, along with their data
|
||||
- Your membership in any shared organizations (the orgs themselves are not affected)
|
||||
|
||||
Any application still using your old API keys will start receiving `401 Unauthorized` responses immediately. If you'd like to use Mem0 again later, you can create a new account at any time: it will start fresh with no data carried over.
|
||||
Your old API keys stop working once deletion completes, not the instant you click confirm. If you'd like to use Mem0 again later, you can create a new account at any time: it will start fresh with no data carried over.
|
||||
</Accordion>
|
||||
|
||||
</AccordionGroup>
|
||||
|
||||
@@ -51,7 +51,7 @@ results = client.search(
|
||||
# Smart home assistant finding device preferences
|
||||
results = client.search(
|
||||
query="How do I like my bedroom temperature?",
|
||||
rerank=True, # Get most recent preferences first
|
||||
rerank=True, # Closest-matching preferences first
|
||||
filters={"user_id": "user123"},
|
||||
)
|
||||
|
||||
@@ -86,7 +86,7 @@ results = client.search(
|
||||
# Find learning progress for specific topics
|
||||
results = client.search(
|
||||
query="Python programming progress and difficulties",
|
||||
rerank=True, # Recent progress first
|
||||
rerank=True, # Closest-matching progress notes first
|
||||
filters={"user_id": "student123"},
|
||||
)
|
||||
|
||||
@@ -108,21 +108,13 @@ def quick_search(query, user_id):
|
||||
filters={"user_id": user_id},
|
||||
)
|
||||
|
||||
# Reranked search - good for most applications
|
||||
# Reranked search - good when result order matters
|
||||
def standard_search(query, user_id):
|
||||
return client.search(
|
||||
query=query,
|
||||
rerank=True,
|
||||
filters={"user_id": user_id},
|
||||
)
|
||||
|
||||
# Reranked search - good for critical applications
|
||||
def precise_search(query, user_id):
|
||||
return client.search(
|
||||
query=query,
|
||||
rerank=True,
|
||||
filters={"user_id": user_id},
|
||||
)
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
@@ -133,21 +125,13 @@ function quickSearch(query, userId) {
|
||||
});
|
||||
}
|
||||
|
||||
// Reranked search - good for most applications
|
||||
// Reranked search - good when result order matters
|
||||
function standardSearch(query, userId) {
|
||||
return client.search(query, {
|
||||
filters: { user_id: userId },
|
||||
rerank: true,
|
||||
});
|
||||
}
|
||||
|
||||
// Reranked search - good for critical applications
|
||||
function preciseSearch(query, userId) {
|
||||
return client.search(query, {
|
||||
filters: { user_id: userId },
|
||||
rerank: true,
|
||||
});
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ await client.search("What is Alice's favorite sport?", filters={"user_id": "alic
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
await client.search("What is Alice's favorite sport?", { filters: { userId: "alice" } });
|
||||
await client.search("What is Alice's favorite sport?", { filters: { user_id: "alice" } });
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
@@ -124,7 +124,7 @@ await client.deleteAll({ userId: "alice" });
|
||||
</CodeGroup>
|
||||
|
||||
<Note>
|
||||
At least one filter (`user_id`, `agent_id`, `app_id`, or `run_id`) is required: calling `delete_all` with no filters raises an error to prevent accidental data loss. You can pass `"*"` as a value to delete all memories for a given entity type (e.g., `user_id="*"` removes memories for every user). A full project wipe requires all four filters set to `"*"`.
|
||||
At least one filter (`user_id`, `agent_id`, `app_id`, or `run_id`) is required: calling `delete_all` with no filters raises an error to prevent accidental data loss. You can pass `"*"` as a value to delete all memories for a given entity type (e.g., `user_id="*"` removes memories for every user). A full project wipe requires all four filters set to `"*"`. When multiple entity filters are combined on a single `delete_all` call, only one is currently guaranteed to be honored; scope each call to a single entity id to be safe.
|
||||
</Note>
|
||||
|
||||
### History
|
||||
|
||||
@@ -75,6 +75,8 @@ print(response)
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
This "Updated custom categories" message is specific to a PATCH-style partial update, which is what `client.project.update()` sends. Calling the raw API with a full PUT instead returns a generic `{"message": "Project updated successfully."}`, regardless of which fields changed.
|
||||
|
||||
### 2. Confirm the active catalog
|
||||
|
||||
<CodeGroup>
|
||||
@@ -86,16 +88,19 @@ print(categories)
|
||||
|
||||
```json Output
|
||||
{
|
||||
"name": "default-project",
|
||||
"description": null,
|
||||
"custom_categories": [
|
||||
{"lifestyle_management_concerns": "Tracks daily routines, habits, hobbies and interests including cooking, time management and work-life balance"},
|
||||
{"seeking_structure": "Documents goals around creating routines, schedules, and organized systems in various life areas"},
|
||||
{"personal_information": "Basic information about the user including name, preferences, and personality traits"}
|
||||
]
|
||||
],
|
||||
"custom_instructions": null
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
`get` echoes back the shape you set. `update` also accepts a plain list of names, such as `["billing", "support"]`, in which case `get` returns that same list of names. Descriptions are optional here, and the classifier uses them to disambiguate when it has them.
|
||||
`project.get()` always returns the full project object, not just the fields you asked for. The `fields` parameter is accepted but has no filtering effect server-side, so read `custom_categories` off the full response. `update` also accepts a plain list of names, such as `["billing", "support"]`, in which case `custom_categories` comes back as that same list of names. Descriptions are optional here, and the classifier uses them to disambiguate when it has them.
|
||||
|
||||
<Warning>
|
||||
`add` is stricter than `update`. Every entry in a per-call `custom_categories` list must be an object mapping a name to a description. Passing bare names to `add` fails with `400 Expected a dictionary of items but got type "str"`.
|
||||
@@ -306,16 +311,19 @@ client.project.get(["custom_categories"])
|
||||
|
||||
```json Output
|
||||
{
|
||||
"custom_categories": null
|
||||
"name": "default-project",
|
||||
"description": null,
|
||||
"custom_categories": null,
|
||||
"custom_instructions": null
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
A project that has never set a list returns `null`. One you have reset with `project.update(custom_categories=[])` returns `[]`. Both mean the default catalog is active.
|
||||
The response is always the full project object; `["custom_categories"]` does not filter it down. A project that has never set a list returns `custom_categories: null`. One you have reset with `project.update(custom_categories=[])` returns `[]`. Both mean the default catalog is active.
|
||||
|
||||
## Verify the feature is working
|
||||
|
||||
- `client.project.get(["custom_categories"])` returns the category list you set.
|
||||
- `client.project.get(["custom_categories"])` returns the full project object; read the `custom_categories` key off it to see the list you set.
|
||||
- `client.get_all(filters={"user_id": ...})` shows populated `categories` lists on new memories.
|
||||
- The Mem0 dashboard (Project → Memories) displays the custom labels in the Category column.
|
||||
|
||||
|
||||
@@ -68,6 +68,8 @@ console.log(response.customInstructions);
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
`project.get()` always returns the full project object. The `fields` parameter is accepted but has no filtering effect server-side, so `response["custom_instructions"]` above is a key on the full response, not a pre-filtered payload.
|
||||
|
||||
### Best Practice Template
|
||||
|
||||
Structure your instructions using this proven template:
|
||||
|
||||
@@ -22,17 +22,35 @@ messages = [
|
||||
client.add(messages, user_id="alice", infer=False)
|
||||
```
|
||||
|
||||
```markdown Output
|
||||
[]
|
||||
```json Output
|
||||
{
|
||||
"message": "Memories stored successfully",
|
||||
"status": "SUCCEEDED",
|
||||
"event_id": "8c1f5e2b-3d47-4a9e-b6c1-5f2a7d3e9b04",
|
||||
"results": [
|
||||
{
|
||||
"id": "19d6d7aa-2454-4e58-96fc-e74d9e9f8dd1",
|
||||
"data": { "memory": "Alice loves playing badminton" },
|
||||
"event": "ADD"
|
||||
},
|
||||
{
|
||||
"id": "8557f05d-7b3c-47e5-b409-9886f9e314fc",
|
||||
"data": { "memory": "Alice mostly cooks at home because of her gym plan" },
|
||||
"event": "ADD"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
You can see that the output of the add call is an empty list.
|
||||
|
||||
<Note>Only messages with the role "user" will be used for storage. Messages with roles such as "assistant" or "system" will be ignored during the storage process.</Note>
|
||||
<Note>
|
||||
Direct import stores `"user"` and `"assistant"` messages alike, regardless of which entity ids you pass. Only `"system"` messages are dropped. Each surviving message becomes one memory, with its content stored verbatim.
|
||||
</Note>
|
||||
|
||||
<Warning>
|
||||
Direct import skips the inference pipeline, so it also skips duplicate detection. If you later send the same fact with `infer=True`, Mem0 will store a second copy. Pick one mode per memory source unless you truly want both versions.
|
||||
Direct import skips semantic duplicate detection: two different phrasings of the same fact will be stored as two separate memories. Exact repeats in the same scope are deduplicated by an exact hash of the text, so resending identical text is safe. Mixing `infer=False` and `infer=True` for the same fact can still produce two memories, since neither path checks the other for duplicates.
|
||||
|
||||
Direct import also does not support multimodal content (`image_url`, `pdf_url`, `txt_url`, `mdx_url`). Those messages are skipped without raising an error, so they are missing from `results` rather than reported as a failure. Pass plain string content only when `infer=False`.
|
||||
</Warning>
|
||||
|
||||
## How to Retrieve Memories
|
||||
|
||||
@@ -36,11 +36,11 @@ Call `client.project.get()` to verify your connection. It should return your pro
|
||||
| User | `user_id` | Persistent persona or account | `"customer_6412"` |
|
||||
| Agent | `agent_id` | Distinct agent persona or tool | `"meal_planner"` |
|
||||
| Application | `app_id` | White-label app or product surface | `"ios_retail_demo"` |
|
||||
| Session | `run_id` | Short-lived flow, ticket, or conversation thread | `"ticket-9241"` |
|
||||
| Run | `run_id` | Short-lived flow, ticket, or session thread | `"ticket-9241"` |
|
||||
|
||||
- **Writes** (`client.add`) accept any combination of these fields. Absent fields default to `null`.
|
||||
- **Reads** (`client.search`, `client.get_all`, exports, deletes) accept the same identifiers inside the `filters` JSON object.
|
||||
- **Implicit null scoping**: Passing only `{"user_id": "alice"}` automatically restricts results to records where `agent_id`, `app_id`, and `run_id` are `null`. Add wildcards (`"*"`), explicit lists, or additional filters when you need broader joins.
|
||||
- **Writes** (`client.add`) accept any combination of these fields. `app_id` and `run_id` are stored on every memory the call produces. `user_id` and `agent_id` behave differently on the default extraction path: each extracted fact is attributed to whoever stated it, so a record carries `user_id` or `agent_id`, not both. Absent fields default to `null`.
|
||||
- **Reads** (`client.search`, `client.get_all`, exports) accept the same identifiers inside the `filters` JSON object. Deletes (`client.delete_all`) scope via query parameters instead; the SDK builds these for you when you pass `user_id=...`, `run_id=...`, and so on.
|
||||
- **Unmentioned entities are not constrained**: Passing only `{"user_id": "alice"}` matches on `user_id` alone. It does not require `agent_id`, `app_id`, or `run_id` to be `null`, so records that also have those fields set are still returned.
|
||||
|
||||
<Warning>
|
||||
**Common Pitfall**: If you create a memory with `user_id="alice"` but the other fields default to `null`, then search with `{"AND": [{"user_id": "alice"}, {"agent_id": "bot"}]}` will return nothing because you're looking for a memory where `agent_id="bot"`, not `null`.
|
||||
@@ -78,7 +78,9 @@ client.add(
|
||||
The response will include one or more memory IDs. Check the dashboard → Memories to confirm the entry appears under the correct user, agent, app, and run.
|
||||
|
||||
<Warning>
|
||||
Platform writes that include both `user_id` and `agent_id` (or other combinations) are persisted as separate records per entity so we can enforce privacy boundaries. Each record carries exactly one primary entity, which is why `{"AND": [{"user_id": ...}, {"agent_id": ...}]}` never returns results. Plan searches per entity scope or combine scopes with `OR`.
|
||||
Passing both `user_id` and `agent_id` to `client.add` does **not** produce records with both fields set. On the default extraction path, each extracted fact is attributed to the speaker who stated it: facts from `user` messages are stored with `user_id` set and `agent_id` null, facts from `assistant` messages with `agent_id` set and `user_id` null. `app_id` and `run_id` are carried on every record either way.
|
||||
|
||||
As a result, `{"AND": [{"user_id": ...}, {"agent_id": ...}]}` returns nothing for memories created this way. Use `OR` to match either scope. Records with both fields populated only come from [Direct Import](/platform/features/direct-import) (`infer=False`), which writes your text verbatim without attribution splitting.
|
||||
</Warning>
|
||||
|
||||
The HTTP equivalent uses `POST /v1/memories/` with the same identifiers in the JSON body. See the Add Memories API reference for REST details.
|
||||
@@ -130,7 +132,7 @@ print(agent_results)
|
||||
```
|
||||
|
||||
<Tip icon="compass">
|
||||
Writes can include multiple identifiers, but searches resolve one entity space at a time. Query user scope *or* agent scope in a given call: combining both returns an empty list today.
|
||||
A search that `AND`s `user_id` **and** `agent_id` only matches records that have both fields set, which the default extraction path never produces. Use `OR` when you want either scope to match on its own.
|
||||
</Tip>
|
||||
|
||||
<Tip icon="sparkles">
|
||||
@@ -141,11 +143,11 @@ Want to experiment with AND/OR logic, nested operators, or wildcards? The <Link
|
||||
```python
|
||||
app_scope = {
|
||||
"AND": [
|
||||
{"app_id": "concierge_portal"}
|
||||
],
|
||||
"OR": [
|
||||
{"user_id": "*"},
|
||||
{"agent_id": "*"}
|
||||
{"app_id": "concierge_portal"},
|
||||
{"OR": [
|
||||
{"user_id": "*"},
|
||||
{"agent_id": "*"}
|
||||
]}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ Handle potential errors when submitting feedback:
|
||||
|
||||
```python Python
|
||||
from mem0 import MemoryClient
|
||||
from mem0.exceptions import MemoryNotFoundError, NetworkError
|
||||
from mem0.exceptions import MemoryError, ValidationError
|
||||
|
||||
client = MemoryClient(api_key="your_api_key")
|
||||
|
||||
@@ -161,12 +161,10 @@ try:
|
||||
feedback_reason="Helpful context for user query"
|
||||
)
|
||||
print("Feedback submitted successfully")
|
||||
except MemoryNotFoundError:
|
||||
print("Memory not found")
|
||||
except NetworkError as e:
|
||||
print(f"Network error: {e}")
|
||||
except Exception as e:
|
||||
print(f"Unexpected error: {e}")
|
||||
except ValidationError:
|
||||
print("memory_id is not a valid UUID")
|
||||
except MemoryError as e:
|
||||
print(f"memory_id was not found or not accessible ({e.error_code})")
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
@@ -182,16 +180,23 @@ try {
|
||||
});
|
||||
console.log("Feedback submitted successfully");
|
||||
} catch (error) {
|
||||
if (error.status === 404) {
|
||||
console.log("Memory not found");
|
||||
if (error.errorCode === "HTTP_400") {
|
||||
console.log("memory_id is not a valid UUID");
|
||||
} else if (error.errorCode === "HTTP_500") {
|
||||
console.log("Server error - the memory_id may not exist or be inaccessible, or it may be transient; retry if it persists");
|
||||
} else {
|
||||
console.log(`Error: ${error.message}`);
|
||||
console.log(`Unexpected error: ${error.message}`);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
### Handling an unknown or malformed `memory_id`
|
||||
|
||||
- A malformed `memory_id` (not a valid UUID) returns a clean `400` with `{"error": "Invalid memory_id"}`.
|
||||
- A well-formed but non-existent `memory_id` (or one that doesn't belong to your org or project) currently returns a `500 Internal Server Error` instead of a `404`. This is a server-side bug being tracked in [MEM-5745](https://linear.app/mem0/issue/MEM-5745). A `5xx` can also be a transient server error, so don't treat it as a definitive "not found"; to avoid the case entirely, only call `feedback` with a `memory_id` you just read from a `get_all` or `search` response.
|
||||
|
||||
## Feedback Analytics
|
||||
|
||||
Track the impact of your feedback by monitoring memory performance over time. Consider implementing:
|
||||
|
||||
@@ -90,7 +90,7 @@ results = client.search(
|
||||
Earlier versions of Mem0 offered graph memory by connecting an **external graph database** (Neo4j, Memgraph, Kuzu, Apache AGE, or Neptune) through an `enable_graph` flag and a `graph_store` configuration block. That integration has been replaced by **native, built-in Graph Memory**:
|
||||
|
||||
- **No external graph store.** The graph is built inside Mem0 from your memories. There is nothing to provision or connect.
|
||||
- **Always on, all plans.** The `enable_graph` flag is no longer needed; Graph Memory is automatic. (If you still send the parameter, it is ignored.)
|
||||
- **Always on, all plans.** The `enable_graph` flag is no longer needed: Graph Memory is automatic, and `relations` is always an empty list regardless of whether you send it. On non-paginated `get_all` (v1.1 format), sending `enable_graph=True` still adds an empty `"relations": []` key to the response for backward compatibility; it does not restore the old graph behavior.
|
||||
- **Connections power retrieval directly.** Entity connections are folded into the combined `score` on each result. The standalone `relations` field that the external graph store returned is no longer populated. If your application read that field, see the migration guide below.
|
||||
|
||||
<Card title="Platform Migration Guide" icon="arrow-right" href="/migration/platform-v2-to-v3">
|
||||
|
||||
@@ -1,45 +1,33 @@
|
||||
---
|
||||
title: Group Chat
|
||||
description: 'Enable multi-participant conversations with automatic memory attribution to individual speakers'
|
||||
description: 'Enable multi-participant conversations and scope each speaker with user_id or agent_id'
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
The Group Chat feature enables Mem0 to process conversations involving multiple participants and automatically attribute memories to individual speakers. This allows for precise tracking of each participant's preferences, characteristics, and contributions in collaborative discussions, team meetings, or multi-agent conversations.
|
||||
The Group Chat feature helps you use Mem0 with conversations involving multiple participants, such as team meetings or multi-agent conversations. You control which speaker a memory belongs to by scoping each `add()` call with `user_id`, `agent_id`, and `run_id`; Mem0 does not infer that scope automatically from the conversation.
|
||||
|
||||
When you provide messages with participant names, Mem0 automatically:
|
||||
- Extracts memories from each participant's messages separately
|
||||
- Attributes each memory to the correct speaker using their name as the `user_id` or `agent_id`
|
||||
- Maintains individual memory profiles for each participant
|
||||
When you scope conversations correctly, Mem0:
|
||||
- Extracts memories from each participant's messages
|
||||
- Keeps each participant's memories in a separate profile, addressed by the `user_id` or `agent_id` you assigned them
|
||||
- Lets you retrieve any participant's memories independently using filters
|
||||
|
||||
## How Group Chat Works
|
||||
|
||||
Mem0 automatically detects group chat scenarios when messages contain a `name` field:
|
||||
Mem0 does not automatically split a multi-participant conversation into separate memories per speaker. A `name` field on a message is stored as context for extraction, but it does not change which `user_id` or `agent_id` the resulting memories are scoped to: that scope is always whatever `user_id`, `agent_id`, or `run_id` you pass to `add()`.
|
||||
|
||||
```json
|
||||
{
|
||||
"role": "user",
|
||||
"name": "Alice",
|
||||
"content": "Hey team, I think we should use React for the frontend"
|
||||
}
|
||||
```
|
||||
|
||||
When names are present, Mem0:
|
||||
- Formats messages as `"Alice (user): content"` for processing
|
||||
- Extracts memories with proper attribution to each speaker
|
||||
- Stores memories with the speaker's name as the `user_id` (for users) or `agent_id` (for assistants/agents)
|
||||
To keep separate memory profiles per participant, scope each participant's messages explicitly: call `add()` once per participant with their own `user_id`, or use `run_id` to group the conversation and filter by participant in your own message metadata.
|
||||
|
||||
### Memory Attribution Rules
|
||||
|
||||
- **User Messages**: The `name` field becomes the `user_id` in stored memories
|
||||
- **Assistant/Agent Messages**: The `name` field becomes the `agent_id` in stored memories
|
||||
- **Messages without names**: Fall back to standard processing using role as identifier
|
||||
- Memories are always scoped to the `user_id`, `agent_id`, and `run_id` you pass to `add()`, not to the `name` field on individual messages.
|
||||
- If you need per-participant memories, call `add()` separately for each participant's messages with that participant's `user_id`.
|
||||
|
||||
## Using Group Chat
|
||||
|
||||
### Basic Group Chat
|
||||
|
||||
Add memories from a multi-participant conversation:
|
||||
Scope each participant's messages with their own `user_id` and a shared `run_id` for the session. Call `add()` once per participant:
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
@@ -48,46 +36,60 @@ from mem0 import MemoryClient
|
||||
|
||||
client = MemoryClient(api_key="your-api-key")
|
||||
|
||||
# Group chat with multiple users
|
||||
messages = [
|
||||
{"role": "user", "name": "Alice", "content": "Hey team, I think we should use React for the frontend"},
|
||||
{"role": "user", "name": "Bob", "content": "I disagree, Vue.js would be better for our use case"},
|
||||
{"role": "user", "name": "Charlie", "content": "What about considering Angular? It has great enterprise support"},
|
||||
{"role": "assistant", "content": "All three frameworks have their merits. Let me summarize the pros and cons of each."}
|
||||
]
|
||||
|
||||
# Each participant gets their own user_id; run_id ties them to one session
|
||||
client.add(
|
||||
[{"role": "user", "content": "Hey team, I think we should use React for the frontend"}],
|
||||
user_id="alice", run_id="group_chat_1",
|
||||
)
|
||||
client.add(
|
||||
[{"role": "user", "content": "I'd prefer Vue.js for our use case"}],
|
||||
user_id="bob", run_id="group_chat_1",
|
||||
)
|
||||
response = client.add(
|
||||
messages,
|
||||
run_id="group_chat_1",
|
||||
infer=True
|
||||
[{"role": "user", "content": "Consider Angular, it has great enterprise support"}],
|
||||
user_id="charlie", run_id="group_chat_1",
|
||||
)
|
||||
print(response)
|
||||
```
|
||||
|
||||
```json Output
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"id": "4d82478a-8d50-47e6-9324-1f65efff5829",
|
||||
"event": "ADD",
|
||||
"memory": "prefers using React for the frontend"
|
||||
},
|
||||
{
|
||||
"id": "1d8b8f39-7b17-4d18-8632-ab1c64fa35b9",
|
||||
"event": "ADD",
|
||||
"memory": "prefers Vue.js for our use case"
|
||||
},
|
||||
{
|
||||
"id": "147559a8-c5f7-44d0-9418-91f53f7a89a4",
|
||||
"event": "ADD",
|
||||
"memory": "suggests considering Angular because it has great enterprise support"
|
||||
}
|
||||
]
|
||||
"event_id": "4d82478a-8d50-47e6-9324-1f65efff5829",
|
||||
"status": "PENDING"
|
||||
}
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
`add()` is asynchronous: it queues extraction and returns immediately. Poll `get_all` (see below) once processing completes to see the extracted memories. Each participant's memory is scoped to the `user_id` you passed, so filtering by `run_id` returns all three, and filtering by a single `user_id` returns just that participant.
|
||||
|
||||
### The `name` field does not change scope
|
||||
|
||||
The `name` field is stored as extraction context only. Attribution follows the `user_id`/`agent_id`/`run_id` you pass to `add()`, never the `name`. Passing two different names in one `add()` call does **not** split the memories across two profiles:
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
```python Python
|
||||
# BOTH messages are scoped to user_id="team_session", NOT to "alice"/"bob"
|
||||
client.add(
|
||||
[
|
||||
{"role": "user", "name": "Alice", "content": "I strongly prefer React"},
|
||||
{"role": "user", "name": "Bob", "content": "I strongly prefer Vue"},
|
||||
],
|
||||
user_id="team_session", run_id="group_chat_2",
|
||||
)
|
||||
|
||||
# Every extracted memory lands under user_id="team_session"
|
||||
client.get_all(filters={"AND": [{"user_id": "team_session"}]})
|
||||
|
||||
# Nothing is stored under user_id="alice" or user_id="bob"
|
||||
client.get_all(filters={"AND": [{"user_id": "alice"}]}) # -> no results from this call
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
To keep Alice's and Bob's memories in separate profiles, call `add()` once per participant with their own `user_id`, as shown in [Basic Group Chat](#basic-group-chat) above.
|
||||
|
||||
## Retrieving Group Chat Memories
|
||||
|
||||
### Get All Memories for a Session
|
||||
@@ -224,33 +226,15 @@ print(search_response)
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
## Async Mode Support
|
||||
|
||||
Group chat supports async processing for improved performance. Memory additions are processed asynchronously by default.
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
```python Python
|
||||
# Group chat: async processing is the default
|
||||
response = client.add(
|
||||
messages,
|
||||
run_id="groupchat_async",
|
||||
infer=True,
|
||||
)
|
||||
print(response)
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
## Message Format Requirements
|
||||
|
||||
### Required Fields
|
||||
|
||||
Each message in a group chat must include:
|
||||
Each message must include:
|
||||
|
||||
- `role`: The participant's role (`"user"`, `"assistant"`, `"agent"`)
|
||||
- `content`: The message content
|
||||
- `name`: The participant's name (required for group chat detection)
|
||||
- `name` (optional): The participant's name, stored as context for extraction. It does not change which `user_id` or `agent_id` a memory is scoped to.
|
||||
|
||||
### Example Message Structure
|
||||
|
||||
@@ -261,14 +245,14 @@ Each message in a group chat must include:
|
||||
"content": "I think we should use React for the frontend"
|
||||
}
|
||||
```
|
||||
### Supported Roles
|
||||
### Roles
|
||||
|
||||
- **`user`**: Human participants (memories stored with `user_id`)
|
||||
- **`assistant`**: AI assistants (memories stored with `agent_id`)
|
||||
- **`user`**: Human participants
|
||||
- **`assistant`**: AI assistants
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Consistent Naming**: Use consistent names for participants across sessions to maintain proper memory attribution.
|
||||
1. **Consistent Scoping**: Use a consistent `user_id` (or `agent_id`) per participant across sessions so their memories stay in one profile.
|
||||
|
||||
2. **Clear Role Assignment**: Ensure each participant has the correct role (`user`, `assistant`, or `agent`) for proper memory categorization.
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ At search time the pipeline:
|
||||
5. Truncates to the `top_k` you requested.
|
||||
6. Records a fire-and-forget reinforcement against each returned memory: its access history grows by one, capped at the most recent 20 touches.
|
||||
|
||||
Memories created before decay was enabled don't yet have an access history. They use a sensible fallback: their `updated_at` is treated as a single past touch, so the same scale above applies based on how stale that update is: a recently-updated legacy memory enters near the neutral band, a long-stale one sits closer to the floor. Once surfaced in a search after decay is on, they accumulate access history naturally and behave like any other memory.
|
||||
Memories created before decay was enabled don't yet have an access history. They use a sensible fallback: a memory's `event_date` (if it has one) is treated as its single past touch; only when `event_date` is absent does `updated_at` stand in instead. A future `event_date` gets a fresh/full activation, a past one decays from when the event happened. Once surfaced in a search after decay is on, they accumulate access history naturally and behave like any other memory.
|
||||
|
||||
## Configure access
|
||||
|
||||
@@ -81,26 +81,26 @@ curl -X PATCH https://api.mem0.ai/api/v1/orgs/organizations/$ORG_ID/projects/$PR
|
||||
|
||||
### 2. Confirm the state
|
||||
|
||||
`decay` is returned on every project read. To fetch only this field, use `?fields=decay`.
|
||||
`decay` is returned on every project read; there is currently no way to narrow the response to just this field, so read the full project object and pick out `decay`.
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
response = client.project.get(fields=["decay"])
|
||||
response = client.project.get()
|
||||
print(response["decay"])
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
const response = await client.project.get({ fields: ["decay"] });
|
||||
const response = await client.project.get();
|
||||
console.log(response.decay);
|
||||
```
|
||||
|
||||
```bash cURL
|
||||
curl "https://api.mem0.ai/api/v1/orgs/organizations/$ORG_ID/projects/$PROJECT_ID/?fields=decay" \
|
||||
curl "https://api.mem0.ai/api/v1/orgs/organizations/$ORG_ID/projects/$PROJECT_ID/" \
|
||||
-H "Authorization: Token $MEM0_API_KEY"
|
||||
```
|
||||
|
||||
```json Response
|
||||
{ "decay": true }
|
||||
{ "decay": true, "...": "full project object" }
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -154,7 +154,7 @@ curl -X PATCH https://api.mem0.ai/api/v1/orgs/organizations/$ORG_ID/projects/$PR
|
||||
| Reinforced on a recent search | 1.2 – 1.5× | Sustains its boost for the next several searches. |
|
||||
| Idle for a few days | 0.6 – 1.0× | Falls back into the neutral band. |
|
||||
| Idle for weeks | 0.4 – 0.6× | Mild dampening: can still surface for strong matches. |
|
||||
| Pre-decay legacy memory (no access history) | 0.3 – 1.0× | Falls back to `updated_at`: recently-updated entries land near 1.0×, long-stale entries approach the 0.3× floor. |
|
||||
| Pre-decay legacy memory (no access history) | 0.3 – 1.0× | Falls back to `event_date` if set (future dates land near 1.0×, past dates decay from the event); falls back further to `updated_at` only when `event_date` is absent. |
|
||||
|
||||
The reinforcement is bounded: each memory tracks at most the last 20 access timestamps, so the boost stays well-behaved no matter how many times a memory is retrieved.
|
||||
|
||||
@@ -170,7 +170,7 @@ The threshold is applied to the candidate pool pre-decay; the scaling factor the
|
||||
No. The `client.add(...)` path is unchanged. Decay is a search-time ranking adjustment.
|
||||
|
||||
**What if I had memories before turning decay on?**
|
||||
They use a fallback: the memory's `updated_at` is treated as a single historical touch, so the same scaling applies based on how stale that update is: a recently-updated legacy memory enters near the neutral band (~1.0×), a long-stale one closer to the floor (~0.3×). Once retrieved they accumulate access history and behave like any other memory.
|
||||
They use a fallback: a memory's `event_date`, if it has one, is treated as its single historical touch; `updated_at` only stands in when `event_date` is absent. A memory with a future `event_date` enters near the neutral band (~1.0×); one with a past `event_date` decays from when the event happened, closer to the floor (~0.3×) the further back it is. Once retrieved they accumulate access history and behave like any other memory.
|
||||
|
||||
**Can I tune how aggressively decay scales scores?**
|
||||
Not in this version. The current scaling is calibrated to be conservative: wide enough to meaningfully reorder candidates, narrow enough to never dominate the underlying relevance score. Per-project tuning is on the roadmap.
|
||||
|
||||
@@ -141,7 +141,7 @@ console.log(responseWithInstructions);
|
||||
```
|
||||
|
||||
```bash cURL
|
||||
curl -X POST "https://api.mem0.ai/v1/memories/export/" \
|
||||
curl -X POST "https://api.mem0.ai/v1/exports/" \
|
||||
-H "Authorization: Token your-api-key" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
@@ -185,6 +185,13 @@ const response = await client.getMemoryExport({
|
||||
console.log(response);
|
||||
```
|
||||
|
||||
```bash cURL
|
||||
curl -X POST "https://api.mem0.ai/v1/exports/get/" \
|
||||
-H "Authorization: Token your-api-key" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"memory_export_id": "550e8400-e29b-41d4-a716-446655440000"}'
|
||||
```
|
||||
|
||||
```json Output
|
||||
{
|
||||
"full_name": "John Doe",
|
||||
@@ -231,6 +238,20 @@ const response = await client.getMemoryExport({
|
||||
console.log(response);
|
||||
```
|
||||
|
||||
```bash cURL
|
||||
curl -X POST "https://api.mem0.ai/v1/exports/get/" \
|
||||
-H "Authorization: Token your-api-key" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"filters": {
|
||||
"AND": [
|
||||
{"created_at": {"gte": "2024-07-10", "lte": "2024-07-20"}},
|
||||
{"user_id": "alex"}
|
||||
]
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
```json Output
|
||||
{
|
||||
"full_name": "John Doe",
|
||||
|
||||
@@ -9,6 +9,10 @@ Mem0 extends its capabilities beyond text by supporting multimodal data, includi
|
||||
|
||||
When a user submits an image or document, Mem0 processes it to extract textual information and other pertinent details. These details are then added to the user's memory, enhancing the system's ability to understand and recall multimodal inputs.
|
||||
|
||||
<Warning>
|
||||
Multimodal content (`image_url`, `pdf_url`, `txt_url`, `mdx_url`) requires the default `infer=True`. Do not combine structured multimodal `content` with `infer=False` (Direct Import): the Direct Import path expects plain-text `content` and rejects structured multimodal messages with a `400`.
|
||||
</Warning>
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
import os
|
||||
@@ -172,20 +176,18 @@ await client.add([imageMessage], { userId: "alice" })
|
||||
|
||||
### 2. Text Documents (MDX/TXT)
|
||||
|
||||
Mem0 supports both online and local text documents in MDX or TXT format.
|
||||
Mem0 supports both online and local text documents in MDX or TXT format. Use `"type": "mdx_url"` for Markdown/MDX content and `"type": "txt_url"` for plain text; both accept the same shape (`{"url": ...}`, either an HTTP(S) URL or a base64-encoded string).
|
||||
|
||||
#### Using a Document URL
|
||||
|
||||
```python
|
||||
# Define the document URL
|
||||
document_url = "https://www.w3.org/TR/2003/REC-PNG-20031110/iso_8859-1.txt"
|
||||
|
||||
# Create the message dictionary with the document URL
|
||||
document_message = {
|
||||
"role": "user",
|
||||
"content": {
|
||||
"type": "mdx_url",
|
||||
"mdx_url": {
|
||||
"type": "txt_url",
|
||||
"txt_url": {
|
||||
"url": document_url
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,24 +51,22 @@ Temporal Reasoning is enabled by default for all v3 searches and writes. There i
|
||||
|
||||
Two parameters give you precise control when you need it:
|
||||
|
||||
- `timestamp` on `add()`: anchors an imported memory to the time it actually happened, rather than the time it was added to Mem0
|
||||
- `observation_date` (or `observation_datetime`, which takes priority when both are set) on `add()`: anchors an imported memory to the time it actually happened. Pair with `timezone` when resolving a date-only value.
|
||||
- `timestamp` on `add()`: a Unix epoch that sets the memory's creation time. When present it takes priority over `observation_datetime` and `observation_date` as the anchor Temporal Reasoning ranks against, so pass only the one you want to win.
|
||||
- `reference_date` on `search()`: resolves relative phrases like `last week` against a fixed point in time
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
from datetime import datetime, timezone
|
||||
from mem0 import MemoryClient
|
||||
|
||||
client = MemoryClient(api_key="your-api-key")
|
||||
|
||||
# Import a historical memory anchored to when it happened
|
||||
client.add(
|
||||
[{"role": "user", "content": "I finished the Q1 review on March 10, 2025."}],
|
||||
user_id="jordan",
|
||||
timestamp=int(datetime(2025, 3, 10, tzinfo=timezone.utc).timestamp()),
|
||||
observation_date="2025-03-10",
|
||||
)
|
||||
|
||||
# Search with a relative query anchored to a known date
|
||||
results = client.search(
|
||||
"what did I do last week?",
|
||||
filters={"user_id": "jordan"},
|
||||
@@ -81,16 +79,14 @@ import { MemoryClient } from "mem0ai";
|
||||
|
||||
const client = new MemoryClient({ apiKey: "your-api-key" });
|
||||
|
||||
// Import a historical memory anchored to when it happened
|
||||
await client.add(
|
||||
[{ role: "user", content: "I finished the Q1 review on March 10, 2025." }],
|
||||
{
|
||||
userId: "jordan",
|
||||
timestamp: Math.floor(new Date("2025-03-10T00:00:00Z").getTime() / 1000),
|
||||
observationDate: "2025-03-10",
|
||||
}
|
||||
);
|
||||
|
||||
// Search with a relative query anchored to a known date
|
||||
const results = await client.search("what did I do last week?", {
|
||||
filters: { user_id: "jordan" },
|
||||
referenceDate: "2025-03-21T00:00:00Z",
|
||||
@@ -131,7 +127,7 @@ const results = await client.search("what did I do last week?", {
|
||||
## Best practices
|
||||
|
||||
- Use explicit dates in source conversations when events or plans matter temporally.
|
||||
- Pass `timestamp` during historical imports so the ingestion time does not become the only time anchor.
|
||||
- Pass `observation_date` (or `observation_datetime`) during historical imports so the ingestion time does not become the only time anchor. Do not also pass `timestamp` on those calls, since it overrides both as the ranking anchor.
|
||||
- Scope searches with `filters` so time-aware ranking operates inside the right user boundary.
|
||||
- Use `reference_date` in automated tests and reproducible demos.
|
||||
|
||||
|
||||
@@ -49,9 +49,9 @@ Filters use a nested JSON structure with logical operators at the root:
|
||||
### Content fields
|
||||
| Field | Operators | Example |
|
||||
|-------|-----------|---------|
|
||||
| `categories` | `eq`, `ne`, `in`, `contains` | `{"categories": {"in": ["finance"]}}` |
|
||||
| `categories` | `eq`, `ne`, `in` (matches any category in the list), `contains` (case-insensitive) | `{"categories": {"in": ["finance"]}}` |
|
||||
| `metadata` | `eq`, `ne`, `contains` | `{"metadata": {"key": "value"}}` |
|
||||
| `keywords` | `contains`, `icontains` | `{"keywords": {"icontains": "invoice"}}` |
|
||||
| `keywords` | `contains` (case-sensitive), `icontains` (case-insensitive) | `{"keywords": {"icontains": "invoice"}}` |
|
||||
|
||||
### Special fields
|
||||
| Field | Operators | Example |
|
||||
@@ -120,24 +120,23 @@ filters = {
|
||||
Find memories containing specific text, categories, or metadata values.
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Text search">
|
||||
<Accordion title="Text search (keywords)">
|
||||
```python
|
||||
# Case-insensitive match
|
||||
# Substring match on memory text via get_all
|
||||
filters = {
|
||||
"AND": [
|
||||
{"user_id": "user_123"},
|
||||
{"keywords": {"icontains": "pizza"}}
|
||||
]
|
||||
}
|
||||
|
||||
# Case-sensitive match
|
||||
filters = {
|
||||
"AND": [
|
||||
{"user_id": "user_123"},
|
||||
{"keywords": {"contains": "Invoice_2024"}}
|
||||
{"keywords": {"icontains": "invoice"}}
|
||||
]
|
||||
}
|
||||
memories = client.get_all(filters=filters)
|
||||
```
|
||||
|
||||
Use `contains` for case-sensitive matching and `icontains` for case-insensitive.
|
||||
|
||||
<Callout type="warning" icon="exclamation-triangle" color="#E74C3C">
|
||||
A `keywords` filter works on `get_all`, but passing it to `search()` currently returns a `500` ([MEM-5746](https://linear.app/mem0/issue/MEM-5746)). For text relevance during a search, pass the text to the `query` argument instead of filtering on `keywords`.
|
||||
</Callout>
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Categories">
|
||||
@@ -254,10 +253,8 @@ Combine various filters for complex queries across different dimensions.
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="All entities populated (single entity scope)">
|
||||
<Accordion title="All entities populated">
|
||||
```python
|
||||
# Require user_id plus non-null run/app IDs
|
||||
# (Memories are stored separately per entity, so scope one dimension at a time.)
|
||||
filters = {
|
||||
"AND": [
|
||||
{"user_id": "user_123"},
|
||||
@@ -266,6 +263,7 @@ Combine various filters for complex queries across different dimensions.
|
||||
]
|
||||
}
|
||||
```
|
||||
Matches records where `user_id` equals `user_123` and `run_id`/`app_id` are both non-null. It does not require other entity fields to be null.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
@@ -276,16 +274,16 @@ Level up foundational patterns with compound filters that coordinate entity scop
|
||||
<AccordionGroup>
|
||||
<Accordion title="Multi-dimensional filtering">
|
||||
```python
|
||||
# Invoice memories in Q1 2024
|
||||
filters = {
|
||||
"AND": [
|
||||
{"user_id": "user_123"},
|
||||
{"keywords": {"icontains": "invoice"}},
|
||||
{"categories": {"in": ["finance"]}},
|
||||
{"keywords": {"icontains": "invoice"}},
|
||||
{"created_at": {"gte": "2024-01-01T00:00:00Z"}},
|
||||
{"created_at": {"lt": "2024-04-01T00:00:00Z"}}
|
||||
]
|
||||
}
|
||||
memories = client.get_all(filters=filters)
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
@@ -330,7 +328,7 @@ Level up foundational patterns with compound filters that coordinate entity scop
|
||||
## Best practices
|
||||
|
||||
<Callout type="tip" icon="lightbulb" color="#26A17B">
|
||||
The root must be `AND`, `OR`, or `NOT` with an array of conditions.
|
||||
The root does not have to be `AND`, `OR`, or `NOT`. A bare filter like `{"user_id": "alice"}` works on its own; wrap conditions in a logical operator only when you need to combine more than one.
|
||||
</Callout>
|
||||
|
||||
<Callout type="tip" icon="lightbulb" color="#26A17B">
|
||||
@@ -338,7 +336,9 @@ Use `"*"` to match any non-null value for a field.
|
||||
</Callout>
|
||||
|
||||
<Callout type="warning" icon="exclamation-triangle" color="#E74C3C">
|
||||
Memories are stored per-entity (user, agent, app, run). Combining `user_id` **and** `agent_id` in the same `AND` clause returns no results because no record contains both values at once. Query one entity scope at a time or use `OR` logic for parallel lookups.
|
||||
Combining `user_id` **and** `agent_id` in the same `AND` clause only returns records that have both values set. Memories created by a normal `client.add` never do: each extracted fact is attributed to its speaker, so it carries `user_id` or `agent_id`, not both. Use `OR` to match either scope. Only [Direct Import](/platform/features/direct-import) (`infer=False`) writes both fields on one record.
|
||||
|
||||
A filter object with both an `AND` key and a sibling `OR` key at the same level silently drops the `OR` branch today. Nest the `OR` inside the `AND` array instead of placing them as siblings.
|
||||
</Callout>
|
||||
|
||||
## Troubleshooting
|
||||
@@ -347,7 +347,7 @@ Memories are stored per-entity (user, agent, app, run). Combining `user_id` **an
|
||||
<Accordion title="Missing results with agent_id">
|
||||
**Problem**: Filtered by `user_id` but don't see agent memories.
|
||||
|
||||
**Solution**: User and agent memories are stored as separate records. Use OR to query both scopes:
|
||||
**Solution**: A `user_id` filter only matches records that have that `user_id` set; it won't surface memories written with only `agent_id`. Use OR to query both scopes:
|
||||
```python
|
||||
{"OR": [{"user_id": "user_123"}, {"agent_id": "agent_name"}]}
|
||||
```
|
||||
@@ -362,8 +362,12 @@ Memories are stored per-entity (user, agent, app, run). Combining `user_id` **an
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Case-insensitive search">
|
||||
**Solution**: Swap to `icontains` to normalize casing.
|
||||
<Accordion title="Case-insensitive text match">
|
||||
**Solution**: Use `keywords` with `icontains` on `get_all`:
|
||||
```python
|
||||
{"AND": [{"user_id": "user_123"}, {"keywords": {"icontains": "invoice"}}]}
|
||||
```
|
||||
This works on `get_all`. It is not supported on `search()` yet (returns a `500`, [MEM-5746](https://linear.app/mem0/issue/MEM-5746)) - for search, pass the text to the `query` argument instead.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Date range between two dates">
|
||||
@@ -388,7 +392,7 @@ Memories are stored per-entity (user, agent, app, run). Combining `user_id` **an
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Do I need AND/OR/NOT?">
|
||||
Yes. The root must be a logical operator with an array.
|
||||
No. A bare filter like `{"user_id": "u1"}` works on its own. Add `AND`, `OR`, or `NOT` only when you need to combine more than one condition.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="What does * match?">
|
||||
@@ -408,7 +412,7 @@ Memories are stored per-entity (user, agent, app, run). Combining `user_id` **an
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="How to search text?">
|
||||
Use `keywords` with `contains` (case-sensitive) or `icontains` (case-insensitive).
|
||||
For a substring match, use the `keywords` filter with `contains`/`icontains` on `get_all`. For relevance-ranked search, pass the text to the `query` argument on `search()`. Note: `keywords` is not supported inside `search()` filters yet (returns a `500`, [MEM-5746](https://linear.app/mem0/issue/MEM-5746)).
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Can I nest AND/OR?">
|
||||
@@ -428,6 +432,6 @@ Memories are stored per-entity (user, agent, app, run). Combining `user_id` **an
|
||||
|
||||
## Known limitations
|
||||
|
||||
- Entity filters operate on a single scope per record. Use separate queries or `OR` logic to compare users vs agents.
|
||||
- Filters only constrain the fields you mention; unmentioned entity fields are not required to be null. A record carries `user_id` or `agent_id` (never both) unless it came from Direct Import, plus whatever `app_id` and `run_id` were passed.
|
||||
- Metadata supports only bare/`eq`, `contains`, and `ne` comparisons.
|
||||
- Wildcards (`"*"` ) match only records where the field is already non-null.
|
||||
|
||||
@@ -51,6 +51,7 @@ console.log(webhook);
|
||||
"webhook_id": "wh_123",
|
||||
"name": "Memory Logger",
|
||||
"url": "https://your-app.com/webhook",
|
||||
"owner": "john",
|
||||
"event_types": ["memory_add"],
|
||||
"project": "default-project",
|
||||
"is_active": true,
|
||||
@@ -63,7 +64,7 @@ console.log(webhook);
|
||||
|
||||
### Get Webhooks
|
||||
|
||||
Retrieve all webhooks for your project:
|
||||
Retrieve all webhooks for your project. Each webhook includes an `owner` field: the username of the account that created it. This is set automatically and cannot be changed via the API.
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
@@ -168,6 +169,10 @@ Mem0 supports the following event types for webhooks:
|
||||
- `memory_update`: Triggered when an existing memory is updated.
|
||||
- `memory_delete`: Triggered when a memory is deleted.
|
||||
- `memory_categorize`: Triggered when a memory is categorized.
|
||||
- `ingest_job_completed`: Triggered when an ingest job finishes successfully.
|
||||
- `ingest_job_partially_completed`: Triggered when an ingest job finishes with some items failed.
|
||||
- `ingest_job_failed`: Triggered when an ingest job fails entirely.
|
||||
- `ingest_job_cancelled`: Triggered when an ingest job is cancelled.
|
||||
|
||||
## Webhook Payload
|
||||
|
||||
|
||||
+59
-34
@@ -8,18 +8,20 @@ estimatedTime: "~2 minutes"
|
||||
<Info>
|
||||
**Prerequisites**
|
||||
- Mem0 Platform account (<a href="https://app.mem0.ai?utm_source=oss&utm_medium=platform-mem0-mcp" rel="nofollow">Sign up here</a>)
|
||||
- API key (<a href="https://app.mem0.ai/settings/api-keys?utm_source=oss&utm_medium=platform-mem0-mcp" rel="nofollow">Get one from dashboard</a>)
|
||||
- Node.js 14+ (for npx)
|
||||
- API key (<a href="https://app.mem0.ai/dashboard/api-keys?utm_source=oss&utm_medium=platform-mem0-mcp" rel="nofollow">Get one from dashboard</a>)
|
||||
- Node.js 18+ (for npx)
|
||||
- An MCP-compatible client (Claude, Claude Code, Codex, Cursor, Windsurf, VS Code, OpenCode)
|
||||
</Info>
|
||||
|
||||
## What is Mem0 MCP?
|
||||
|
||||
Mem0 MCP Server exposes Mem0's memory capabilities as MCP tools, letting AI agents decide when to save, search, or update information. The cloud-hosted MCP server requires no local installation: just connect and start using memory.
|
||||
MCP (Model Context Protocol) is a standard way for AI clients to call external tools. The Mem0 MCP server hands your agent a set of memory tools, so it can decide for itself when to save something, look something up, or update what it already knows. Nothing runs on your machine: the server is hosted by Mem0, and your client connects to it over HTTPS.
|
||||
|
||||
## Quick Setup
|
||||
Memories you store this way live in your Mem0 account, not on your computer.
|
||||
|
||||
Add Mem0 MCP to your preferred clients with a single command:
|
||||
## Quick setup
|
||||
|
||||
Point your clients at the hosted server with a single command:
|
||||
|
||||
```bash
|
||||
npx mcp-add \
|
||||
@@ -29,9 +31,31 @@ npx mcp-add \
|
||||
--clients "claude,claude code,cursor,windsurf,vscode,opencode"
|
||||
```
|
||||
|
||||
This automatically configures Mem0 MCP for all supported clients at once.
|
||||
`mcp-add` is a helper that writes the Mem0 server into each client's own MCP config file, so you do not have to edit them by hand. Name only the clients you actually use. If you would rather see the change yourself, every client's manual config is under [Client-specific setup](#client-specific-setup).
|
||||
|
||||
## Available Tools
|
||||
Restart each client afterwards so it picks up the new server.
|
||||
|
||||
## Signing in
|
||||
|
||||
The server is authenticated, so connecting is not enough on its own. There are two ways in:
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Sign in through the client">
|
||||
Most clients handle this for you. The first time your agent uses a Mem0 tool, the client opens a browser window asking you to authorize access to your Mem0 account. Approve it once and the client stores the token, refreshing it as needed.
|
||||
|
||||
This is the easier path, and it is what happens by default if you followed the quick setup above.
|
||||
</Tab>
|
||||
|
||||
<Tab title="Use your API key">
|
||||
For clients without browser sign-in, or for headless environments like CI, send your API key as a bearer token instead. Where you put it depends on the client; see [Client-specific setup](#client-specific-setup) for the exact syntax.
|
||||
|
||||
Get a key from the <a href="https://app.mem0.ai/dashboard/api-keys?utm_source=oss&utm_medium=platform-mem0-mcp" rel="nofollow">Mem0 dashboard</a>, and keep it out of any file you commit.
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
If neither is set up, the server replies `401 Authentication required` and your client reports the connection as failed.
|
||||
|
||||
## Available tools
|
||||
|
||||
The MCP server exposes these memory tools to your AI client:
|
||||
|
||||
@@ -41,7 +65,7 @@ The MCP server exposes these memory tools to your AI client:
|
||||
| `search_memories` | Semantic search across existing memories with filters |
|
||||
| `get_memories` | List memories with structured filters and pagination |
|
||||
| `get_memory` | Retrieve one memory by its `memory_id` |
|
||||
| `update_memory` | Overwrite a memory's text after confirming the ID |
|
||||
| `update_memory` | Overwrite a memory's text and/or metadata after confirming the ID |
|
||||
| `delete_memory` | Delete a single memory by `memory_id` |
|
||||
| `delete_all_memories` | Bulk delete all memories in scope |
|
||||
| `delete_entities` | Delete a user/agent/app/run entity and its memories |
|
||||
@@ -51,7 +75,7 @@ The MCP server exposes these memory tools to your AI client:
|
||||
|
||||
---
|
||||
|
||||
## Client-Specific Setup
|
||||
## Client-specific setup
|
||||
|
||||
You can also configure individual clients:
|
||||
|
||||
@@ -170,43 +194,44 @@ You can also configure individual clients:
|
||||
|
||||
---
|
||||
|
||||
## Verify Your Setup
|
||||
## Check that it worked
|
||||
|
||||
Once configured, your AI client can:
|
||||
- Automatically save information with `add_memory`
|
||||
- Search memories with `search_memories`
|
||||
- Update memories with `update_memory`
|
||||
- Delete memories with `delete_memory`
|
||||
|
||||
**Sample Interactions:**
|
||||
Restart your client, then ask it to store something and read it back in a later message:
|
||||
|
||||
```
|
||||
User: Remember that I love tiramisu
|
||||
Agent: Got it! I've saved that you love tiramisu.
|
||||
You: Remember that I prefer TypeScript over JavaScript for new projects.
|
||||
Agent: Saved.
|
||||
|
||||
User: What do you know about my food preferences?
|
||||
Agent: Based on your memories, you love tiramisu.
|
||||
|
||||
User: Update my project: the mobile app is now 80% complete
|
||||
Agent: Updated your project status successfully.
|
||||
You: What language do I prefer for new projects?
|
||||
Agent: You prefer TypeScript over JavaScript.
|
||||
```
|
||||
|
||||
<Info icon="check">
|
||||
If you get "Connection failed", ensure you have a valid API key from <a href="https://app.mem0.ai/settings/api-keys?utm_source=oss&utm_medium=platform-mem0-mcp" rel="nofollow">Mem0 Dashboard</a>.
|
||||
</Info>
|
||||
The second answer only works if the memory was really stored, so this is a genuine round-trip test rather than the model repeating itself.
|
||||
|
||||
Two things to look for while you do it:
|
||||
|
||||
- Your client should show the Mem0 tools among its available tools. Most clients list them in a tools or MCP panel.
|
||||
- The first tool call should trigger the browser sign-in described above, unless you configured an API key.
|
||||
|
||||
To confirm from outside the client, open the <a href="https://app.mem0.ai/dashboard?utm_source=oss&utm_medium=platform-mem0-mcp" rel="nofollow">Mem0 dashboard</a>: anything the agent saved appears there.
|
||||
|
||||
---
|
||||
|
||||
## Quick Recovery
|
||||
## Troubleshooting
|
||||
|
||||
- **"Connection refused"** → Check your internet connection and ensure the MCP client is correctly configured
|
||||
- **"Invalid API key"** → Get a new key from <a href="https://app.mem0.ai/settings/api-keys?utm_source=oss&utm_medium=platform-mem0-mcp" rel="nofollow">Mem0 Dashboard</a>
|
||||
- **"npx command not found"** → Install Node.js from [nodejs.org](https://nodejs.org)
|
||||
| What you see | What it means | What to do |
|
||||
|---|---|---|
|
||||
| `401` or "Authentication required" | The client connected but is not signed in | Complete the browser sign-in, or set your API key as a bearer token |
|
||||
| "Connection refused" or "failed to connect" | The client cannot reach the server | Check your internet connection, then confirm the URL is exactly `https://mcp.mem0.ai/mcp` |
|
||||
| The agent has no Mem0 tools | The config was written but the client has not reloaded it | Restart the client. If the tools are still missing, check that `mcp-add` wrote to the config file your client actually reads |
|
||||
| `npx: command not found` | Node.js is not installed | Install it from [nodejs.org](https://nodejs.org) |
|
||||
| "Invalid API key" | The key is wrong, revoked, or from a different account | Get a new one from the <a href="https://app.mem0.ai/dashboard/api-keys?utm_source=oss&utm_medium=platform-mem0-mcp" rel="nofollow">Mem0 dashboard</a> |
|
||||
|
||||
---
|
||||
|
||||
## Next steps
|
||||
|
||||
- [Platform Quickstart](/platform/quickstart) - direct SDK/API integration guide
|
||||
- [MCP Specification](https://modelcontextprotocol.io) - the Model Context Protocol standard
|
||||
- [Gemini with Mem0 MCP](/cookbooks/frameworks/gemini-3-with-mem0-mcp) - example integration cookbook
|
||||
- [Platform quickstart](/platform/quickstart): call Mem0 from your own code instead of through an agent
|
||||
- [Mem0 CLI](/platform/cli): the same operations from your terminal
|
||||
- [MCP specification](https://modelcontextprotocol.io): the Model Context Protocol standard
|
||||
- [Gemini with Mem0 MCP](/cookbooks/frameworks/gemini-3-with-mem0-mcp): a worked example
|
||||
|
||||
@@ -50,7 +50,7 @@ For the full pipeline, see [How Mem0 works](/core-concepts/how-it-works).
|
||||
Get an API key and save your first memory.
|
||||
</Card>
|
||||
<Card title="Understand memory types" icon="brain" href="/core-concepts/memory-types">
|
||||
How user, agent, run, and session memory differ.
|
||||
How user, agent, app, and run memory differ.
|
||||
</Card>
|
||||
<Card title="Add, search, and update" icon="layer-group" href="/core-concepts/memory-operations/add">
|
||||
The core memory operations, end to end.
|
||||
|
||||
@@ -5,31 +5,42 @@ icon: "bolt"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Get started with Mem0 Platform's hosted API in under 5 minutes. This guide shows you how to authenticate and store your first memory.
|
||||
In about five minutes you will get an API key, store your first memory, and search it back. Follow along in Python, JavaScript, cURL, or the terminal.
|
||||
|
||||
<Note>
|
||||
**Are you an AI agent?** See [Sign up as an agent](/platform/agent-signup): mint a working API key in four commands, no email or dashboard required.
|
||||
**Are you an AI agent?** See [Sign up as an agent](/platform/agent-signup): create a working API key in four commands, with no email or dashboard.
|
||||
</Note>
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Mem0 Platform account (<a href="https://app.mem0.ai?utm_source=oss&utm_medium=platform-quickstart" rel="nofollow">Sign up here</a>)
|
||||
- API key (<a href="https://app.mem0.ai/dashboard/settings?tab=api-keys&subtab=configuration" rel="nofollow">Get one from dashboard</a>)
|
||||
- Python 3.10+, Node.js 18+, or cURL
|
||||
- Python 3.10+, Node.js 18+, or cURL. The CLI needs either Node.js 18+ or Python 3.10+.
|
||||
|
||||
## Installation
|
||||
## Store your first memory
|
||||
|
||||
<Steps>
|
||||
<Step title="Install SDK">
|
||||
<Step title="Install">
|
||||
Pick a tab and use the same one for every step below.
|
||||
|
||||
<CodeGroup>
|
||||
```bash pip
|
||||
```bash Python
|
||||
pip install mem0ai
|
||||
```
|
||||
|
||||
```bash npm
|
||||
```bash JavaScript
|
||||
npm install mem0ai
|
||||
```
|
||||
|
||||
```bash cURL
|
||||
# Nothing to install. cURL ships with macOS and most Linux distributions.
|
||||
```
|
||||
|
||||
```bash CLI
|
||||
npm install -g @mem0/cli
|
||||
# or, if you prefer Python: pip install mem0-cli
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
</Step>
|
||||
|
||||
@@ -39,12 +50,12 @@ npm install mem0ai
|
||||
from mem0 import MemoryClient
|
||||
|
||||
client = MemoryClient(api_key="your-api-key")
|
||||
````
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
import MemoryClient from 'mem0ai';
|
||||
const client = new MemoryClient({ apiKey: 'your-api-key' });
|
||||
````
|
||||
```
|
||||
|
||||
```bash cURL
|
||||
export MEM0_API_KEY="your-api-key"
|
||||
@@ -65,7 +76,7 @@ messages = [
|
||||
{"role": "assistant", "content": "Got it! I'll remember your dietary preferences."}
|
||||
]
|
||||
client.add(messages, user_id="user123")
|
||||
````
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
const messages = [
|
||||
@@ -73,7 +84,7 @@ const messages = [
|
||||
{"role": "assistant", "content": "Got it! I'll remember your dietary preferences."}
|
||||
];
|
||||
await client.add(messages, { userId: "user123" });
|
||||
````
|
||||
```
|
||||
|
||||
```bash cURL
|
||||
curl -X POST https://api.mem0.ai/v3/memories/add/ \
|
||||
@@ -93,6 +104,17 @@ mem0 add "I'm a vegetarian and allergic to nuts." --user-id user123
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
Mem0 pulls the individual facts out of the conversation and stores each one separately:
|
||||
|
||||
```json
|
||||
{
|
||||
"results": [
|
||||
{"id": "0f2c1b6e-9a3d-4b18-8f77-1c2d3e4f5a6b", "memory": "Is a vegetarian", "event": "ADD"},
|
||||
{"id": "14e1b28a-2014-40ad-ac42-69c9ef42193d", "memory": "Allergic to nuts", "event": "ADD"}
|
||||
]
|
||||
}
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Search memories">
|
||||
@@ -100,12 +122,12 @@ mem0 add "I'm a vegetarian and allergic to nuts." --user-id user123
|
||||
```python Python
|
||||
results = client.search("What are my dietary restrictions?", filters={"user_id": "user123"})
|
||||
print(results)
|
||||
````
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
const results = await client.search("What are my dietary restrictions?", { filters: { user_id: "user123" } });
|
||||
console.log(results);
|
||||
````
|
||||
```
|
||||
|
||||
```bash cURL
|
||||
curl -X POST https://api.mem0.ai/v3/memories/search/ \
|
||||
@@ -123,7 +145,7 @@ mem0 search "What are my dietary restrictions?" --user-id user123
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
**Output:**
|
||||
Both facts come back, ranked by how well they match the question:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -132,37 +154,65 @@ mem0 search "What are my dietary restrictions?" --user-id user123
|
||||
"id": "14e1b28a-2014-40ad-ac42-69c9ef42193d",
|
||||
"memory": "Allergic to nuts",
|
||||
"user_id": "user123",
|
||||
"agent_id": null,
|
||||
"app_id": null,
|
||||
"run_id": null,
|
||||
"categories": ["health"],
|
||||
"metadata": {},
|
||||
"created_at": "2025-10-22T04:40:22.864647-07:00",
|
||||
"score": 0.30
|
||||
"updated_at": "2025-10-22T04:40:22.864647-07:00",
|
||||
"expiration_date": null,
|
||||
"score": 0.87
|
||||
},
|
||||
{
|
||||
"id": "0f2c1b6e-9a3d-4b18-8f77-1c2d3e4f5a6b",
|
||||
"memory": "Is a vegetarian",
|
||||
"user_id": "user123",
|
||||
"agent_id": null,
|
||||
"app_id": null,
|
||||
"run_id": null,
|
||||
"categories": ["food_preferences"],
|
||||
"metadata": {},
|
||||
"created_at": "2025-10-22T04:40:22.864647-07:00",
|
||||
"updated_at": "2025-10-22T04:40:22.864647-07:00",
|
||||
"expiration_date": null,
|
||||
"score": 0.81
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Pass these memories to your model as context, and it answers with what it already knows about the user instead of asking again.
|
||||
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Callout type="tip" icon="plug">
|
||||
**Pro Tip**: Want AI agents to manage their own memory automatically? Use <Link href="/platform/mem0-mcp">Mem0 MCP</Link> to let LLMs decide when to save, search, and update memories.
|
||||
</Callout>
|
||||
<Tip>
|
||||
Rather than calling `add` and `search` yourself, you can hand Mem0 to your agent as a set of tools and let it decide when to save and look things up. See [Mem0 MCP](/platform/mem0-mcp).
|
||||
</Tip>
|
||||
|
||||
## What's next?
|
||||
|
||||
You stored and searched your first memory. Keep going:
|
||||
You stored and searched your first memory. Start with scoping, since every call you make from here needs it:
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="How it works" icon="diagram-project" href="/core-concepts/how-it-works">
|
||||
See how Mem0 extracts, stores, and retrieves memories under the hood.
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Scope memories to users and agents" icon="users" href="/platform/features/entity-scoped-memory">
|
||||
What `user_id` actually does, plus the `agent_id`, `app_id`, and `run_id` fields that came back empty above.
|
||||
</Card>
|
||||
|
||||
<Card title="Memory operations" icon="database" href="/core-concepts/memory-operations/add">
|
||||
Go beyond add and search: update, delete, and the full memory lifecycle.
|
||||
<Card title="How Mem0 works" icon="diagram-project" href="/core-concepts/how-it-works">
|
||||
Why one sentence became two memories, and how Mem0 decides what to keep.
|
||||
</Card>
|
||||
|
||||
<Card title="Build an AI companion" icon="users" href="/cookbooks/essentials/building-ai-companion">
|
||||
Put it to work in a real app, end to end, in about 10 minutes.
|
||||
<Card title="Update and delete memories" icon="database" href="/core-concepts/memory-operations/add">
|
||||
The operations beyond add and search, for when stored facts change or go stale.
|
||||
</Card>
|
||||
|
||||
<Card title="Use Mem0 with your agent framework" icon="plug" href="/integrations">
|
||||
Wire memory into LangChain, CrewAI, LangGraph, or the OpenAI Agents SDK.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
Stuck on setup? See the [FAQs and troubleshooting](/platform/faqs).
|
||||
<Note>
|
||||
Something not working? The [FAQs and troubleshooting](/platform/faqs) page covers the common setup errors.
|
||||
</Note>
|
||||
|
||||
+18
-16
@@ -5,13 +5,15 @@ description: "Agent skills, starter prompts, and setup for building with Mem0 us
|
||||
icon: "wand-magic-sparkles"
|
||||
---
|
||||
|
||||
These docs are designed to be easily consumable by LLMs. Each page has a button that lets you copy the page as Markdown or paste directly into ChatGPT, Claude, or any AI coding tool.
|
||||
Vibecoding means building software by describing what you want to an AI coding assistant and letting it write the code. The catch is that assistants guess at unfamiliar libraries, and a wrong guess about Mem0 costs you a debugging session.
|
||||
|
||||
We follow the llms.txt standard:
|
||||
This page fixes that three ways: skills that teach your assistant the Mem0 SDKs, an MCP connection so it can read and write memories itself, and a starter prompt you can paste into any tool.
|
||||
|
||||
- [llms.txt](https://docs.mem0.ai/llms.txt)
|
||||
<Note>
|
||||
Every page in these docs has a button to copy it as Markdown or send it straight to ChatGPT or Claude, so you can hand your assistant any page it needs. We follow the [llms.txt](https://docs.mem0.ai/llms.txt) standard.
|
||||
</Note>
|
||||
|
||||
## Agent Skills
|
||||
## Agent skills
|
||||
|
||||
Mem0 ships two kinds of skills for AI coding assistants. Both work with Claude Code, Codex, Cursor, Windsurf, OpenCode, OpenClaw, and any assistant that supports the skills standard.
|
||||
|
||||
@@ -45,7 +47,7 @@ npx skills add https://github.com/mem0ai/mem0 --skill mem0-oss-to-platform
|
||||
|
||||
See the [skills index](https://github.com/mem0ai/mem0/tree/main/skills) for the full catalog.
|
||||
|
||||
## MCP Server Setup
|
||||
## MCP server setup
|
||||
|
||||
Connect Claude, Claude Code, Cursor, Windsurf, VS Code, OpenCode, or any MCP-compatible client to Mem0.
|
||||
|
||||
@@ -61,13 +63,13 @@ npx mcp-add \
|
||||
|
||||
For per-client setup and advanced options, see [Mem0 MCP Setup](/platform/mem0-mcp).
|
||||
|
||||
## Universal Starter Prompt
|
||||
## Universal starter prompt
|
||||
|
||||
Copy this into any AI tool to start building with Mem0:
|
||||
|
||||
```text
|
||||
I want to start building with Mem0, a self-improving memory layer for LLM
|
||||
applications that gives agents persistent context across sessions.
|
||||
I want to start building with Mem0, which gives AI agents long-term memory
|
||||
that persists across sessions, tools, and runs.
|
||||
|
||||
## Mem0 Resources
|
||||
|
||||
@@ -86,10 +88,10 @@ applications that gives agents persistent context across sessions.
|
||||
- Cookbooks: https://docs.mem0.ai/cookbooks/overview
|
||||
|
||||
**What Mem0 Does:**
|
||||
Mem0 is a memory layer for AI apps, managed (Mem0 Platform) or self-hosted
|
||||
(Open Source). It stores, retrieves, and manages user memories so agents
|
||||
remember preferences, learn from interactions, and personalize over time.
|
||||
Sub-50ms retrieval. Storage: vector embeddings.
|
||||
Mem0 gives AI agents long-term memory, either managed (Mem0 Platform) or
|
||||
self-hosted (Open Source). It stores, retrieves, and manages memories so
|
||||
agents remember preferences, learn from past runs, and personalize over
|
||||
time. Storage: vector embeddings.
|
||||
|
||||
**Architecture Overview:**
|
||||
- Memory is scoped by user_id, agent_id, or run_id
|
||||
@@ -109,7 +111,7 @@ Sub-50ms retrieval. Storage: vector embeddings.
|
||||
import MemoryClient from 'mem0ai';
|
||||
const client = new MemoryClient({ apiKey: 'm0-xxx' });
|
||||
await client.add([{ role: "user", content: "I prefer dark mode." }], { userId: "user1" });
|
||||
const results = await client.search("What editor?", { filters: { userId: "user1" } });
|
||||
const results = await client.search("What editor?", { filters: { user_id: "user1" } });
|
||||
|
||||
**Quick Usage (Python Open Source):**
|
||||
from mem0 import Memory
|
||||
@@ -121,10 +123,10 @@ Help me integrate Mem0 into my project. Start by asking what I'm building,
|
||||
what language/framework I'm using, and whether I want managed or self-hosted.
|
||||
```
|
||||
|
||||
## Go Deeper
|
||||
## Go deeper
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Platform Quickstart" icon="cloud" href="/platform/quickstart">
|
||||
<Card title="Platform quickstart" icon="cloud" href="/platform/quickstart">
|
||||
Get started with the managed API
|
||||
</Card>
|
||||
<Card title="Open Source" icon="code-branch" href="/open-source/overview">
|
||||
@@ -133,7 +135,7 @@ what language/framework I'm using, and whether I want managed or self-hosted.
|
||||
<Card title="Cookbooks" icon="book" href="/cookbooks/overview">
|
||||
Production-ready tutorials and examples
|
||||
</Card>
|
||||
<Card title="API Reference" icon="code" href="/api-reference">
|
||||
<Card title="API reference" icon="code" href="/api-reference">
|
||||
Explore every REST endpoint
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
"clsx": "^2.1.1",
|
||||
"js-cookie": "^3.0.6",
|
||||
"lucide-react": "^0.477.0",
|
||||
"next": "15.5.18",
|
||||
"next": "15.5.21",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-markdown": "^10.0.1",
|
||||
|
||||
@@ -1449,7 +1449,7 @@ export function registerCliCommands(
|
||||
console.log(" openclaw mem0 config set auto_recall false");
|
||||
} else {
|
||||
console.log(" openclaw mem0 config set vector_provider qdrant");
|
||||
console.log(" openclaw mem0 config set llm_model gpt-4o");
|
||||
console.log(" openclaw mem0 config set llm_model gpt-5-mini");
|
||||
console.log(" openclaw mem0 config set embedder_provider openai");
|
||||
}
|
||||
console.log("");
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"id": "openclaw-mem0",
|
||||
"name": "Memory (Mem0)",
|
||||
"description": "Mem0 memory backend for OpenClaw — platform (mem0.ai cloud) or self-hosted open-source. Auto-recall and auto-capture are opt-in (disabled by default). Supports OpenAI, Anthropic, Ollama (fully local), Qdrant, and PGVector providers.",
|
||||
"version": "1.0.14",
|
||||
"version": "1.0.15",
|
||||
"kind": "memory",
|
||||
"skills": ["skills"],
|
||||
"commandAliases": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mem0/openclaw-mem0",
|
||||
"version": "1.0.14",
|
||||
"version": "1.0.15",
|
||||
"type": "module",
|
||||
"description": "Mem0 memory backend for OpenClaw — platform or self-hosted open-source",
|
||||
"license": "Apache-2.0",
|
||||
@@ -65,14 +65,17 @@
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"form-data@<4.0.6": ">=4.0.6",
|
||||
"protobufjs@<7.5.5": "^7.5.5",
|
||||
"protobufjs@<7.6.5": ">=7.6.5 <8.0.0",
|
||||
"vite": "^8.0.5",
|
||||
"langsmith@<0.6.0": "^0.6.0",
|
||||
"picomatch@<2.3.2": "^2.3.2",
|
||||
"@qdrant/js-client-rest": "^1.18.0",
|
||||
"uuid@<11.1.1": ">=11.1.1",
|
||||
"esbuild": ">=0.28.1",
|
||||
"undici@<6.27.0": ">=6.27.0 <8.0.0"
|
||||
"undici@<6.27.0": ">=6.27.0 <8.0.0",
|
||||
"axios@<1.18.0": ">=1.18.0 <2.0.0",
|
||||
"postcss@<8.5.18": ">=8.5.18 <9.0.0",
|
||||
"mongoose@>=9.0.0 <9.7.2": ">=9.7.2 <10.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+100
-43
@@ -6,7 +6,7 @@ settings:
|
||||
|
||||
overrides:
|
||||
form-data@<4.0.6: '>=4.0.6'
|
||||
protobufjs@<7.5.5: ^7.5.5
|
||||
protobufjs@<7.6.5: '>=7.6.5 <8.0.0'
|
||||
vite: ^8.0.5
|
||||
langsmith@<0.6.0: ^0.6.0
|
||||
picomatch@<2.3.2: ^2.3.2
|
||||
@@ -14,6 +14,9 @@ overrides:
|
||||
uuid@<11.1.1: '>=11.1.1'
|
||||
esbuild: '>=0.28.1'
|
||||
undici@<6.27.0: '>=6.27.0 <8.0.0'
|
||||
axios@<1.18.0: '>=1.18.0 <2.0.0'
|
||||
postcss@<8.5.18: '>=8.5.18 <9.0.0'
|
||||
mongoose@>=9.0.0 <9.7.2: '>=9.7.2 <10.0.0'
|
||||
|
||||
importers:
|
||||
|
||||
@@ -24,7 +27,7 @@ importers:
|
||||
version: 0.34.47
|
||||
mem0ai:
|
||||
specifier: 3.0.7
|
||||
version: 3.0.7(@anthropic-ai/sdk@0.40.1)(@azure/identity@4.13.1)(@azure/search-documents@12.2.0)(@cloudflare/workers-types@4.20260610.1)(@google/genai@1.52.0)(@langchain/core@1.1.48(openai@4.104.0(ws@8.21.0)(zod@3.25.76))(ws@8.21.0))(@mistralai/mistralai@1.15.1)(@qdrant/js-client-rest@1.18.0(typescript@5.9.3))(@supabase/supabase-js@2.108.1)(@types/jest@29.5.14)(@types/pg@8.11.0)(better-sqlite3@12.10.0)(cloudflare@4.5.0)(compromise@14.15.1)(groq-sdk@0.3.0)(natural@8.1.1)(ollama@0.5.18)(pg@8.21.0)(redis@5.12.1)(ws@8.21.0)
|
||||
version: 3.0.7(@anthropic-ai/sdk@0.40.1)(@azure/identity@4.13.1)(@azure/search-documents@12.2.0)(@cloudflare/workers-types@4.20260610.1)(@google/genai@1.52.0)(@langchain/core@1.1.48(openai@4.104.0(ws@8.21.0)(zod@3.25.76))(ws@8.21.0))(@mistralai/mistralai@1.15.1)(@qdrant/js-client-rest@1.18.0(typescript@5.9.3))(@supabase/supabase-js@2.108.1)(@types/jest@29.5.14)(@types/pg@8.11.0)(better-sqlite3@12.10.0)(cloudflare@4.5.0)(compromise@14.15.1)(groq-sdk@0.3.0)(natural@8.1.1)(ollama@0.5.18)(pg@8.11.3)(redis@5.12.1)(ws@8.21.0)
|
||||
devDependencies:
|
||||
'@qdrant/js-client-rest':
|
||||
specifier: ^1.18.0
|
||||
@@ -37,7 +40,7 @@ importers:
|
||||
version: 4.1.8(vitest@4.1.8)
|
||||
tsup:
|
||||
specifier: ^8.5.0
|
||||
version: 8.5.1(postcss@8.5.15)(typescript@5.9.3)
|
||||
version: 8.5.1(postcss@8.5.23)(typescript@5.9.3)
|
||||
typescript:
|
||||
specifier: ^5.8.3
|
||||
version: 5.9.3
|
||||
@@ -379,9 +382,6 @@ packages:
|
||||
'@protobufjs/float@1.0.2':
|
||||
resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==}
|
||||
|
||||
'@protobufjs/inquire@1.1.2':
|
||||
resolution: {integrity: sha512-pa0vFRuws4wkvaXKK1uXZMAwAX4/t8ANaJo45iw/oQHNQ9q5xUzwgFmVJGXiga2BeN+zpX7Vf9vmsiIa2J+MUw==}
|
||||
|
||||
'@protobufjs/path@1.1.2':
|
||||
resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==}
|
||||
|
||||
@@ -472,36 +472,42 @@ packages:
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rolldown/binding-linux-arm64-musl@1.0.3':
|
||||
resolution: {integrity: sha512-VWkUHwWriDciit80wleYwKILoR/KMvxh/IdwS/paX+ZgpuRpCrKLUdadJbc0NpBEiyhpYawsJ73j9aCvOH+f7Q==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rolldown/binding-linux-ppc64-gnu@1.0.3':
|
||||
resolution: {integrity: sha512-5f1laC0SlIR0yDbFCd8acUhvJIag6N3zC5P7oUPN6wX0aOma+uKJ0wBDH5aq7I1PVI2ttTlhJwzwRIBnLiSGEg==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rolldown/binding-linux-s390x-gnu@1.0.3':
|
||||
resolution: {integrity: sha512-Iq4ko0r4XsgbrF/LunNgHtAGLRRVE2kXonAXQ/MV0mC6jQpMOhW1SvtZja2EhC/kd05++bP78dsqBeIQyYJ6Yg==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rolldown/binding-linux-x64-gnu@1.0.3':
|
||||
resolution: {integrity: sha512-B8m6tD5+/N5FeNQFbKlLA/2yVq9ycQP1SeedyEYYKWBNR3ZQbkvIUcNnDNM03lO1l5F2roiiFJGgvoLLyZXtSg==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rolldown/binding-linux-x64-musl@1.0.3':
|
||||
resolution: {integrity: sha512-pSdpdUJHkuCxun9LE7jvgUB9qsRgaiyNNCX7m/AvHTcq67AiT/Yhoxvw5zPfhrM8k/BfP8ce/hMOpthKDpEUow==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rolldown/binding-openharmony-arm64@1.0.3':
|
||||
resolution: {integrity: sha512-OXXS3RKJgX2uLwM+gYyuH5omcH8fL1LJs96pZGgtetVCahON57+d4SJHzTgZiOjxgGkSnpXpOsWuPDGAKAigEg==}
|
||||
@@ -563,66 +569,79 @@ packages:
|
||||
resolution: {integrity: sha512-Q8CBCCQtDFrYtXoeUXSrnFXKOnyUhx6bz+SkL6A0E7V8kAiCJ5pamq1WtbfpVGhR5TSpXY6ak3avmDc5fHTyJA==}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-arm-musleabihf@4.61.1':
|
||||
resolution: {integrity: sha512-nwnhk1581l0FBVellGcVCAT0Oi06onEA3WB53sf01VO3I0UPBkMH9sXONYME2K0ovXcNayJfNtHfm6mpJElatQ==}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-linux-arm64-gnu@4.61.1':
|
||||
resolution: {integrity: sha512-x5Xr49hwt3hdW75UOZm3395YwwzPyauktslv29KpWL/T+vVAzoT3azLcTWv0eMciBNrx+DYjH4paehHoLpPvpg==}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-arm64-musl@4.61.1':
|
||||
resolution: {integrity: sha512-unMS3H73DpaoPyyEVPjGKleM/s0mkmsauTENpw4INQY8y4+IuLNjkueQ5QCtC0D3N38Y38yhAU8OoZ20S2Tm6w==}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-linux-loong64-gnu@4.61.1':
|
||||
resolution: {integrity: sha512-zNZzGRnAhwjFEYmvphJRV5XaQGjs62cCmeYYHUT//NbvEnHauw+I85nGG+SiVg5ld4GX8D1IbKIX+ozITQnhMQ==}
|
||||
cpu: [loong64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-loong64-musl@4.61.1':
|
||||
resolution: {integrity: sha512-LdpWGL8X209B2SIvWjqlc8VZgM6PKfontSerGepuldQmHYrAOtnMCXeJkxXGbC+PPZVOuu5czJo7fNV6aeW8rQ==}
|
||||
cpu: [loong64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-linux-ppc64-gnu@4.61.1':
|
||||
resolution: {integrity: sha512-EC5kTtNaNGOmbMGqar8dvJy6y/hg99GAwjfBz++pxZhQATXGcRjd6c5en5wcbru0vkRmiMGsQKdMJOOf6sza4g==}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-ppc64-musl@4.61.1':
|
||||
resolution: {integrity: sha512-8hiwp6D4acEcNK78I4rP0/XtS1sknWIAMJBPdR4l6zUtyTm5KiTDr5bXmWt4foY7nAN7AThDHgkLIEZOWKbzWw==}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-linux-riscv64-gnu@4.61.1':
|
||||
resolution: {integrity: sha512-10dh/h/BqA7DuMPWSxkR8uks18FRwnwOEqr5zOTEl+NOwP/OMzKX8OFR/Of9xxDA7D5qef1Nzar5WDD2kCCr1g==}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-riscv64-musl@4.61.1':
|
||||
resolution: {integrity: sha512-YKJ5lg35DP17gcAOggnihe+APw9HLyj1Xn7gsmGumBJAUDa6NGXNixJzmkWLhcK9TOuuyQjdamzvJefkO7qHZQ==}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-linux-s390x-gnu@4.61.1':
|
||||
resolution: {integrity: sha512-Mlil5G2Jj6a7B3LWGctg+XPL9vdXYuzCtNXfxOQ0nPjc2m6ueUktocPGH9bnAM0bNRKb/bAWTujUU7IJQdQA+g==}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-x64-gnu@4.61.1':
|
||||
resolution: {integrity: sha512-bVWIOIk6pV01p4CdUbPP7CJ/434z+OooYjDuFcR+44N35YvKUC66G8MGnvcWx5mWKW3g61J+t74l3Kj15Kwn2Q==}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-x64-musl@4.61.1':
|
||||
resolution: {integrity: sha512-qy5pBvZbqNFheBz61R1rzsezjm0J7O2oNGoWtGoY89SZYLUfxAJTBAqDChqAIdB4rCiIbi9nF7yZ83GnNiLwSw==}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-openbsd-x64@4.61.1':
|
||||
resolution: {integrity: sha512-E83TXjI4zm0+5f2qO+UOudaCYIhYwpJ5jq6YCZNIZ+6CbfhKrkAGezeiASBL9ElxAxFsRS9ZhESv8mfnj6TKeg==}
|
||||
@@ -838,8 +857,8 @@ packages:
|
||||
asynckit@0.4.0:
|
||||
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
|
||||
|
||||
axios@1.17.0:
|
||||
resolution: {integrity: sha512-J8SwNxprqqpbfenehxWYXE7CW+wM1BB4w3+N+g+/Wx40xM4rsLrfPmHHxSWIxJLYDgSY/HqlFPIYb2/S3rxafw==}
|
||||
axios@1.18.1:
|
||||
resolution: {integrity: sha512-3nTvFlvpn9Zu/RkHUqtc7/+al4UpRW5az71ap5zccp6e8RAYEzhMTecX8Dz1wWDYrPpUoB1HAQEGEAEvUr7S9g==}
|
||||
|
||||
base-64@0.1.0:
|
||||
resolution: {integrity: sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==}
|
||||
@@ -871,6 +890,10 @@ packages:
|
||||
buffer-equal-constant-time@1.0.1:
|
||||
resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==}
|
||||
|
||||
buffer-writer@2.0.0:
|
||||
resolution: {integrity: sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==}
|
||||
engines: {node: '>=4'}
|
||||
|
||||
buffer@5.7.1:
|
||||
resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==}
|
||||
|
||||
@@ -1360,24 +1383,28 @@ packages:
|
||||
engines: {node: '>= 12.0.0'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
lightningcss-linux-arm64-musl@1.32.0:
|
||||
resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==}
|
||||
engines: {node: '>= 12.0.0'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
lightningcss-linux-x64-gnu@1.32.0:
|
||||
resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==}
|
||||
engines: {node: '>= 12.0.0'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
lightningcss-linux-x64-musl@1.32.0:
|
||||
resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==}
|
||||
engines: {node: '>= 12.0.0'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
lightningcss-win32-arm64-msvc@1.32.0:
|
||||
resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==}
|
||||
@@ -1507,15 +1534,15 @@ packages:
|
||||
resolution: {integrity: sha512-h0AZ9A7IDVwwHyMxmdMXKy+9oNlF0zFoahHiX3vQ8e3KFcSP3VmsmfvtRSuLPxmyv2vjIDxqty8smTgie/SNRQ==}
|
||||
engines: {node: '>=20.19.0'}
|
||||
|
||||
mongodb@7.2.0:
|
||||
resolution: {integrity: sha512-F/2+BMZtLVhY30ioZp0dAmZ+IRZMBqI+nrv6t5+9/1AIwCa8sMRC3jBf81lpxMhnZgqq8CoUD503Z1oZWq1/sw==}
|
||||
mongodb@7.5.0:
|
||||
resolution: {integrity: sha512-5FnrEDLnvp6ycUOGLNLLU33BfCx2qmp2mJjGPDwKLruYsVzXVSK5fsGpoDXvsXJwBfBsD7ebMRdawbDxC2814g==}
|
||||
engines: {node: '>=20.19.0'}
|
||||
peerDependencies:
|
||||
'@aws-sdk/credential-providers': ^3.806.0
|
||||
'@mongodb-js/zstd': ^7.0.0
|
||||
gcp-metadata: ^7.0.1
|
||||
kerberos: ^7.0.0
|
||||
mongodb-client-encryption: '>=7.0.0 <7.1.0'
|
||||
mongodb-client-encryption: ^7.2.0
|
||||
snappy: ^7.3.2
|
||||
socks: ^2.8.6
|
||||
peerDependenciesMeta:
|
||||
@@ -1534,8 +1561,8 @@ packages:
|
||||
socks:
|
||||
optional: true
|
||||
|
||||
mongoose@9.7.0:
|
||||
resolution: {integrity: sha512-pkrLZ6U41pD4Ai0ju/FYL7o5I5k+rV3RZINQTG937hbhnLGKRuqqYm1Dlt/kTQ+M4FHijzV6JawzsdHKRGt7QA==}
|
||||
mongoose@9.8.0:
|
||||
resolution: {integrity: sha512-PDGx3XACxrBQyWf4YT+5s1Xsx19x84UWGlRVIza4i9RG6qKjGcoG7odotT6uquR6YoaDMTZ6ZZc/jMXLrNPyyA==}
|
||||
engines: {node: '>=20.19.0'}
|
||||
|
||||
mpath@0.9.0:
|
||||
@@ -1556,8 +1583,8 @@ packages:
|
||||
mz@2.7.0:
|
||||
resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==}
|
||||
|
||||
nanoid@3.3.12:
|
||||
resolution: {integrity: sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==}
|
||||
nanoid@3.3.16:
|
||||
resolution: {integrity: sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==}
|
||||
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
|
||||
hasBin: true
|
||||
|
||||
@@ -1639,6 +1666,9 @@ packages:
|
||||
resolution: {integrity: sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
packet-reader@1.0.0:
|
||||
resolution: {integrity: sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==}
|
||||
|
||||
pathe@2.0.3:
|
||||
resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==}
|
||||
|
||||
@@ -1672,6 +1702,15 @@ packages:
|
||||
resolution: {integrity: sha512-o2XFanIMy/3+mThw69O8d4n1E5zsLhdO+OPqswezu7Z5ekP4hYDqlDjlmOpYMbzY2Br0ufCwJLdDIXeNVwcWFg==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
pg@8.11.3:
|
||||
resolution: {integrity: sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==}
|
||||
engines: {node: '>= 8.0.0'}
|
||||
peerDependencies:
|
||||
pg-native: '>=3.0.1'
|
||||
peerDependenciesMeta:
|
||||
pg-native:
|
||||
optional: true
|
||||
|
||||
pg@8.21.0:
|
||||
resolution: {integrity: sha512-AUP1EYJuHraQGsVoCQVIcM7TEJVGtDzxWtGFZd8rds9d+CCXlU5Js1rYgfLNvxy9iJrpHjGrRjoi/3BT9fRyiA==}
|
||||
engines: {node: '>= 16.0.0'}
|
||||
@@ -1707,7 +1746,7 @@ packages:
|
||||
engines: {node: '>= 18'}
|
||||
peerDependencies:
|
||||
jiti: '>=1.21.0'
|
||||
postcss: '>=8.0.9'
|
||||
postcss: '>=8.5.18 <9.0.0'
|
||||
tsx: ^4.8.1
|
||||
yaml: ^2.4.2
|
||||
peerDependenciesMeta:
|
||||
@@ -1720,8 +1759,8 @@ packages:
|
||||
yaml:
|
||||
optional: true
|
||||
|
||||
postcss@8.5.15:
|
||||
resolution: {integrity: sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==}
|
||||
postcss@8.5.23:
|
||||
resolution: {integrity: sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg==}
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
|
||||
postgres-array@2.0.0:
|
||||
@@ -1769,8 +1808,8 @@ packages:
|
||||
resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==}
|
||||
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
|
||||
|
||||
protobufjs@7.6.3:
|
||||
resolution: {integrity: sha512-+k0vdJKNdW+Vu+dYe8tZA/VvQb6XKNWexC6URwBFXxNnjLJz9nQJCemGyNgRAWD+B7+nGNc9qMPGwcD7s4nzUw==}
|
||||
protobufjs@7.6.5:
|
||||
resolution: {integrity: sha512-/FPD0nUc9jH6rfFjji9IBqOz4pcSE3CsT1m7Ep6Mdb0LxSUMj8hgl6GomOvZzpNpAqqGaXA0P3VSrZLFzIhQrw==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
|
||||
proxy-from-env@2.1.0:
|
||||
@@ -1965,7 +2004,7 @@ packages:
|
||||
peerDependencies:
|
||||
'@microsoft/api-extractor': ^7.36.0
|
||||
'@swc/core': ^1
|
||||
postcss: ^8.4.12
|
||||
postcss: '>=8.5.18 <9.0.0'
|
||||
typescript: '>=4.5.0'
|
||||
peerDependenciesMeta:
|
||||
'@microsoft/api-extractor':
|
||||
@@ -2408,7 +2447,7 @@ snapshots:
|
||||
dependencies:
|
||||
google-auth-library: 10.7.0
|
||||
p-retry: 4.6.2
|
||||
protobufjs: 7.6.3
|
||||
protobufjs: 7.6.5
|
||||
ws: 8.21.0
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
@@ -2498,8 +2537,6 @@ snapshots:
|
||||
|
||||
'@protobufjs/float@1.0.2': {}
|
||||
|
||||
'@protobufjs/inquire@1.1.2': {}
|
||||
|
||||
'@protobufjs/path@1.1.2': {}
|
||||
|
||||
'@protobufjs/pool@1.1.0': {}
|
||||
@@ -2869,7 +2906,7 @@ snapshots:
|
||||
|
||||
asynckit@0.4.0: {}
|
||||
|
||||
axios@1.17.0:
|
||||
axios@1.18.1:
|
||||
dependencies:
|
||||
follow-redirects: 1.16.0
|
||||
form-data: 4.0.6
|
||||
@@ -2908,6 +2945,8 @@ snapshots:
|
||||
|
||||
buffer-equal-constant-time@1.0.1: {}
|
||||
|
||||
buffer-writer@2.0.0: {}
|
||||
|
||||
buffer@5.7.1:
|
||||
dependencies:
|
||||
base64-js: 1.5.1
|
||||
@@ -3477,7 +3516,7 @@ snapshots:
|
||||
crypt: 0.0.2
|
||||
is-buffer: 1.1.6
|
||||
|
||||
mem0ai@3.0.7(@anthropic-ai/sdk@0.40.1)(@azure/identity@4.13.1)(@azure/search-documents@12.2.0)(@cloudflare/workers-types@4.20260610.1)(@google/genai@1.52.0)(@langchain/core@1.1.48(openai@4.104.0(ws@8.21.0)(zod@3.25.76))(ws@8.21.0))(@mistralai/mistralai@1.15.1)(@qdrant/js-client-rest@1.18.0(typescript@5.9.3))(@supabase/supabase-js@2.108.1)(@types/jest@29.5.14)(@types/pg@8.11.0)(better-sqlite3@12.10.0)(cloudflare@4.5.0)(compromise@14.15.1)(groq-sdk@0.3.0)(natural@8.1.1)(ollama@0.5.18)(pg@8.21.0)(redis@5.12.1)(ws@8.21.0):
|
||||
mem0ai@3.0.7(@anthropic-ai/sdk@0.40.1)(@azure/identity@4.13.1)(@azure/search-documents@12.2.0)(@cloudflare/workers-types@4.20260610.1)(@google/genai@1.52.0)(@langchain/core@1.1.48(openai@4.104.0(ws@8.21.0)(zod@3.25.76))(ws@8.21.0))(@mistralai/mistralai@1.15.1)(@qdrant/js-client-rest@1.18.0(typescript@5.9.3))(@supabase/supabase-js@2.108.1)(@types/jest@29.5.14)(@types/pg@8.11.0)(better-sqlite3@12.10.0)(cloudflare@4.5.0)(compromise@14.15.1)(groq-sdk@0.3.0)(natural@8.1.1)(ollama@0.5.18)(pg@8.11.3)(redis@5.12.1)(ws@8.21.0):
|
||||
dependencies:
|
||||
'@anthropic-ai/sdk': 0.40.1
|
||||
'@azure/identity': 4.13.1
|
||||
@@ -3490,7 +3529,7 @@ snapshots:
|
||||
'@supabase/supabase-js': 2.108.1
|
||||
'@types/jest': 29.5.14
|
||||
'@types/pg': 8.11.0
|
||||
axios: 1.17.0
|
||||
axios: 1.18.1
|
||||
better-sqlite3: 12.10.0
|
||||
cloudflare: 4.5.0
|
||||
compromise: 14.15.1
|
||||
@@ -3498,7 +3537,7 @@ snapshots:
|
||||
natural: 8.1.1
|
||||
ollama: 0.5.18
|
||||
openai: 4.104.0(ws@8.21.0)(zod@3.25.76)
|
||||
pg: 8.21.0
|
||||
pg: 8.11.3
|
||||
redis: 5.12.1
|
||||
uuid: 14.0.0
|
||||
zod: 3.25.76
|
||||
@@ -3541,16 +3580,17 @@ snapshots:
|
||||
'@types/whatwg-url': 13.0.0
|
||||
whatwg-url: 14.2.0
|
||||
|
||||
mongodb@7.2.0:
|
||||
mongodb@7.5.0:
|
||||
dependencies:
|
||||
'@mongodb-js/saslprep': 1.4.11
|
||||
bson: 7.2.0
|
||||
mongodb-connection-string-url: 7.0.1
|
||||
|
||||
mongoose@9.7.0:
|
||||
mongoose@9.8.0:
|
||||
dependencies:
|
||||
'@standard-schema/spec': 1.1.0
|
||||
kareem: 3.3.0
|
||||
mongodb: 7.2.0
|
||||
mongodb: 7.5.0
|
||||
mpath: 0.9.0
|
||||
mquery: 6.0.0
|
||||
ms: 2.1.3
|
||||
@@ -3578,7 +3618,7 @@ snapshots:
|
||||
object-assign: 4.1.1
|
||||
thenify-all: 1.6.0
|
||||
|
||||
nanoid@3.3.12: {}
|
||||
nanoid@3.3.16: {}
|
||||
|
||||
napi-build-utils@2.0.0: {}
|
||||
|
||||
@@ -3589,7 +3629,7 @@ snapshots:
|
||||
apparatus: 0.0.10
|
||||
dotenv: 17.4.2
|
||||
memjs: 1.3.2
|
||||
mongoose: 9.7.0
|
||||
mongoose: 9.8.0
|
||||
pg: 8.21.0
|
||||
redis: 5.12.1
|
||||
safe-stable-stringify: 2.5.0
|
||||
@@ -3678,6 +3718,8 @@ snapshots:
|
||||
dependencies:
|
||||
p-finally: 1.0.0
|
||||
|
||||
packet-reader@1.0.0: {}
|
||||
|
||||
pathe@2.0.3: {}
|
||||
|
||||
pg-cloudflare@1.4.0:
|
||||
@@ -3689,6 +3731,10 @@ snapshots:
|
||||
|
||||
pg-numeric@1.0.2: {}
|
||||
|
||||
pg-pool@3.14.0(pg@8.11.3):
|
||||
dependencies:
|
||||
pg: 8.11.3
|
||||
|
||||
pg-pool@3.14.0(pg@8.21.0):
|
||||
dependencies:
|
||||
pg: 8.21.0
|
||||
@@ -3713,6 +3759,18 @@ snapshots:
|
||||
postgres-interval: 3.0.0
|
||||
postgres-range: 1.1.4
|
||||
|
||||
pg@8.11.3:
|
||||
dependencies:
|
||||
buffer-writer: 2.0.0
|
||||
packet-reader: 1.0.0
|
||||
pg-connection-string: 2.13.0
|
||||
pg-pool: 3.14.0(pg@8.11.3)
|
||||
pg-protocol: 1.14.0
|
||||
pg-types: 2.2.0
|
||||
pgpass: 1.0.5
|
||||
optionalDependencies:
|
||||
pg-cloudflare: 1.4.0
|
||||
|
||||
pg@8.21.0:
|
||||
dependencies:
|
||||
pg-connection-string: 2.13.0
|
||||
@@ -3741,15 +3799,15 @@ snapshots:
|
||||
mlly: 1.8.2
|
||||
pathe: 2.0.3
|
||||
|
||||
postcss-load-config@6.0.1(postcss@8.5.15):
|
||||
postcss-load-config@6.0.1(postcss@8.5.23):
|
||||
dependencies:
|
||||
lilconfig: 3.1.3
|
||||
optionalDependencies:
|
||||
postcss: 8.5.15
|
||||
postcss: 8.5.23
|
||||
|
||||
postcss@8.5.15:
|
||||
postcss@8.5.23:
|
||||
dependencies:
|
||||
nanoid: 3.3.12
|
||||
nanoid: 3.3.16
|
||||
picocolors: 1.1.1
|
||||
source-map-js: 1.2.1
|
||||
|
||||
@@ -3796,7 +3854,7 @@ snapshots:
|
||||
ansi-styles: 5.2.0
|
||||
react-is: 18.3.1
|
||||
|
||||
protobufjs@7.6.3:
|
||||
protobufjs@7.6.5:
|
||||
dependencies:
|
||||
'@protobufjs/aspromise': 1.1.2
|
||||
'@protobufjs/base64': 1.1.2
|
||||
@@ -3804,7 +3862,6 @@ snapshots:
|
||||
'@protobufjs/eventemitter': 1.1.1
|
||||
'@protobufjs/fetch': 1.1.1
|
||||
'@protobufjs/float': 1.0.2
|
||||
'@protobufjs/inquire': 1.1.2
|
||||
'@protobufjs/path': 1.1.2
|
||||
'@protobufjs/pool': 1.1.0
|
||||
'@protobufjs/utf8': 1.1.1
|
||||
@@ -4022,7 +4079,7 @@ snapshots:
|
||||
|
||||
tslib@2.8.1: {}
|
||||
|
||||
tsup@8.5.1(postcss@8.5.15)(typescript@5.9.3):
|
||||
tsup@8.5.1(postcss@8.5.23)(typescript@5.9.3):
|
||||
dependencies:
|
||||
bundle-require: 5.1.0(esbuild@0.28.1)
|
||||
cac: 6.7.14
|
||||
@@ -4033,7 +4090,7 @@ snapshots:
|
||||
fix-dts-default-cjs-exports: 1.0.1
|
||||
joycon: 3.1.1
|
||||
picocolors: 1.1.1
|
||||
postcss-load-config: 6.0.1(postcss@8.5.15)
|
||||
postcss-load-config: 6.0.1(postcss@8.5.23)
|
||||
resolve-from: 5.0.0
|
||||
rollup: 4.61.1
|
||||
source-map: 0.7.6
|
||||
@@ -4042,7 +4099,7 @@ snapshots:
|
||||
tinyglobby: 0.2.17
|
||||
tree-kill: 1.2.2
|
||||
optionalDependencies:
|
||||
postcss: 8.5.15
|
||||
postcss: 8.5.23
|
||||
typescript: 5.9.3
|
||||
transitivePeerDependencies:
|
||||
- jiti
|
||||
@@ -4076,7 +4133,7 @@ snapshots:
|
||||
dependencies:
|
||||
lightningcss: 1.32.0
|
||||
picomatch: 4.0.4
|
||||
postcss: 8.5.15
|
||||
postcss: 8.5.23
|
||||
rolldown: 1.0.3
|
||||
tinyglobby: 0.2.17
|
||||
optionalDependencies:
|
||||
|
||||
@@ -14,7 +14,7 @@ onlyBuiltDependencies:
|
||||
|
||||
overrides:
|
||||
"form-data@<4.0.6": ">=4.0.6"
|
||||
"protobufjs@<7.5.5": "^7.5.5"
|
||||
"protobufjs@<7.6.5": ">=7.6.5 <8.0.0"
|
||||
"vite": "^8.0.5"
|
||||
"langsmith@<0.6.0": "^0.6.0"
|
||||
"picomatch@<2.3.2": "^2.3.2"
|
||||
@@ -22,3 +22,6 @@ overrides:
|
||||
"uuid@<11.1.1": ">=11.1.1"
|
||||
"esbuild": ">=0.28.1"
|
||||
"undici@<6.27.0": ">=6.27.0 <8.0.0"
|
||||
"axios@<1.18.0": ">=1.18.0 <2.0.0"
|
||||
"postcss@<8.5.18": ">=8.5.18 <9.0.0"
|
||||
"mongoose@>=9.0.0 <9.7.2": ">=9.7.2 <10.0.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mem0/pi-agent-plugin",
|
||||
"version": "0.1.3",
|
||||
"version": "0.1.4",
|
||||
"type": "module",
|
||||
"description": "Mem0 memory extension for Pi Agent persistent, scoped, semantic memory across sessions and projects",
|
||||
"license": "Apache-2.0",
|
||||
@@ -74,7 +74,12 @@
|
||||
"uuid@<11.1.1": ">=11.1.1",
|
||||
"esbuild": ">=0.28.1",
|
||||
"undici@<6.27.0": ">=6.27.0 <8.0.0",
|
||||
"undici@>=8.0.0 <8.5.0": ">=8.5.0"
|
||||
"undici@>=8.0.0 <8.5.0": ">=8.5.0",
|
||||
"axios@<1.18.0": ">=1.18.0 <2.0.0",
|
||||
"brace-expansion@>=3.0.0 <5.0.8": ">=5.0.8 <6.0.0",
|
||||
"postcss@<8.5.18": ">=8.5.18 <9.0.0",
|
||||
"mongoose@>=9.0.0 <9.7.2": ">=9.7.2 <10.0.0",
|
||||
"protobufjs@<7.6.5": ">=7.6.5 <8.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+44
-44
@@ -10,6 +10,11 @@ overrides:
|
||||
esbuild: '>=0.28.1'
|
||||
undici@<6.27.0: '>=6.27.0 <8.0.0'
|
||||
undici@>=8.0.0 <8.5.0: '>=8.5.0'
|
||||
axios@<1.18.0: '>=1.18.0 <2.0.0'
|
||||
brace-expansion@>=3.0.0 <5.0.8: '>=5.0.8 <6.0.0'
|
||||
postcss@<8.5.18: '>=8.5.18 <9.0.0'
|
||||
mongoose@>=9.0.0 <9.7.2: '>=9.7.2 <10.0.0'
|
||||
protobufjs@<7.6.5: '>=7.6.5 <8.0.0'
|
||||
|
||||
importers:
|
||||
|
||||
@@ -30,7 +35,7 @@ importers:
|
||||
version: 25.9.2
|
||||
tsup:
|
||||
specifier: ^8.5.0
|
||||
version: 8.5.1(jiti@2.7.0)(postcss@8.5.15)(typescript@6.0.3)(yaml@2.9.0)
|
||||
version: 8.5.1(jiti@2.7.0)(postcss@8.5.23)(typescript@6.0.3)(yaml@2.9.0)
|
||||
typebox:
|
||||
specifier: ^1.2.3
|
||||
version: 1.2.8
|
||||
@@ -555,9 +560,6 @@ packages:
|
||||
'@protobufjs/float@1.0.2':
|
||||
resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==}
|
||||
|
||||
'@protobufjs/inquire@1.1.2':
|
||||
resolution: {integrity: sha512-pa0vFRuws4wkvaXKK1uXZMAwAX4/t8ANaJo45iw/oQHNQ9q5xUzwgFmVJGXiga2BeN+zpX7Vf9vmsiIa2J+MUw==}
|
||||
|
||||
'@protobufjs/path@1.1.2':
|
||||
resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==}
|
||||
|
||||
@@ -1064,8 +1066,8 @@ packages:
|
||||
asynckit@0.4.0:
|
||||
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
|
||||
|
||||
axios@1.17.0:
|
||||
resolution: {integrity: sha512-J8SwNxprqqpbfenehxWYXE7CW+wM1BB4w3+N+g+/Wx40xM4rsLrfPmHHxSWIxJLYDgSY/HqlFPIYb2/S3rxafw==}
|
||||
axios@1.18.1:
|
||||
resolution: {integrity: sha512-3nTvFlvpn9Zu/RkHUqtc7/+al4UpRW5az71ap5zccp6e8RAYEzhMTecX8Dz1wWDYrPpUoB1HAQEGEAEvUr7S9g==}
|
||||
|
||||
balanced-match@4.0.4:
|
||||
resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==}
|
||||
@@ -1093,9 +1095,9 @@ packages:
|
||||
bowser@2.14.1:
|
||||
resolution: {integrity: sha512-tzPjzCxygAKWFOJP011oxFHs57HzIhOEracIgAePE4pqB3LikALKnSzUyU4MGs9/iCEUuHlAJTjTc5M+u7YEGg==}
|
||||
|
||||
brace-expansion@5.0.6:
|
||||
resolution: {integrity: sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==}
|
||||
engines: {node: 18 || 20 || >=22}
|
||||
brace-expansion@5.0.8:
|
||||
resolution: {integrity: sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==}
|
||||
engines: {node: 20 || >=22}
|
||||
|
||||
braces@3.0.3:
|
||||
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
|
||||
@@ -1793,15 +1795,15 @@ packages:
|
||||
resolution: {integrity: sha512-h0AZ9A7IDVwwHyMxmdMXKy+9oNlF0zFoahHiX3vQ8e3KFcSP3VmsmfvtRSuLPxmyv2vjIDxqty8smTgie/SNRQ==}
|
||||
engines: {node: '>=20.19.0'}
|
||||
|
||||
mongodb@7.2.0:
|
||||
resolution: {integrity: sha512-F/2+BMZtLVhY30ioZp0dAmZ+IRZMBqI+nrv6t5+9/1AIwCa8sMRC3jBf81lpxMhnZgqq8CoUD503Z1oZWq1/sw==}
|
||||
mongodb@7.5.0:
|
||||
resolution: {integrity: sha512-5FnrEDLnvp6ycUOGLNLLU33BfCx2qmp2mJjGPDwKLruYsVzXVSK5fsGpoDXvsXJwBfBsD7ebMRdawbDxC2814g==}
|
||||
engines: {node: '>=20.19.0'}
|
||||
peerDependencies:
|
||||
'@aws-sdk/credential-providers': ^3.806.0
|
||||
'@mongodb-js/zstd': ^7.0.0
|
||||
gcp-metadata: ^7.0.1
|
||||
kerberos: ^7.0.0
|
||||
mongodb-client-encryption: '>=7.0.0 <7.1.0'
|
||||
mongodb-client-encryption: ^7.2.0
|
||||
snappy: ^7.3.2
|
||||
socks: ^2.8.6
|
||||
peerDependenciesMeta:
|
||||
@@ -1820,8 +1822,8 @@ packages:
|
||||
socks:
|
||||
optional: true
|
||||
|
||||
mongoose@9.7.0:
|
||||
resolution: {integrity: sha512-pkrLZ6U41pD4Ai0ju/FYL7o5I5k+rV3RZINQTG937hbhnLGKRuqqYm1Dlt/kTQ+M4FHijzV6JawzsdHKRGt7QA==}
|
||||
mongoose@9.8.0:
|
||||
resolution: {integrity: sha512-PDGx3XACxrBQyWf4YT+5s1Xsx19x84UWGlRVIza4i9RG6qKjGcoG7odotT6uquR6YoaDMTZ6ZZc/jMXLrNPyyA==}
|
||||
engines: {node: '>=20.19.0'}
|
||||
|
||||
mpath@0.9.0:
|
||||
@@ -1842,8 +1844,8 @@ packages:
|
||||
mz@2.7.0:
|
||||
resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==}
|
||||
|
||||
nanoid@3.3.12:
|
||||
resolution: {integrity: sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==}
|
||||
nanoid@3.3.16:
|
||||
resolution: {integrity: sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==}
|
||||
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
|
||||
hasBin: true
|
||||
|
||||
@@ -2032,7 +2034,7 @@ packages:
|
||||
engines: {node: '>= 18'}
|
||||
peerDependencies:
|
||||
jiti: '>=1.21.0'
|
||||
postcss: '>=8.0.9'
|
||||
postcss: '>=8.5.18 <9.0.0'
|
||||
tsx: ^4.8.1
|
||||
yaml: ^2.4.2
|
||||
peerDependenciesMeta:
|
||||
@@ -2045,8 +2047,8 @@ packages:
|
||||
yaml:
|
||||
optional: true
|
||||
|
||||
postcss@8.5.15:
|
||||
resolution: {integrity: sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==}
|
||||
postcss@8.5.23:
|
||||
resolution: {integrity: sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg==}
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
|
||||
postgres-array@2.0.0:
|
||||
@@ -2097,8 +2099,8 @@ packages:
|
||||
proper-lockfile@4.1.2:
|
||||
resolution: {integrity: sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==}
|
||||
|
||||
protobufjs@7.6.3:
|
||||
resolution: {integrity: sha512-+k0vdJKNdW+Vu+dYe8tZA/VvQb6XKNWexC6URwBFXxNnjLJz9nQJCemGyNgRAWD+B7+nGNc9qMPGwcD7s4nzUw==}
|
||||
protobufjs@7.6.5:
|
||||
resolution: {integrity: sha512-/FPD0nUc9jH6rfFjji9IBqOz4pcSE3CsT1m7Ep6Mdb0LxSUMj8hgl6GomOvZzpNpAqqGaXA0P3VSrZLFzIhQrw==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
|
||||
proxy-from-env@2.1.0:
|
||||
@@ -2314,7 +2316,7 @@ packages:
|
||||
peerDependencies:
|
||||
'@microsoft/api-extractor': ^7.36.0
|
||||
'@swc/core': ^1
|
||||
postcss: ^8.4.12
|
||||
postcss: '>=8.5.18 <9.0.0'
|
||||
typescript: '>=4.5.0'
|
||||
peerDependenciesMeta:
|
||||
'@microsoft/api-extractor':
|
||||
@@ -3055,7 +3057,7 @@ snapshots:
|
||||
dependencies:
|
||||
google-auth-library: 10.7.0
|
||||
p-retry: 4.6.2
|
||||
protobufjs: 7.6.3
|
||||
protobufjs: 7.6.5
|
||||
ws: 8.21.0
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
@@ -3191,8 +3193,6 @@ snapshots:
|
||||
|
||||
'@protobufjs/float@1.0.2': {}
|
||||
|
||||
'@protobufjs/inquire@1.1.2': {}
|
||||
|
||||
'@protobufjs/path@1.1.2': {}
|
||||
|
||||
'@protobufjs/pool@1.1.0': {}
|
||||
@@ -3598,7 +3598,7 @@ snapshots:
|
||||
|
||||
asynckit@0.4.0: {}
|
||||
|
||||
axios@1.17.0:
|
||||
axios@1.18.1:
|
||||
dependencies:
|
||||
follow-redirects: 1.16.0
|
||||
form-data: 4.0.6
|
||||
@@ -3633,7 +3633,7 @@ snapshots:
|
||||
|
||||
bowser@2.14.1: {}
|
||||
|
||||
brace-expansion@5.0.6:
|
||||
brace-expansion@5.0.8:
|
||||
dependencies:
|
||||
balanced-match: 4.0.4
|
||||
|
||||
@@ -4253,7 +4253,7 @@ snapshots:
|
||||
'@supabase/supabase-js': 2.108.1
|
||||
'@types/jest': 29.5.14
|
||||
'@types/pg': 8.11.0
|
||||
axios: 1.17.0
|
||||
axios: 1.18.1
|
||||
better-sqlite3: 12.10.0
|
||||
cloudflare: 4.5.0
|
||||
compromise: 14.15.1
|
||||
@@ -4290,7 +4290,7 @@ snapshots:
|
||||
|
||||
minimatch@10.2.5:
|
||||
dependencies:
|
||||
brace-expansion: 5.0.6
|
||||
brace-expansion: 5.0.8
|
||||
|
||||
minimist@1.2.8: {}
|
||||
|
||||
@@ -4310,16 +4310,17 @@ snapshots:
|
||||
'@types/whatwg-url': 13.0.0
|
||||
whatwg-url: 14.2.0
|
||||
|
||||
mongodb@7.2.0:
|
||||
mongodb@7.5.0:
|
||||
dependencies:
|
||||
'@mongodb-js/saslprep': 1.4.11
|
||||
bson: 7.2.0
|
||||
mongodb-connection-string-url: 7.0.1
|
||||
|
||||
mongoose@9.7.0:
|
||||
mongoose@9.8.0:
|
||||
dependencies:
|
||||
'@standard-schema/spec': 1.1.0
|
||||
kareem: 3.3.0
|
||||
mongodb: 7.2.0
|
||||
mongodb: 7.5.0
|
||||
mpath: 0.9.0
|
||||
mquery: 6.0.0
|
||||
ms: 2.1.3
|
||||
@@ -4347,7 +4348,7 @@ snapshots:
|
||||
object-assign: 4.1.1
|
||||
thenify-all: 1.6.0
|
||||
|
||||
nanoid@3.3.12: {}
|
||||
nanoid@3.3.16: {}
|
||||
|
||||
napi-build-utils@2.0.0: {}
|
||||
|
||||
@@ -4358,7 +4359,7 @@ snapshots:
|
||||
apparatus: 0.0.10
|
||||
dotenv: 17.4.2
|
||||
memjs: 1.3.2
|
||||
mongoose: 9.7.0
|
||||
mongoose: 9.8.0
|
||||
pg: 8.21.0
|
||||
redis: 5.12.1
|
||||
safe-stable-stringify: 2.5.0
|
||||
@@ -4544,17 +4545,17 @@ snapshots:
|
||||
mlly: 1.8.2
|
||||
pathe: 2.0.3
|
||||
|
||||
postcss-load-config@6.0.1(jiti@2.7.0)(postcss@8.5.15)(yaml@2.9.0):
|
||||
postcss-load-config@6.0.1(jiti@2.7.0)(postcss@8.5.23)(yaml@2.9.0):
|
||||
dependencies:
|
||||
lilconfig: 3.1.3
|
||||
optionalDependencies:
|
||||
jiti: 2.7.0
|
||||
postcss: 8.5.15
|
||||
postcss: 8.5.23
|
||||
yaml: 2.9.0
|
||||
|
||||
postcss@8.5.15:
|
||||
postcss@8.5.23:
|
||||
dependencies:
|
||||
nanoid: 3.3.12
|
||||
nanoid: 3.3.16
|
||||
picocolors: 1.1.1
|
||||
source-map-js: 1.2.1
|
||||
|
||||
@@ -4607,7 +4608,7 @@ snapshots:
|
||||
retry: 0.12.0
|
||||
signal-exit: 3.0.7
|
||||
|
||||
protobufjs@7.6.3:
|
||||
protobufjs@7.6.5:
|
||||
dependencies:
|
||||
'@protobufjs/aspromise': 1.1.2
|
||||
'@protobufjs/base64': 1.1.2
|
||||
@@ -4615,7 +4616,6 @@ snapshots:
|
||||
'@protobufjs/eventemitter': 1.1.1
|
||||
'@protobufjs/fetch': 1.1.1
|
||||
'@protobufjs/float': 1.0.2
|
||||
'@protobufjs/inquire': 1.1.2
|
||||
'@protobufjs/path': 1.1.2
|
||||
'@protobufjs/pool': 1.1.0
|
||||
'@protobufjs/utf8': 1.1.1
|
||||
@@ -4849,7 +4849,7 @@ snapshots:
|
||||
|
||||
tslib@2.8.1: {}
|
||||
|
||||
tsup@8.5.1(jiti@2.7.0)(postcss@8.5.15)(typescript@6.0.3)(yaml@2.9.0):
|
||||
tsup@8.5.1(jiti@2.7.0)(postcss@8.5.23)(typescript@6.0.3)(yaml@2.9.0):
|
||||
dependencies:
|
||||
bundle-require: 5.1.0(esbuild@0.28.1)
|
||||
cac: 6.7.14
|
||||
@@ -4860,7 +4860,7 @@ snapshots:
|
||||
fix-dts-default-cjs-exports: 1.0.1
|
||||
joycon: 3.1.1
|
||||
picocolors: 1.1.1
|
||||
postcss-load-config: 6.0.1(jiti@2.7.0)(postcss@8.5.15)(yaml@2.9.0)
|
||||
postcss-load-config: 6.0.1(jiti@2.7.0)(postcss@8.5.23)(yaml@2.9.0)
|
||||
resolve-from: 5.0.0
|
||||
rollup: 4.61.1
|
||||
source-map: 0.7.6
|
||||
@@ -4869,7 +4869,7 @@ snapshots:
|
||||
tinyglobby: 0.2.17
|
||||
tree-kill: 1.2.2
|
||||
optionalDependencies:
|
||||
postcss: 8.5.15
|
||||
postcss: 8.5.23
|
||||
typescript: 6.0.3
|
||||
transitivePeerDependencies:
|
||||
- jiti
|
||||
@@ -4909,7 +4909,7 @@ snapshots:
|
||||
dependencies:
|
||||
lightningcss: 1.32.0
|
||||
picomatch: 4.0.4
|
||||
postcss: 8.5.15
|
||||
postcss: 8.5.23
|
||||
rolldown: 1.0.3
|
||||
tinyglobby: 0.2.17
|
||||
optionalDependencies:
|
||||
|
||||
@@ -7,3 +7,8 @@ overrides:
|
||||
"esbuild": ">=0.28.1"
|
||||
"undici@<6.27.0": ">=6.27.0 <8.0.0"
|
||||
"undici@>=8.0.0 <8.5.0": ">=8.5.0"
|
||||
"axios@<1.18.0": ">=1.18.0 <2.0.0"
|
||||
"brace-expansion@>=3.0.0 <5.0.8": ">=5.0.8 <6.0.0"
|
||||
"postcss@<8.5.18": ">=8.5.18 <9.0.0"
|
||||
"mongoose@>=9.0.0 <9.7.2": ">=9.7.2 <10.0.0"
|
||||
"protobufjs@<7.6.5": ">=7.6.5 <8.0.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mem0/vercel-ai-provider",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"description": "Vercel AI Provider for providing memory to LLMs",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
@@ -80,13 +80,16 @@
|
||||
],
|
||||
"overrides": {
|
||||
"glob@>=10.2.0 <10.5.0": "^10.5.0",
|
||||
"js-yaml@<=4.1.1": ">=4.2.0",
|
||||
"minimatch@<3.1.3": "^3.1.3",
|
||||
"minimatch@>=5.0.0 <5.1.8": "^5.1.8",
|
||||
"minimatch@>=9.0.0 <9.0.7": "^9.0.7",
|
||||
"picomatch@<2.3.2": "^2.3.2",
|
||||
"rollup@>=4.0.0 <4.59.0": "^4.59.0",
|
||||
"esbuild": ">=0.28.1"
|
||||
"esbuild": ">=0.28.1",
|
||||
"brace-expansion@<1.1.16": ">=1.1.16 <2.0.0",
|
||||
"brace-expansion@>=3.0.0 <5.0.8": ">=5.0.8 <6.0.0",
|
||||
"js-yaml@<3.15.0": ">=3.15.0 <4.0.0",
|
||||
"js-yaml@>=4.0.0 <4.3.0": ">=4.3.0 <5.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+36
-18
@@ -6,13 +6,16 @@ settings:
|
||||
|
||||
overrides:
|
||||
glob@>=10.2.0 <10.5.0: ^10.5.0
|
||||
js-yaml@<=4.1.1: '>=4.2.0'
|
||||
minimatch@<3.1.3: ^3.1.3
|
||||
minimatch@>=5.0.0 <5.1.8: ^5.1.8
|
||||
minimatch@>=9.0.0 <9.0.7: ^9.0.7
|
||||
picomatch@<2.3.2: ^2.3.2
|
||||
rollup@>=4.0.0 <4.59.0: ^4.59.0
|
||||
esbuild: '>=0.28.1'
|
||||
brace-expansion@<1.1.16: '>=1.1.16 <2.0.0'
|
||||
brace-expansion@>=3.0.0 <5.0.8: '>=5.0.8 <6.0.0'
|
||||
js-yaml@<3.15.0: '>=3.15.0 <4.0.0'
|
||||
js-yaml@>=4.0.0 <4.3.0: '>=4.3.0 <5.0.0'
|
||||
|
||||
importers:
|
||||
|
||||
@@ -794,8 +797,8 @@ packages:
|
||||
arg@4.1.3:
|
||||
resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
|
||||
|
||||
argparse@2.0.1:
|
||||
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
|
||||
argparse@1.0.10:
|
||||
resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==}
|
||||
|
||||
babel-jest@29.7.0:
|
||||
resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==}
|
||||
@@ -838,12 +841,12 @@ packages:
|
||||
resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
brace-expansion@1.1.15:
|
||||
resolution: {integrity: sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==}
|
||||
brace-expansion@1.1.16:
|
||||
resolution: {integrity: sha512-IDw48K2/2kRkg9LdJxurvq3lV3aBgq0REY89duEqFRthjlPdXHKMj7EnQOXVckxzgisinf3nHfrcE2FufFLXMw==}
|
||||
|
||||
brace-expansion@5.0.6:
|
||||
resolution: {integrity: sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==}
|
||||
engines: {node: 18 || 20 || >=22}
|
||||
brace-expansion@5.0.8:
|
||||
resolution: {integrity: sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==}
|
||||
engines: {node: 20 || >=22}
|
||||
|
||||
braces@3.0.3:
|
||||
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
|
||||
@@ -1026,6 +1029,11 @@ packages:
|
||||
resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
esprima@4.0.1:
|
||||
resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}
|
||||
engines: {node: '>=4'}
|
||||
hasBin: true
|
||||
|
||||
eventsource-parser@3.1.0:
|
||||
resolution: {integrity: sha512-kJezFj9YFAMLeORyi7aCLxLbD5/qWMQnoMVlVPyHIll7lgRJCc3JVln9Vgl9nwQi0YkMnhdGTMNn7CkRRAptMg==}
|
||||
engines: {node: '>=18.0.0'}
|
||||
@@ -1347,8 +1355,8 @@ packages:
|
||||
js-tokens@4.0.0:
|
||||
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
|
||||
|
||||
js-yaml@4.2.0:
|
||||
resolution: {integrity: sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==}
|
||||
js-yaml@3.15.0:
|
||||
resolution: {integrity: sha512-ttBQIIQPDeLjpPOohtUdXuXUVoA2uIB6fEH9HyJ7234s5mBJ5wTx20njxplLZQgLaOfpmPQA7X2t5AX6tIPbog==}
|
||||
hasBin: true
|
||||
|
||||
jsesc@3.1.0:
|
||||
@@ -1650,6 +1658,9 @@ packages:
|
||||
resolution: {integrity: sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==}
|
||||
engines: {node: '>= 12'}
|
||||
|
||||
sprintf-js@1.0.3:
|
||||
resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==}
|
||||
|
||||
stack-utils@2.0.6:
|
||||
resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==}
|
||||
engines: {node: '>=10'}
|
||||
@@ -2219,7 +2230,7 @@ snapshots:
|
||||
camelcase: 5.3.1
|
||||
find-up: 4.1.0
|
||||
get-package-type: 0.1.0
|
||||
js-yaml: 4.2.0
|
||||
js-yaml: 3.15.0
|
||||
resolve-from: 5.0.0
|
||||
|
||||
'@istanbuljs/schema@0.1.6': {}
|
||||
@@ -2598,7 +2609,9 @@ snapshots:
|
||||
|
||||
arg@4.1.3: {}
|
||||
|
||||
argparse@2.0.1: {}
|
||||
argparse@1.0.10:
|
||||
dependencies:
|
||||
sprintf-js: 1.0.3
|
||||
|
||||
babel-jest@29.7.0(@babel/core@7.29.7):
|
||||
dependencies:
|
||||
@@ -2663,12 +2676,12 @@ snapshots:
|
||||
|
||||
binary-extensions@2.3.0: {}
|
||||
|
||||
brace-expansion@1.1.15:
|
||||
brace-expansion@1.1.16:
|
||||
dependencies:
|
||||
balanced-match: 1.0.2
|
||||
concat-map: 0.0.1
|
||||
|
||||
brace-expansion@5.0.6:
|
||||
brace-expansion@5.0.8:
|
||||
dependencies:
|
||||
balanced-match: 4.0.4
|
||||
|
||||
@@ -2848,6 +2861,8 @@ snapshots:
|
||||
|
||||
escape-string-regexp@2.0.0: {}
|
||||
|
||||
esprima@4.0.1: {}
|
||||
|
||||
eventsource-parser@3.1.0: {}
|
||||
|
||||
execa@5.1.1:
|
||||
@@ -3344,9 +3359,10 @@ snapshots:
|
||||
|
||||
js-tokens@4.0.0: {}
|
||||
|
||||
js-yaml@4.2.0:
|
||||
js-yaml@3.15.0:
|
||||
dependencies:
|
||||
argparse: 2.0.1
|
||||
argparse: 1.0.10
|
||||
esprima: 4.0.1
|
||||
|
||||
jsesc@3.1.0: {}
|
||||
|
||||
@@ -3401,11 +3417,11 @@ snapshots:
|
||||
|
||||
minimatch@10.2.5:
|
||||
dependencies:
|
||||
brace-expansion: 5.0.6
|
||||
brace-expansion: 5.0.8
|
||||
|
||||
minimatch@3.1.5:
|
||||
dependencies:
|
||||
brace-expansion: 1.1.15
|
||||
brace-expansion: 1.1.16
|
||||
|
||||
minimist@1.2.8: {}
|
||||
|
||||
@@ -3616,6 +3632,8 @@ snapshots:
|
||||
|
||||
source-map@0.7.6: {}
|
||||
|
||||
sprintf-js@1.0.3: {}
|
||||
|
||||
stack-utils@2.0.6:
|
||||
dependencies:
|
||||
escape-string-regexp: 2.0.0
|
||||
|
||||
@@ -7,10 +7,13 @@ onlyBuiltDependencies:
|
||||
|
||||
overrides:
|
||||
"glob@>=10.2.0 <10.5.0": "^10.5.0"
|
||||
"js-yaml@<=4.1.1": ">=4.2.0"
|
||||
"minimatch@<3.1.3": "^3.1.3"
|
||||
"minimatch@>=5.0.0 <5.1.8": "^5.1.8"
|
||||
"minimatch@>=9.0.0 <9.0.7": "^9.0.7"
|
||||
"picomatch@<2.3.2": "^2.3.2"
|
||||
"rollup@>=4.0.0 <4.59.0": "^4.59.0"
|
||||
"esbuild": ">=0.28.1"
|
||||
"brace-expansion@<1.1.16": ">=1.1.16 <2.0.0"
|
||||
"brace-expansion@>=3.0.0 <5.0.8": ">=5.0.8 <6.0.0"
|
||||
"js-yaml@<3.15.0": ">=3.15.0 <4.0.0"
|
||||
"js-yaml@>=4.0.0 <4.3.0": ">=4.3.0 <5.0.0"
|
||||
|
||||
+15
-7
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mem0ai",
|
||||
"version": "3.1.2",
|
||||
"version": "3.1.3",
|
||||
"description": "The Memory Layer For Your AI Apps",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
@@ -102,7 +102,7 @@
|
||||
"@mochow/mochow-sdk-node": "^2.1.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.16.0",
|
||||
"axios": "^1.18.0",
|
||||
"openai": "^4.93.0",
|
||||
"uuid": "^11.1.1",
|
||||
"zod": "^3.24.1"
|
||||
@@ -271,26 +271,34 @@
|
||||
"picomatch@<2.3.2": "^2.3.2",
|
||||
"picomatch@>=4.0.0 <4.0.4": "^4.0.4",
|
||||
"jws@4.0.0": "4.0.1",
|
||||
"js-yaml@<3.14.2": ">=3.14.2",
|
||||
"js-yaml@<3.15.0": ">=3.15.0 <4.0.0",
|
||||
"js-yaml@>=4.0.0 <4.3.0": ">=4.3.0 <5.0.0",
|
||||
"langsmith@<0.6.0": "^0.6.0",
|
||||
"minimatch@<3.1.3": "^3.1.3",
|
||||
"minimatch@>=5.0.0 <5.1.8": "^5.1.8",
|
||||
"minimatch@>=9.0.0 <9.0.7": "^9.0.7",
|
||||
"path-to-regexp@>=8.0.0 <8.4.0": "^8.4.0",
|
||||
"postcss@<8.5.10": ">=8.5.10",
|
||||
"postcss@<8.5.18": ">=8.5.18 <9.0.0",
|
||||
"uuid@<11.1.1": ">=11.1.1",
|
||||
"weaviate-client>uuid": "^11.1.1",
|
||||
"ws@>=8.0.0 <8.20.1": ">=8.20.1",
|
||||
"rollup@>=4.0.0 <4.59.0": "^4.59.0",
|
||||
"tar-fs@>=2.0.0 <2.1.4": "^2.1.4",
|
||||
"glob@>=10.2.0 <10.5.0": "^10.5.0",
|
||||
"fast-xml-parser@>=5.0.0 <5.7.0": "^5.9.3",
|
||||
"tar@<=7.5.15": "^7.5.19",
|
||||
"@modelcontextprotocol/sdk": "^1.25.4",
|
||||
"esbuild": ">=0.28.1",
|
||||
"undici@<6.27.0": ">=6.27.0 <8.0.0",
|
||||
"@aws-sdk/client-bedrock-runtime": "3.967.0",
|
||||
"@aws-sdk/client-neptune-graph": "3.966.0"
|
||||
"@aws-sdk/client-neptune-graph": "3.966.0",
|
||||
"axios@<1.18.0": ">=1.18.0 <2.0.0",
|
||||
"brace-expansion@<1.1.16": ">=1.1.16 <2.0.0",
|
||||
"brace-expansion@>=2.0.0 <2.1.2": ">=2.1.2 <3.0.0",
|
||||
"brace-expansion@>=3.0.0 <5.0.8": ">=5.0.8 <6.0.0",
|
||||
"fast-xml-parser@>=5.0.0 <5.10.1": ">=5.10.1 <6.0.0",
|
||||
"tar@>=7.0.0 <7.5.21": ">=7.5.21 <8.0.0",
|
||||
"thrift@<0.23.0": "^0.23.0",
|
||||
"mongoose@>=9.0.0 <9.7.2": ">=9.7.2 <10.0.0",
|
||||
"protobufjs@<7.6.5": ">=7.6.5 <8.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+181
-86
@@ -9,26 +9,34 @@ overrides:
|
||||
picomatch@<2.3.2: ^2.3.2
|
||||
picomatch@>=4.0.0 <4.0.4: ^4.0.4
|
||||
jws@4.0.0: 4.0.1
|
||||
js-yaml@<3.14.2: '>=3.14.2'
|
||||
js-yaml@<3.15.0: '>=3.15.0 <4.0.0'
|
||||
js-yaml@>=4.0.0 <4.3.0: '>=4.3.0 <5.0.0'
|
||||
langsmith@<0.6.0: ^0.6.0
|
||||
minimatch@<3.1.3: ^3.1.3
|
||||
minimatch@>=5.0.0 <5.1.8: ^5.1.8
|
||||
minimatch@>=9.0.0 <9.0.7: ^9.0.7
|
||||
path-to-regexp@>=8.0.0 <8.4.0: ^8.4.0
|
||||
postcss@<8.5.10: '>=8.5.10'
|
||||
postcss@<8.5.18: '>=8.5.18 <9.0.0'
|
||||
uuid@<11.1.1: '>=11.1.1'
|
||||
weaviate-client>uuid: ^11.1.1
|
||||
ws@>=8.0.0 <8.20.1: '>=8.20.1'
|
||||
rollup@>=4.0.0 <4.59.0: ^4.59.0
|
||||
tar-fs@>=2.0.0 <2.1.4: ^2.1.4
|
||||
glob@>=10.2.0 <10.5.0: ^10.5.0
|
||||
fast-xml-parser@>=5.0.0 <5.7.0: ^5.9.3
|
||||
tar@<=7.5.15: ^7.5.19
|
||||
'@modelcontextprotocol/sdk': ^1.25.4
|
||||
esbuild: '>=0.28.1'
|
||||
undici@<6.27.0: '>=6.27.0 <8.0.0'
|
||||
'@aws-sdk/client-bedrock-runtime': 3.967.0
|
||||
'@aws-sdk/client-neptune-graph': 3.966.0
|
||||
axios@<1.18.0: '>=1.18.0 <2.0.0'
|
||||
brace-expansion@<1.1.16: '>=1.1.16 <2.0.0'
|
||||
brace-expansion@>=2.0.0 <2.1.2: '>=2.1.2 <3.0.0'
|
||||
brace-expansion@>=3.0.0 <5.0.8: '>=5.0.8 <6.0.0'
|
||||
fast-xml-parser@>=5.0.0 <5.10.1: '>=5.10.1 <6.0.0'
|
||||
tar@>=7.0.0 <7.5.21: '>=7.5.21 <8.0.0'
|
||||
thrift@<0.23.0: ^0.23.0
|
||||
mongoose@>=9.0.0 <9.7.2: '>=9.7.2 <10.0.0'
|
||||
protobufjs@<7.6.5: '>=7.6.5 <8.0.0'
|
||||
|
||||
importers:
|
||||
|
||||
@@ -104,8 +112,8 @@ importers:
|
||||
specifier: ^2.4.0 || ^3.0.0
|
||||
version: 3.0.3
|
||||
axios:
|
||||
specifier: ^1.16.0
|
||||
version: 1.17.0
|
||||
specifier: ^1.18.0
|
||||
version: 1.18.1
|
||||
better-sqlite3:
|
||||
specifier: ^12.6.2
|
||||
version: 12.10.0
|
||||
@@ -1304,8 +1312,8 @@ packages:
|
||||
'@mongodb-js/saslprep@1.4.11':
|
||||
resolution: {integrity: sha512-o9rAHc0IpIjuPSxRutWpE1F62x7n+4mVS4rCNHkzhIUMQcc18bb6xEq5wd2NdN0WjepIyXIppRshYI2kQDOZVA==}
|
||||
|
||||
'@nodable/entities@2.2.0':
|
||||
resolution: {integrity: sha512-9uGyhaQavEUMC8AIddIjau4NsnsXhou+j5sBAGojCM1oxmQpVKTWR/9JxABD6UAv12vpIms55fPZKFQEhG6uBg==}
|
||||
'@nodable/entities@3.0.0':
|
||||
resolution: {integrity: sha512-8L9xFeTYKhm49xfIypoe2W5wV1m/3Z58kT+7kR9A8OyFxcPduI4VmxaUMQyKYrRjUoLLSXv6EKKID5Tvj9cUVw==}
|
||||
|
||||
'@nodelib/fs.scandir@2.1.5':
|
||||
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
|
||||
@@ -1366,9 +1374,6 @@ packages:
|
||||
'@protobufjs/float@1.0.2':
|
||||
resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==}
|
||||
|
||||
'@protobufjs/inquire@1.1.2':
|
||||
resolution: {integrity: sha512-pa0vFRuws4wkvaXKK1uXZMAwAX4/t8ANaJo45iw/oQHNQ9q5xUzwgFmVJGXiga2BeN+zpX7Vf9vmsiIa2J+MUw==}
|
||||
|
||||
'@protobufjs/path@1.1.2':
|
||||
resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==}
|
||||
|
||||
@@ -2043,8 +2048,8 @@ packages:
|
||||
arg@4.1.3:
|
||||
resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
|
||||
|
||||
argparse@2.0.1:
|
||||
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
|
||||
argparse@1.0.10:
|
||||
resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==}
|
||||
|
||||
array-back@3.1.0:
|
||||
resolution: {integrity: sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==}
|
||||
@@ -2074,8 +2079,8 @@ packages:
|
||||
aws4@1.13.2:
|
||||
resolution: {integrity: sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==}
|
||||
|
||||
axios@1.17.0:
|
||||
resolution: {integrity: sha512-J8SwNxprqqpbfenehxWYXE7CW+wM1BB4w3+N+g+/Wx40xM4rsLrfPmHHxSWIxJLYDgSY/HqlFPIYb2/S3rxafw==}
|
||||
axios@1.18.1:
|
||||
resolution: {integrity: sha512-3nTvFlvpn9Zu/RkHUqtc7/+al4UpRW5az71ap5zccp6e8RAYEzhMTecX8Dz1wWDYrPpUoB1HAQEGEAEvUr7S9g==}
|
||||
|
||||
babel-jest@29.7.0:
|
||||
resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==}
|
||||
@@ -2148,15 +2153,15 @@ packages:
|
||||
bowser@2.14.1:
|
||||
resolution: {integrity: sha512-tzPjzCxygAKWFOJP011oxFHs57HzIhOEracIgAePE4pqB3LikALKnSzUyU4MGs9/iCEUuHlAJTjTc5M+u7YEGg==}
|
||||
|
||||
brace-expansion@1.1.15:
|
||||
resolution: {integrity: sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==}
|
||||
brace-expansion@1.1.16:
|
||||
resolution: {integrity: sha512-IDw48K2/2kRkg9LdJxurvq3lV3aBgq0REY89duEqFRthjlPdXHKMj7EnQOXVckxzgisinf3nHfrcE2FufFLXMw==}
|
||||
|
||||
brace-expansion@2.1.1:
|
||||
resolution: {integrity: sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==}
|
||||
brace-expansion@2.1.2:
|
||||
resolution: {integrity: sha512-w5JZcKgdhDOgOwm8H+KgbosopHMuGcl6qbulwjtz3SM7I7P3yW1eAjzMPLrIE+NQ9vjgANKHWeMHnrT0OXW1oA==}
|
||||
|
||||
brace-expansion@5.0.6:
|
||||
resolution: {integrity: sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==}
|
||||
engines: {node: 18 || 20 || >=22}
|
||||
brace-expansion@5.0.8:
|
||||
resolution: {integrity: sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==}
|
||||
engines: {node: 20 || >=22}
|
||||
|
||||
braces@3.0.3:
|
||||
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
|
||||
@@ -2268,6 +2273,10 @@ packages:
|
||||
chownr@1.1.4:
|
||||
resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==}
|
||||
|
||||
chownr@2.0.0:
|
||||
resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
chownr@3.0.0:
|
||||
resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==}
|
||||
engines: {node: '>=18'}
|
||||
@@ -2681,8 +2690,8 @@ packages:
|
||||
fast-xml-builder@1.2.1:
|
||||
resolution: {integrity: sha512-tPb5TTWfgfVx5BNSi2xV0eLr89POeXXn0dXIsCJ9m1narrWxeIyx6je9d7Rce/3NyXLbvuQmLkxq+RuxMWejvw==}
|
||||
|
||||
fast-xml-parser@5.9.3:
|
||||
resolution: {integrity: sha512-brCNCeScma/kqa54J4PIDriSSSLssRkuYaUCpvHJulGc3HGI/xxKUCTDcYkAdqJsyb//ydpbxecjC3hB9+tb/g==}
|
||||
fast-xml-parser@5.10.1:
|
||||
resolution: {integrity: sha512-IEMIf7298kXuZSRFoGfMYrl7is8LpavODgbNz1cwIudv7KwVFnuU+UsMporfq6PD6aXSlawZlARiA3UywCTfMw==}
|
||||
hasBin: true
|
||||
|
||||
fastembed@2.1.0:
|
||||
@@ -2780,6 +2789,10 @@ packages:
|
||||
fs-constants@1.0.0:
|
||||
resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==}
|
||||
|
||||
fs-minipass@2.1.0:
|
||||
resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==}
|
||||
engines: {node: '>= 8'}
|
||||
|
||||
fs.realpath@1.0.0:
|
||||
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
|
||||
|
||||
@@ -3065,8 +3078,8 @@ packages:
|
||||
resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
is-unsafe@1.0.1:
|
||||
resolution: {integrity: sha512-CLK2+VdgERgD96EYm5lUQssZYlRg2tkZnbsxZoacmSiRxiFJ4Nk4SzjCl+Ur+v3kXIY9dTIdb3IH22y1mZ56LA==}
|
||||
is-unsafe@2.0.0:
|
||||
resolution: {integrity: sha512-2LdV822R+wmI86unXA93WCFpL6g+av8ynWk0nrHyJqGop5VoocYsSLFgN8jrfalT6iGeLNM4KXuVSsULP53kEA==}
|
||||
|
||||
is-wsl@2.2.0:
|
||||
resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==}
|
||||
@@ -3253,8 +3266,8 @@ packages:
|
||||
js-tokens@4.0.0:
|
||||
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
|
||||
|
||||
js-yaml@4.2.0:
|
||||
resolution: {integrity: sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==}
|
||||
js-yaml@3.15.0:
|
||||
resolution: {integrity: sha512-ttBQIIQPDeLjpPOohtUdXuXUVoA2uIB6fEH9HyJ7234s5mBJ5wTx20njxplLZQgLaOfpmPQA7X2t5AX6tIPbog==}
|
||||
hasBin: true
|
||||
|
||||
jsesc@3.1.0:
|
||||
@@ -3508,10 +3521,22 @@ packages:
|
||||
minimist@1.2.8:
|
||||
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
|
||||
|
||||
minipass@3.3.6:
|
||||
resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
minipass@5.0.0:
|
||||
resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
minipass@7.1.3:
|
||||
resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==}
|
||||
engines: {node: '>=16 || 14 >=14.17'}
|
||||
|
||||
minizlib@2.1.2:
|
||||
resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==}
|
||||
engines: {node: '>= 8'}
|
||||
|
||||
minizlib@3.1.0:
|
||||
resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==}
|
||||
engines: {node: '>= 18'}
|
||||
@@ -3519,6 +3544,11 @@ packages:
|
||||
mkdirp-classic@0.5.3:
|
||||
resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==}
|
||||
|
||||
mkdirp@1.0.4:
|
||||
resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==}
|
||||
engines: {node: '>=10'}
|
||||
hasBin: true
|
||||
|
||||
mlly@1.8.2:
|
||||
resolution: {integrity: sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==}
|
||||
|
||||
@@ -3553,8 +3583,35 @@ packages:
|
||||
socks:
|
||||
optional: true
|
||||
|
||||
mongoose@9.7.0:
|
||||
resolution: {integrity: sha512-pkrLZ6U41pD4Ai0ju/FYL7o5I5k+rV3RZINQTG937hbhnLGKRuqqYm1Dlt/kTQ+M4FHijzV6JawzsdHKRGt7QA==}
|
||||
mongodb@7.5.0:
|
||||
resolution: {integrity: sha512-5FnrEDLnvp6ycUOGLNLLU33BfCx2qmp2mJjGPDwKLruYsVzXVSK5fsGpoDXvsXJwBfBsD7ebMRdawbDxC2814g==}
|
||||
engines: {node: '>=20.19.0'}
|
||||
peerDependencies:
|
||||
'@aws-sdk/credential-providers': ^3.806.0
|
||||
'@mongodb-js/zstd': ^7.0.0
|
||||
gcp-metadata: ^7.0.1
|
||||
kerberos: ^7.0.0
|
||||
mongodb-client-encryption: ^7.2.0
|
||||
snappy: ^7.3.2
|
||||
socks: ^2.8.6
|
||||
peerDependenciesMeta:
|
||||
'@aws-sdk/credential-providers':
|
||||
optional: true
|
||||
'@mongodb-js/zstd':
|
||||
optional: true
|
||||
gcp-metadata:
|
||||
optional: true
|
||||
kerberos:
|
||||
optional: true
|
||||
mongodb-client-encryption:
|
||||
optional: true
|
||||
snappy:
|
||||
optional: true
|
||||
socks:
|
||||
optional: true
|
||||
|
||||
mongoose@9.8.0:
|
||||
resolution: {integrity: sha512-PDGx3XACxrBQyWf4YT+5s1Xsx19x84UWGlRVIza4i9RG6qKjGcoG7odotT6uquR6YoaDMTZ6ZZc/jMXLrNPyyA==}
|
||||
engines: {node: '>=20.19.0'}
|
||||
|
||||
mpath@0.9.0:
|
||||
@@ -3907,7 +3964,7 @@ packages:
|
||||
engines: {node: '>= 18'}
|
||||
peerDependencies:
|
||||
jiti: '>=1.21.0'
|
||||
postcss: '>=8.5.10'
|
||||
postcss: '>=8.5.18 <9.0.0'
|
||||
tsx: ^4.8.1
|
||||
yaml: ^2.4.2
|
||||
peerDependenciesMeta:
|
||||
@@ -3986,8 +4043,8 @@ packages:
|
||||
resolution: {integrity: sha512-E1sbAYg3aEbXrq0n1ojJkRHQJGE1kaE/O6GLA94y8rnJBfgvOPTOd1b9hOceQK1FFZI9qMh1vBERCyO2ifubcw==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
protobufjs@7.6.3:
|
||||
resolution: {integrity: sha512-+k0vdJKNdW+Vu+dYe8tZA/VvQb6XKNWexC6URwBFXxNnjLJz9nQJCemGyNgRAWD+B7+nGNc9qMPGwcD7s4nzUw==}
|
||||
protobufjs@7.6.5:
|
||||
resolution: {integrity: sha512-/FPD0nUc9jH6rfFjji9IBqOz4pcSE3CsT1m7Ep6Mdb0LxSUMj8hgl6GomOvZzpNpAqqGaXA0P3VSrZLFzIhQrw==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
|
||||
proxy-agent@6.5.0:
|
||||
@@ -4240,6 +4297,9 @@ packages:
|
||||
resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==}
|
||||
engines: {node: '>= 10.x'}
|
||||
|
||||
sprintf-js@1.0.3:
|
||||
resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==}
|
||||
|
||||
sprintf-js@1.1.3:
|
||||
resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==}
|
||||
|
||||
@@ -4356,8 +4416,13 @@ packages:
|
||||
resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
tar@7.5.19:
|
||||
resolution: {integrity: sha512-4LeEWl96twnS2Q7Bz4MGqgazLqO+hJN63GZxXoIqh1T3VweYD997gbU1ItNsQafqqXTXd5WFyFdReLtwvRBNiw==}
|
||||
tar@6.2.1:
|
||||
resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==}
|
||||
engines: {node: '>=10'}
|
||||
deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
|
||||
|
||||
tar@7.5.22:
|
||||
resolution: {integrity: sha512-MFO/QzvtAOmJbkhOaCTvbGcFN9L9b+JunIsDwaKljSOdcLMea3NJ1k9Usz/rjdfSXTq4dfzfeS7W4p4YOAAHeA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
teeny-request@10.1.3:
|
||||
@@ -4378,10 +4443,6 @@ packages:
|
||||
thenify@3.3.1:
|
||||
resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==}
|
||||
|
||||
thrift@0.16.0:
|
||||
resolution: {integrity: sha512-W8DpGyTPlIaK3f+e1XOCLxefaUWXtrOXAaVIDbfYhmVyriYeAKgsBVFNJUV1F9SQ2SPt2sG44AZQxSGwGj/3VA==}
|
||||
engines: {node: '>= 10.18.0'}
|
||||
|
||||
thrift@0.23.0:
|
||||
resolution: {integrity: sha512-j7F1ls8JogClU88Ta/pwD/OzYuiFeD6Z5GoWw7ip+jcDhcNYFKgfXYEsyLXYpiNfJO94fbLnITGxyfZ19YzA6Q==}
|
||||
engines: {node: '>= 10.18.0'}
|
||||
@@ -4476,7 +4537,7 @@ packages:
|
||||
peerDependencies:
|
||||
'@microsoft/api-extractor': ^7.36.0
|
||||
'@swc/core': ^1
|
||||
postcss: '>=8.5.10'
|
||||
postcss: '>=8.5.18 <9.0.0'
|
||||
typescript: '>=4.5.0'
|
||||
peerDependenciesMeta:
|
||||
'@microsoft/api-extractor':
|
||||
@@ -4693,6 +4754,10 @@ packages:
|
||||
resolution: {integrity: sha512-k8KO9hrMyNk6tUWqUfkTEZbezRRpONVOzUTnc97VnCvyj6Tf9lyUR9EDAIeiVLv56jsMcoXEwjW8Kv5yPY52lw==}
|
||||
engines: {node: '>=16.0.0'}
|
||||
|
||||
xml-naming@0.3.0:
|
||||
resolution: {integrity: sha512-ghig2TBE/H11aOVgmahA3MhimvkBr6JIYknH/Dhdk10nXwdbIqBJsbfMxpvFPG8bAw77gN29aQWvKpmVoPlvPQ==}
|
||||
engines: {node: '>=16.0.0'}
|
||||
|
||||
xtend@4.0.2:
|
||||
resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
|
||||
engines: {node: '>=0.4'}
|
||||
@@ -5681,7 +5746,7 @@ snapshots:
|
||||
'@aws-sdk/xml-builder@3.965.0':
|
||||
dependencies:
|
||||
'@smithy/types': 4.15.0
|
||||
fast-xml-parser: 5.9.3
|
||||
fast-xml-parser: 5.10.1
|
||||
tslib: 2.8.1
|
||||
|
||||
'@aws-sdk/xml-builder@3.972.34':
|
||||
@@ -6039,7 +6104,7 @@ snapshots:
|
||||
open: 8.4.2
|
||||
openid-client: 5.7.1
|
||||
proxy-agent: 6.5.0
|
||||
thrift: 0.16.0
|
||||
thrift: 0.23.0
|
||||
uuid: 11.1.1
|
||||
winston: 3.19.0
|
||||
optionalDependencies:
|
||||
@@ -6174,7 +6239,7 @@ snapshots:
|
||||
dependencies:
|
||||
google-auth-library: 10.7.0
|
||||
p-retry: 4.6.2
|
||||
protobufjs: 7.6.3
|
||||
protobufjs: 7.6.5
|
||||
ws: 8.21.0
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
@@ -6194,7 +6259,7 @@ snapshots:
|
||||
dependencies:
|
||||
lodash.camelcase: 4.3.0
|
||||
long: 5.3.2
|
||||
protobufjs: 7.6.3
|
||||
protobufjs: 7.6.5
|
||||
yargs: 17.7.2
|
||||
|
||||
'@huggingface/blake3-jit@0.0.2': {}
|
||||
@@ -6341,7 +6406,7 @@ snapshots:
|
||||
camelcase: 5.3.1
|
||||
find-up: 4.1.0
|
||||
get-package-type: 0.1.0
|
||||
js-yaml: 4.2.0
|
||||
js-yaml: 3.15.0
|
||||
resolve-from: 5.0.0
|
||||
|
||||
'@istanbuljs/schema@0.1.6': {}
|
||||
@@ -6568,7 +6633,7 @@ snapshots:
|
||||
dependencies:
|
||||
sparse-bitfield: 3.0.3
|
||||
|
||||
'@nodable/entities@2.2.0': {}
|
||||
'@nodable/entities@3.0.0': {}
|
||||
|
||||
'@nodelib/fs.scandir@2.1.5':
|
||||
dependencies:
|
||||
@@ -6623,8 +6688,6 @@ snapshots:
|
||||
|
||||
'@protobufjs/float@1.0.2': {}
|
||||
|
||||
'@protobufjs/inquire@1.1.2': {}
|
||||
|
||||
'@protobufjs/path@1.1.2': {}
|
||||
|
||||
'@protobufjs/pool@1.1.0': {}
|
||||
@@ -7253,7 +7316,7 @@ snapshots:
|
||||
dayjs: 1.11.21
|
||||
generic-pool: 3.9.0
|
||||
lru-cache: 9.1.2
|
||||
protobufjs: 7.6.3
|
||||
protobufjs: 7.6.5
|
||||
winston: 3.19.0
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
@@ -7335,7 +7398,9 @@ snapshots:
|
||||
|
||||
arg@4.1.3: {}
|
||||
|
||||
argparse@2.0.1: {}
|
||||
argparse@1.0.10:
|
||||
dependencies:
|
||||
sprintf-js: 1.0.3
|
||||
|
||||
array-back@3.1.0: {}
|
||||
|
||||
@@ -7355,7 +7420,7 @@ snapshots:
|
||||
|
||||
aws4@1.13.2: {}
|
||||
|
||||
axios@1.17.0:
|
||||
axios@1.18.1:
|
||||
dependencies:
|
||||
follow-redirects: 1.16.0
|
||||
form-data: 4.0.6
|
||||
@@ -7455,16 +7520,16 @@ snapshots:
|
||||
|
||||
bowser@2.14.1: {}
|
||||
|
||||
brace-expansion@1.1.15:
|
||||
brace-expansion@1.1.16:
|
||||
dependencies:
|
||||
balanced-match: 1.0.2
|
||||
concat-map: 0.0.1
|
||||
|
||||
brace-expansion@2.1.1:
|
||||
brace-expansion@2.1.2:
|
||||
dependencies:
|
||||
balanced-match: 1.0.2
|
||||
|
||||
brace-expansion@5.0.6:
|
||||
brace-expansion@5.0.8:
|
||||
dependencies:
|
||||
balanced-match: 4.0.4
|
||||
|
||||
@@ -7573,6 +7638,8 @@ snapshots:
|
||||
|
||||
chownr@1.1.4: {}
|
||||
|
||||
chownr@2.0.0: {}
|
||||
|
||||
chownr@3.0.0: {}
|
||||
|
||||
chromadb-js-bindings-darwin-arm64@1.3.4:
|
||||
@@ -7971,14 +8038,14 @@ snapshots:
|
||||
path-expression-matcher: 1.6.2
|
||||
xml-naming: 0.1.0
|
||||
|
||||
fast-xml-parser@5.9.3:
|
||||
fast-xml-parser@5.10.1:
|
||||
dependencies:
|
||||
'@nodable/entities': 2.2.0
|
||||
'@nodable/entities': 3.0.0
|
||||
fast-xml-builder: 1.2.1
|
||||
is-unsafe: 1.0.1
|
||||
is-unsafe: 2.0.0
|
||||
path-expression-matcher: 1.6.2
|
||||
strnum: 2.4.1
|
||||
xml-naming: 0.1.0
|
||||
xml-naming: 0.3.0
|
||||
|
||||
fastembed@2.1.0:
|
||||
dependencies:
|
||||
@@ -7986,7 +8053,7 @@ snapshots:
|
||||
'@huggingface/hub': 2.13.2
|
||||
onnxruntime-node: 1.21.0
|
||||
progress: 2.0.3
|
||||
tar: 7.5.19
|
||||
tar: 6.2.1
|
||||
|
||||
fastq@1.20.1:
|
||||
dependencies:
|
||||
@@ -8073,6 +8140,10 @@ snapshots:
|
||||
|
||||
fs-constants@1.0.0: {}
|
||||
|
||||
fs-minipass@2.1.0:
|
||||
dependencies:
|
||||
minipass: 3.3.6
|
||||
|
||||
fs.realpath@1.0.0: {}
|
||||
|
||||
fsevents@2.3.3:
|
||||
@@ -8209,7 +8280,7 @@ snapshots:
|
||||
node-fetch: 3.3.2
|
||||
object-hash: 3.0.0
|
||||
proto3-json-serializer: 3.0.4
|
||||
protobufjs: 7.6.3
|
||||
protobufjs: 7.6.5
|
||||
retry-request: 8.0.3
|
||||
rimraf: 5.0.10
|
||||
transitivePeerDependencies:
|
||||
@@ -8398,7 +8469,7 @@ snapshots:
|
||||
|
||||
is-stream@2.0.1: {}
|
||||
|
||||
is-unsafe@1.0.1: {}
|
||||
is-unsafe@2.0.0: {}
|
||||
|
||||
is-wsl@2.2.0:
|
||||
dependencies:
|
||||
@@ -8780,9 +8851,10 @@ snapshots:
|
||||
|
||||
js-tokens@4.0.0: {}
|
||||
|
||||
js-yaml@4.2.0:
|
||||
js-yaml@3.15.0:
|
||||
dependencies:
|
||||
argparse: 2.0.1
|
||||
argparse: 1.0.10
|
||||
esprima: 4.0.1
|
||||
|
||||
jsesc@3.1.0: {}
|
||||
|
||||
@@ -8979,26 +9051,39 @@ snapshots:
|
||||
|
||||
minimatch@10.2.5:
|
||||
dependencies:
|
||||
brace-expansion: 5.0.6
|
||||
brace-expansion: 5.0.8
|
||||
|
||||
minimatch@3.1.5:
|
||||
dependencies:
|
||||
brace-expansion: 1.1.15
|
||||
brace-expansion: 1.1.16
|
||||
|
||||
minimatch@9.0.9:
|
||||
dependencies:
|
||||
brace-expansion: 2.1.1
|
||||
brace-expansion: 2.1.2
|
||||
|
||||
minimist@1.2.8: {}
|
||||
|
||||
minipass@3.3.6:
|
||||
dependencies:
|
||||
yallist: 4.0.0
|
||||
|
||||
minipass@5.0.0: {}
|
||||
|
||||
minipass@7.1.3: {}
|
||||
|
||||
minizlib@2.1.2:
|
||||
dependencies:
|
||||
minipass: 3.3.6
|
||||
yallist: 4.0.0
|
||||
|
||||
minizlib@3.1.0:
|
||||
dependencies:
|
||||
minipass: 7.1.3
|
||||
|
||||
mkdirp-classic@0.5.3: {}
|
||||
|
||||
mkdirp@1.0.4: {}
|
||||
|
||||
mlly@1.8.2:
|
||||
dependencies:
|
||||
acorn: 8.16.0
|
||||
@@ -9019,10 +9104,19 @@ snapshots:
|
||||
optionalDependencies:
|
||||
socks: 2.8.9
|
||||
|
||||
mongoose@9.7.0(socks@2.8.9):
|
||||
mongodb@7.5.0(socks@2.8.9):
|
||||
dependencies:
|
||||
'@mongodb-js/saslprep': 1.4.11
|
||||
bson: 7.2.0
|
||||
mongodb-connection-string-url: 7.0.1
|
||||
optionalDependencies:
|
||||
socks: 2.8.9
|
||||
|
||||
mongoose@9.8.0(socks@2.8.9):
|
||||
dependencies:
|
||||
'@standard-schema/spec': 1.1.0
|
||||
kareem: 3.3.0
|
||||
mongodb: 7.2.0(socks@2.8.9)
|
||||
mongodb: 7.5.0(socks@2.8.9)
|
||||
mpath: 0.9.0
|
||||
mquery: 6.0.0
|
||||
ms: 2.1.3
|
||||
@@ -9080,7 +9174,7 @@ snapshots:
|
||||
apparatus: 0.0.10
|
||||
dotenv: 17.4.2
|
||||
memjs: 1.3.2
|
||||
mongoose: 9.7.0(socks@2.8.9)
|
||||
mongoose: 9.8.0(socks@2.8.9)
|
||||
pg: 8.21.0
|
||||
redis: 5.12.1(@opentelemetry/api@1.9.1)
|
||||
safe-stable-stringify: 2.5.0
|
||||
@@ -9203,7 +9297,7 @@ snapshots:
|
||||
dependencies:
|
||||
global-agent: 3.0.0
|
||||
onnxruntime-common: 1.21.0
|
||||
tar: 7.5.19
|
||||
tar: 7.5.22
|
||||
|
||||
onnxruntime-node@1.24.3:
|
||||
dependencies:
|
||||
@@ -9218,7 +9312,7 @@ snapshots:
|
||||
long: 5.3.2
|
||||
onnxruntime-common: 1.24.0-dev.20251116-b39e144322
|
||||
platform: 1.3.6
|
||||
protobufjs: 7.6.3
|
||||
protobufjs: 7.6.5
|
||||
|
||||
open@10.2.0:
|
||||
dependencies:
|
||||
@@ -9490,9 +9584,9 @@ snapshots:
|
||||
|
||||
proto3-json-serializer@3.0.4:
|
||||
dependencies:
|
||||
protobufjs: 7.6.3
|
||||
protobufjs: 7.6.5
|
||||
|
||||
protobufjs@7.6.3:
|
||||
protobufjs@7.6.5:
|
||||
dependencies:
|
||||
'@protobufjs/aspromise': 1.1.2
|
||||
'@protobufjs/base64': 1.1.2
|
||||
@@ -9500,7 +9594,6 @@ snapshots:
|
||||
'@protobufjs/eventemitter': 1.1.1
|
||||
'@protobufjs/fetch': 1.1.1
|
||||
'@protobufjs/float': 1.0.2
|
||||
'@protobufjs/inquire': 1.1.2
|
||||
'@protobufjs/path': 1.1.2
|
||||
'@protobufjs/pool': 1.1.0
|
||||
'@protobufjs/utf8': 1.1.1
|
||||
@@ -9806,6 +9899,8 @@ snapshots:
|
||||
|
||||
split2@4.2.0: {}
|
||||
|
||||
sprintf-js@1.0.3: {}
|
||||
|
||||
sprintf-js@1.1.3: {}
|
||||
|
||||
sql-escaper@1.3.3: {}
|
||||
@@ -9926,7 +10021,16 @@ snapshots:
|
||||
inherits: 2.0.4
|
||||
readable-stream: 3.6.2
|
||||
|
||||
tar@7.5.19:
|
||||
tar@6.2.1:
|
||||
dependencies:
|
||||
chownr: 2.0.0
|
||||
fs-minipass: 2.1.0
|
||||
minipass: 5.0.0
|
||||
minizlib: 2.1.2
|
||||
mkdirp: 1.0.4
|
||||
yallist: 4.0.0
|
||||
|
||||
tar@7.5.22:
|
||||
dependencies:
|
||||
'@isaacs/fs-minipass': 4.0.1
|
||||
chownr: 3.0.0
|
||||
@@ -9959,17 +10063,6 @@ snapshots:
|
||||
dependencies:
|
||||
any-promise: 1.3.0
|
||||
|
||||
thrift@0.16.0:
|
||||
dependencies:
|
||||
browser-or-node: 1.3.0
|
||||
isomorphic-ws: 4.0.1(ws@5.2.5)
|
||||
node-int64: 0.4.0
|
||||
q: 1.5.1
|
||||
ws: 5.2.5
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
- utf-8-validate
|
||||
|
||||
thrift@0.23.0:
|
||||
dependencies:
|
||||
browser-or-node: 1.3.0
|
||||
@@ -10254,6 +10347,8 @@ snapshots:
|
||||
|
||||
xml-naming@0.1.0: {}
|
||||
|
||||
xml-naming@0.3.0: {}
|
||||
|
||||
xtend@4.0.2: {}
|
||||
|
||||
xxhash-wasm@1.1.0: {}
|
||||
|
||||
@@ -10,13 +10,14 @@ overrides:
|
||||
"picomatch@<2.3.2": "^2.3.2"
|
||||
"picomatch@>=4.0.0 <4.0.4": "^4.0.4"
|
||||
"jws@4.0.0": "4.0.1"
|
||||
"js-yaml@<3.14.2": ">=3.14.2"
|
||||
"js-yaml@<3.15.0": ">=3.15.0 <4.0.0"
|
||||
"js-yaml@>=4.0.0 <4.3.0": ">=4.3.0 <5.0.0"
|
||||
"langsmith@<0.6.0": "^0.6.0"
|
||||
"minimatch@<3.1.3": "^3.1.3"
|
||||
"minimatch@>=5.0.0 <5.1.8": "^5.1.8"
|
||||
"minimatch@>=9.0.0 <9.0.7": "^9.0.7"
|
||||
"path-to-regexp@>=8.0.0 <8.4.0": "^8.4.0"
|
||||
"postcss@<8.5.10": ">=8.5.10"
|
||||
"postcss@<8.5.18": ">=8.5.18 <9.0.0"
|
||||
"uuid@<11.1.1": ">=11.1.1"
|
||||
"ws@>=8.0.0 <8.20.1": ">=8.20.1"
|
||||
"rollup@>=4.0.0 <4.59.0": "^4.59.0"
|
||||
@@ -25,3 +26,12 @@ overrides:
|
||||
"@modelcontextprotocol/sdk": "^1.25.4"
|
||||
"esbuild": ">=0.28.1"
|
||||
"undici@<6.27.0": ">=6.27.0 <8.0.0"
|
||||
"axios@<1.18.0": ">=1.18.0 <2.0.0"
|
||||
"brace-expansion@<1.1.16": ">=1.1.16 <2.0.0"
|
||||
"brace-expansion@>=2.0.0 <2.1.2": ">=2.1.2 <3.0.0"
|
||||
"brace-expansion@>=3.0.0 <5.0.8": ">=5.0.8 <6.0.0"
|
||||
"fast-xml-parser@>=5.0.0 <5.10.1": ">=5.10.1 <6.0.0"
|
||||
"tar@>=7.0.0 <7.5.21": ">=7.5.21 <8.0.0"
|
||||
"thrift@<0.23.0": "^0.23.0"
|
||||
"mongoose@>=9.0.0 <9.7.2": ">=9.7.2 <10.0.0"
|
||||
"protobufjs@<7.6.5": ">=7.6.5 <8.0.0"
|
||||
|
||||
@@ -141,7 +141,7 @@ export interface Mem0MemoryInput extends BaseChatMemoryInput {
|
||||
*
|
||||
* // Use with a chat model
|
||||
* const model = new ChatOpenAI({
|
||||
* modelName: "gpt-3.5-turbo",
|
||||
* modelName: "gpt-5-mini",
|
||||
* temperature: 0,
|
||||
* });
|
||||
*
|
||||
|
||||
@@ -17,7 +17,14 @@ export class TogetherEmbedder extends OpenAIEmbedder {
|
||||
super({
|
||||
...openAICompatibleConfig,
|
||||
apiKey,
|
||||
baseURL: config.baseURL || config.url || DEFAULT_BASE_URL,
|
||||
// Honor TOGETHER_API_BASE like the Together LLM does, so a user behind a
|
||||
// gateway who sets it gets it for embeddings too instead of silently
|
||||
// hitting api.together.ai.
|
||||
baseURL:
|
||||
config.baseURL ||
|
||||
config.url ||
|
||||
process.env.TOGETHER_API_BASE ||
|
||||
DEFAULT_BASE_URL,
|
||||
model: config.model || DEFAULT_MODEL,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -105,6 +105,10 @@ const ENTITY_PARAMS = [
|
||||
// in both casings (the default store promotes camelCase on read); actor_id has no camelCase alias.
|
||||
const IDENTITY_KEYS = [...ENTITY_PARAMS, "actor_id"];
|
||||
|
||||
// Batch size for deleteAll pagination. Larger than most vector store default
|
||||
// page limits (~100) to minimize roundtrips while bounded to avoid memory pressure.
|
||||
const DELETE_ALL_BATCH_SIZE = 1000;
|
||||
|
||||
/**
|
||||
* Validates that no top-level entity parameters are passed in config.
|
||||
* @throws Error if entity params are found at top level
|
||||
@@ -1727,18 +1731,39 @@ export class Memory {
|
||||
);
|
||||
}
|
||||
|
||||
const [memories] = await this.vectorStore.list(filters);
|
||||
for (const memory of memories) {
|
||||
await this.deleteMemory(memory.id);
|
||||
let deletedCount = 0;
|
||||
const seenBatches = new Set<string>();
|
||||
|
||||
while (true) {
|
||||
const [batch] = await this.vectorStore.list(
|
||||
filters,
|
||||
DELETE_ALL_BATCH_SIZE,
|
||||
);
|
||||
if (!batch.length) {
|
||||
break;
|
||||
}
|
||||
const batchKey = batch
|
||||
.map((memory) => String(memory.id))
|
||||
.sort()
|
||||
.join(",");
|
||||
if (seenBatches.has(batchKey)) {
|
||||
logger.warn("Stopping deleteAll after a repeated memory batch");
|
||||
break;
|
||||
}
|
||||
seenBatches.add(batchKey);
|
||||
for (const memory of batch) {
|
||||
await this.deleteMemory(memory.id);
|
||||
}
|
||||
deletedCount += batch.length;
|
||||
}
|
||||
|
||||
const result = { message: "Memories deleted successfully!" };
|
||||
if (memories.length > 0) {
|
||||
if (deletedCount > 0) {
|
||||
await this._displayDecayUsageNotice({
|
||||
triggerFunction: "delete_all",
|
||||
triggerSource: "delete_all",
|
||||
triggerReason: "bulk_delete",
|
||||
deletedCount: memories.length,
|
||||
deletedCount,
|
||||
});
|
||||
} else {
|
||||
await this._displayFirstRunNotice("delete_all");
|
||||
|
||||
@@ -247,7 +247,7 @@ export class RerankerFactory {
|
||||
llmProvider = nested.provider || config.provider || "openai";
|
||||
llmConfig = { ...(nested.config || {}) };
|
||||
if (llmConfig.model === undefined) {
|
||||
llmConfig.model = config.model ?? "gpt-4o-mini";
|
||||
llmConfig.model = config.model ?? "gpt-5-mini";
|
||||
}
|
||||
if (llmConfig.temperature === undefined) {
|
||||
llmConfig.temperature = config.temperature ?? 0.0;
|
||||
@@ -261,7 +261,7 @@ export class RerankerFactory {
|
||||
} else {
|
||||
llmProvider = config.provider || "openai";
|
||||
llmConfig = {
|
||||
model: config.model ?? "gpt-4o-mini",
|
||||
model: config.model ?? "gpt-5-mini",
|
||||
temperature: config.temperature ?? 0.0,
|
||||
maxTokens: config.maxTokens ?? 100,
|
||||
};
|
||||
|
||||
@@ -4,6 +4,14 @@ import { SearchFilters, VectorStoreConfig, VectorStoreResult } from "../types";
|
||||
import { loadPeer } from "../utils/load_peer";
|
||||
import * as fs from "fs";
|
||||
|
||||
// BM25 keyword search via Qdrant's built-in server-side inference (requires
|
||||
// Qdrant >= 1.15.2). The Python adapter encodes BM25 client-side with fastembed;
|
||||
// this server-side path avoids that dependency, but IDF weights, and therefore the
|
||||
// scores, may differ between the two implementations.
|
||||
|
||||
const BM25_VECTOR_NAME = "bm25";
|
||||
const BM25_MODEL = "Qdrant/bm25";
|
||||
|
||||
interface QdrantConfig extends VectorStoreConfig {
|
||||
/**
|
||||
* Pre-configured QdrantClient instance. If using Qdrant Cloud, you must pass
|
||||
@@ -61,6 +69,10 @@ export class Qdrant implements VectorStore {
|
||||
private readonly collectionName: string;
|
||||
private dimension: number;
|
||||
private _initPromise?: Promise<void>;
|
||||
// Off for collections without the `bm25` slot (e.g. pre-hybrid-search).
|
||||
private _hasBm25Slot = false;
|
||||
// Payload indexes apply to a real server, not embedded/local mode.
|
||||
private _isRemote = true;
|
||||
|
||||
constructor(config: QdrantConfig) {
|
||||
this.config = config;
|
||||
@@ -73,6 +85,7 @@ export class Qdrant implements VectorStore {
|
||||
if (this.client) return;
|
||||
const config = this.config;
|
||||
if (config.client) {
|
||||
// pre-configured client → treat as remote (mirrors Python is_local=False).
|
||||
this.client = config.client;
|
||||
return;
|
||||
}
|
||||
@@ -95,6 +108,7 @@ export class Qdrant implements VectorStore {
|
||||
params.port = config.port;
|
||||
}
|
||||
if (!Object.keys(params).length) {
|
||||
this._isRemote = false;
|
||||
params.path = config.path;
|
||||
if (!config.onDisk && config.path) {
|
||||
if (
|
||||
@@ -283,19 +297,98 @@ export class Qdrant implements VectorStore {
|
||||
payloads: Record<string, any>[],
|
||||
): Promise<void> {
|
||||
await this.initialize();
|
||||
const points = vectors.map((vector, idx) => ({
|
||||
id: ids[idx],
|
||||
vector: vector,
|
||||
payload: payloads[idx] || {},
|
||||
}));
|
||||
|
||||
await this.client.upsert(this.collectionName, {
|
||||
points,
|
||||
const points = vectors.map((vector, idx) => {
|
||||
const payload = payloads[idx] || {};
|
||||
return {
|
||||
id: ids[idx],
|
||||
vector: this.buildPointVector(vector, payload),
|
||||
payload,
|
||||
};
|
||||
});
|
||||
|
||||
await this.upsertPoints(points);
|
||||
}
|
||||
|
||||
async keywordSearch(): Promise<null> {
|
||||
return null;
|
||||
// A server can accept a bm25 `sparse_vectors` config yet be unable to run
|
||||
// inference (Qdrant < 1.15.2, or a Cloud cluster created before 2025-07-07
|
||||
// where inference was never activated), so no version check catches it and
|
||||
// the first upsert failure is the only signal. Retry dense-only rather than
|
||||
// lose the write.
|
||||
//
|
||||
// `as any`: the JS client types predate server-side sparse_vectors, so the
|
||||
// named-vector and BM25-inference shapes are not typed.
|
||||
private async upsertPoints(
|
||||
points: { id: string | number; vector: any; payload?: any }[],
|
||||
): Promise<void> {
|
||||
try {
|
||||
await this.client.upsert(this.collectionName, { points: points as any });
|
||||
} catch (error) {
|
||||
if (!this._hasBm25Slot) {
|
||||
throw error;
|
||||
}
|
||||
this._hasBm25Slot = false;
|
||||
console.warn(
|
||||
`Qdrant rejected the server-side BM25 vector for collection '${this.collectionName}'; ` +
|
||||
"disabling hybrid keyword search. This requires Qdrant >= 1.15.2 with inference enabled. " +
|
||||
"Retrying the write with a plain dense vector.",
|
||||
);
|
||||
const denseOnly = points.map((p) => ({
|
||||
...p,
|
||||
vector: Array.isArray(p.vector) ? p.vector : p.vector[""],
|
||||
}));
|
||||
await this.client.upsert(this.collectionName, {
|
||||
points: denseOnly as any,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// With a bm25 slot, return named vectors so Qdrant encodes BM25 server-side;
|
||||
// otherwise return the plain dense vector (legacy behavior).
|
||||
private buildPointVector(
|
||||
vector: number[],
|
||||
payload: Record<string, any>,
|
||||
): number[] | Record<string, any> {
|
||||
if (!this._hasBm25Slot) {
|
||||
return vector;
|
||||
}
|
||||
const named: Record<string, any> = { "": vector };
|
||||
const text = payload?.textLemmatized || payload?.data || "";
|
||||
if (text) {
|
||||
named[BM25_VECTOR_NAME] = { text, model: BM25_MODEL };
|
||||
}
|
||||
return named;
|
||||
}
|
||||
|
||||
// BM25 keyword search; returns null (semantic-only fallback) when there is no
|
||||
// bm25 slot or the query fails.
|
||||
async keywordSearch(
|
||||
query: string,
|
||||
topK: number = 5,
|
||||
filters?: SearchFilters,
|
||||
): Promise<VectorStoreResult[] | null> {
|
||||
if (!this._hasBm25Slot) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
const queryFilter = this.createFilter(filters);
|
||||
const response = await this.client.query(this.collectionName, {
|
||||
query: { text: query, model: BM25_MODEL } as any,
|
||||
using: BM25_VECTOR_NAME,
|
||||
filter: queryFilter,
|
||||
limit: topK,
|
||||
with_payload: true,
|
||||
});
|
||||
|
||||
return response.points.map((point) => ({
|
||||
id: String(point.id),
|
||||
payload: (point.payload as Record<string, any>) || {},
|
||||
score: point.score,
|
||||
}));
|
||||
} catch (error) {
|
||||
console.error("Error during Qdrant keyword search:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async search(
|
||||
@@ -341,13 +434,12 @@ export class Qdrant implements VectorStore {
|
||||
await this.initialize();
|
||||
const point = {
|
||||
id: vectorId,
|
||||
vector: vector,
|
||||
// Re-encode BM25 so edited memories don't keep a stale sparse vector.
|
||||
vector: this.buildPointVector(vector, payload),
|
||||
payload,
|
||||
};
|
||||
|
||||
await this.client.upsert(this.collectionName, {
|
||||
points: [point],
|
||||
});
|
||||
await this.upsertPoints([point]);
|
||||
}
|
||||
|
||||
async delete(vectorId: string): Promise<void> {
|
||||
@@ -463,14 +555,31 @@ export class Qdrant implements VectorStore {
|
||||
}
|
||||
}
|
||||
|
||||
private async ensureCollection(name: string, size: number): Promise<void> {
|
||||
private async ensureCollection(
|
||||
name: string,
|
||||
size: number,
|
||||
enableBm25: boolean = false,
|
||||
): Promise<void> {
|
||||
try {
|
||||
await this.client.createCollection(name, {
|
||||
const createParams: Record<string, any> = {
|
||||
vectors: {
|
||||
size,
|
||||
distance: "Cosine",
|
||||
},
|
||||
});
|
||||
};
|
||||
if (enableBm25) {
|
||||
// `idf` lets Qdrant compute IDF over the live corpus at query time.
|
||||
createParams.sparse_vectors = {
|
||||
[BM25_VECTOR_NAME]: { modifier: "idf" },
|
||||
};
|
||||
}
|
||||
await this.client.createCollection(name, createParams as any);
|
||||
if (enableBm25) {
|
||||
this._hasBm25Slot = true;
|
||||
}
|
||||
if (name === this.collectionName) {
|
||||
await this.createFilterIndexes(name);
|
||||
}
|
||||
} catch (error: any) {
|
||||
if (
|
||||
error?.status === 409 ||
|
||||
@@ -489,6 +598,22 @@ export class Qdrant implements VectorStore {
|
||||
`Expected: ${size}, got: ${vectorConfig.size}`,
|
||||
);
|
||||
}
|
||||
|
||||
if (enableBm25) {
|
||||
// Existing collection: enable BM25 only if the slot is present.
|
||||
const sparseConfig = (collectionInfo.config?.params as any)
|
||||
?.sparse_vectors;
|
||||
this._hasBm25Slot = !!(
|
||||
sparseConfig && BM25_VECTOR_NAME in sparseConfig
|
||||
);
|
||||
if (!this._hasBm25Slot) {
|
||||
console.warn(
|
||||
`Collection '${name}' predates hybrid search (no '${BM25_VECTOR_NAME}' sparse slot). ` +
|
||||
"BM25 keyword scoring is disabled for this collection; semantic search works normally. " +
|
||||
"Use a fresh collection to enable hybrid keyword search.",
|
||||
);
|
||||
}
|
||||
}
|
||||
} catch (verifyError: any) {
|
||||
// Re-throw dimension mismatch errors
|
||||
if (verifyError?.message?.includes("wrong vector size")) {
|
||||
@@ -500,6 +625,8 @@ export class Qdrant implements VectorStore {
|
||||
`Collection '${name}' exists (409) but dimension verification failed: ${verifyError?.message || verifyError}. Proceeding anyway.`,
|
||||
);
|
||||
}
|
||||
// Ensure filter indexes exist even for pre-existing collections.
|
||||
await this.createFilterIndexes(name);
|
||||
}
|
||||
// Otherwise collection exists and is fine — proceed
|
||||
} else {
|
||||
@@ -508,6 +635,26 @@ export class Qdrant implements VectorStore {
|
||||
}
|
||||
}
|
||||
|
||||
// Index the fields mem0 filters by; remote Qdrant rejects filtering on
|
||||
// un-indexed fields. Mirrors Python's `_create_filter_indexes`.
|
||||
private async createFilterIndexes(name: string): Promise<void> {
|
||||
if (!this._isRemote) {
|
||||
return;
|
||||
}
|
||||
const commonFields = ["user_id", "agent_id", "run_id", "actor_id"];
|
||||
for (const field of commonFields) {
|
||||
try {
|
||||
await this.client.createPayloadIndex(name, {
|
||||
field_name: field,
|
||||
field_schema: "keyword",
|
||||
});
|
||||
} catch (err) {
|
||||
// Non-fatal: index likely already exists, or the server rejected it.
|
||||
console.debug(`Qdrant: skipped payload index for '${field}':`, err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async initialize(): Promise<void> {
|
||||
if (!this._initPromise) {
|
||||
this._initPromise = this._doInitialize();
|
||||
@@ -518,7 +665,7 @@ export class Qdrant implements VectorStore {
|
||||
private async _doInitialize(): Promise<void> {
|
||||
try {
|
||||
await this.ensureClient();
|
||||
await this.ensureCollection(this.collectionName, this.dimension);
|
||||
await this.ensureCollection(this.collectionName, this.dimension, true);
|
||||
await this.ensureCollection("memory_migrations", 1);
|
||||
} catch (error) {
|
||||
console.error("Error initializing Qdrant:", error);
|
||||
|
||||
@@ -31,6 +31,8 @@ interface SupabaseConfig extends VectorStoreConfig {
|
||||
metadataColumnName?: string;
|
||||
}
|
||||
|
||||
const POSTGREST_MAX_ROWS = 1000;
|
||||
|
||||
/*
|
||||
SQL Migration to run in Supabase SQL Editor:
|
||||
|
||||
@@ -123,34 +125,19 @@ export class SupabaseDB implements VectorStore {
|
||||
private async _doInitialize(): Promise<void> {
|
||||
await this.ensureClient();
|
||||
try {
|
||||
// Verify table exists and vector operations work by attempting a test insert
|
||||
const testVector = Array(1536).fill(0);
|
||||
|
||||
// First try to delete any existing test vector
|
||||
try {
|
||||
await this.client.from(this.tableName).delete().eq("id", "test_vector");
|
||||
} catch {
|
||||
// Ignore delete errors - table might not exist yet
|
||||
}
|
||||
|
||||
// Try to insert the test vector
|
||||
const { error: insertError } = await this.client
|
||||
const { error: probeError } = await this.client
|
||||
.from(this.tableName)
|
||||
.insert({
|
||||
id: "test_vector",
|
||||
[this.embeddingColumnName]: testVector,
|
||||
[this.metadataColumnName]: {},
|
||||
})
|
||||
.select();
|
||||
.select(this.embeddingColumnName)
|
||||
.limit(1);
|
||||
|
||||
// If we get a duplicate key error, that's actually fine - it means the table exists
|
||||
if (insertError && insertError.code !== "23505") {
|
||||
console.error("Test insert error:", insertError);
|
||||
if (probeError) {
|
||||
console.error("Table probe error:", probeError);
|
||||
throw new Error(
|
||||
`Vector operations failed. Please ensure:
|
||||
1. The vector extension is enabled
|
||||
2. The table "${this.tableName}" exists with correct schema
|
||||
3. The match_vectors function is created
|
||||
4. Row Level Security policies allow the configured Supabase key to read the table
|
||||
|
||||
RUN THE FOLLOWING SQL IN YOUR SUPABASE SQL EDITOR:
|
||||
|
||||
@@ -205,13 +192,6 @@ See the SQL migration instructions in the code comments.`,
|
||||
);
|
||||
}
|
||||
|
||||
// Clean up test vector - ignore errors here too
|
||||
try {
|
||||
await this.client.from(this.tableName).delete().eq("id", "test_vector");
|
||||
} catch {
|
||||
// Ignore delete errors
|
||||
}
|
||||
|
||||
console.log("Connected to Supabase successfully");
|
||||
} catch (error) {
|
||||
console.error("Error during Supabase initialization:", error);
|
||||
@@ -270,6 +250,13 @@ See the SQL migration instructions in the code comments.`,
|
||||
if (!data) return [];
|
||||
|
||||
const results = data as VectorSearchResult[];
|
||||
|
||||
if (topK > POSTGREST_MAX_ROWS && results.length === POSTGREST_MAX_ROWS) {
|
||||
console.warn(
|
||||
`Supabase search requested topK=${topK} but match_vectors returned exactly the PostgREST row cap of ${POSTGREST_MAX_ROWS}; results were likely truncated.`,
|
||||
);
|
||||
}
|
||||
|
||||
return results.map((result) => ({
|
||||
id: result.id,
|
||||
payload: result.metadata,
|
||||
@@ -364,27 +351,45 @@ See the SQL migration instructions in the code comments.`,
|
||||
): Promise<[VectorStoreResult[], number]> {
|
||||
await this.initialize();
|
||||
try {
|
||||
let query = this.client
|
||||
.from(this.tableName)
|
||||
.select("*", { count: "exact" })
|
||||
.limit(topK);
|
||||
const results: VectorStoreResult[] = [];
|
||||
let totalCount = 0;
|
||||
let offset = 0;
|
||||
|
||||
if (filters) {
|
||||
Object.entries(filters).forEach(([key, value]) => {
|
||||
query = query.eq(`${this.metadataColumnName}->>${key}`, value);
|
||||
});
|
||||
while (results.length < topK) {
|
||||
const to = Math.min(offset + POSTGREST_MAX_ROWS, topK) - 1;
|
||||
|
||||
let query = this.client
|
||||
.from(this.tableName)
|
||||
.select("*", { count: "exact" })
|
||||
.order("id", { ascending: true });
|
||||
|
||||
if (filters) {
|
||||
Object.entries(filters).forEach(([key, value]) => {
|
||||
query = query.eq(`${this.metadataColumnName}->>${key}`, value);
|
||||
});
|
||||
}
|
||||
|
||||
const { data, error, count } = await query.range(offset, to);
|
||||
|
||||
if (error) throw error;
|
||||
|
||||
totalCount = count ?? totalCount;
|
||||
|
||||
const page = (data ?? []).map((item: VectorData) => ({
|
||||
id: item.id,
|
||||
payload: item[this.metadataColumnName],
|
||||
}));
|
||||
results.push(...page);
|
||||
|
||||
const requestedPageSize = to - offset + 1;
|
||||
if (page.length < requestedPageSize) break;
|
||||
|
||||
offset += page.length;
|
||||
|
||||
if (results.length >= totalCount) break;
|
||||
}
|
||||
|
||||
const { data, error, count } = await query;
|
||||
|
||||
if (error) throw error;
|
||||
|
||||
const results = data.map((item: VectorData) => ({
|
||||
id: item.id,
|
||||
payload: item[this.metadataColumnName],
|
||||
}));
|
||||
|
||||
return [results, count || 0];
|
||||
return [results, totalCount];
|
||||
} catch (error) {
|
||||
console.error("Error listing vectors:", error);
|
||||
throw error;
|
||||
|
||||
@@ -649,6 +649,66 @@ describe("Memory - deleteAll()", () => {
|
||||
"At least one filter is required to delete all memories",
|
||||
);
|
||||
});
|
||||
|
||||
test("deletes past the vector store default page limit", async () => {
|
||||
const mem = createMemory();
|
||||
const internals = mem as any;
|
||||
await internals._ensureInitialized();
|
||||
const pagedUserId = `deleteall_paged_${Date.now()}`;
|
||||
const total = 150;
|
||||
|
||||
await internals.vectorStore.insert(
|
||||
Array.from({ length: total }, () => new Array(1536).fill(0.1)),
|
||||
Array.from({ length: total }, (_, index) => `paged-${index}`),
|
||||
Array.from({ length: total }, (_, index) => ({
|
||||
data: `Fact ${index}`,
|
||||
hash: `hash-${index}`,
|
||||
user_id: pagedUserId,
|
||||
createdAt: new Date().toISOString(),
|
||||
})),
|
||||
);
|
||||
|
||||
const [before] = await internals.vectorStore.list(
|
||||
{ user_id: pagedUserId },
|
||||
total * 2,
|
||||
);
|
||||
expect(before).toHaveLength(total);
|
||||
|
||||
const result = await mem.deleteAll({ userId: pagedUserId });
|
||||
expect(result.message).toBe("Memories deleted successfully!");
|
||||
|
||||
const [after] = await internals.vectorStore.list(
|
||||
{ user_id: pagedUserId },
|
||||
total * 2,
|
||||
);
|
||||
expect(after).toHaveLength(0);
|
||||
}, 60000);
|
||||
|
||||
test("stops when the vector store keeps returning the same batch", async () => {
|
||||
const mem = createMemory();
|
||||
const internals = mem as any;
|
||||
await internals._ensureInitialized();
|
||||
const stale = [
|
||||
{ id: "stale-1", payload: { data: "x", user_id: "u1" } },
|
||||
{ id: "stale-2", payload: { data: "x", user_id: "u1" } },
|
||||
];
|
||||
const listSpy = jest
|
||||
.spyOn(internals.vectorStore, "list")
|
||||
.mockResolvedValueOnce([stale, stale.length])
|
||||
.mockResolvedValueOnce([stale, stale.length])
|
||||
.mockImplementation(async () => {
|
||||
throw new Error("deleteAll should have stopped after a repeated batch");
|
||||
});
|
||||
const deleteSpy = jest
|
||||
.spyOn(internals, "deleteMemory")
|
||||
.mockResolvedValue("stale-1");
|
||||
|
||||
const result = await mem.deleteAll({ userId: "u1" });
|
||||
|
||||
expect(result.message).toBe("Memories deleted successfully!");
|
||||
expect(listSpy).toHaveBeenCalledTimes(2);
|
||||
expect(deleteSpy).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
});
|
||||
|
||||
// ─── getAll() ────────────────────────────────────────────
|
||||
|
||||
@@ -362,7 +362,10 @@ describe("Memory Input Validation", () => {
|
||||
|
||||
await memory.deleteAll({ userId: " alice " });
|
||||
|
||||
expect(listSpy).toHaveBeenCalledWith({ user_id: "alice" });
|
||||
expect(listSpy).toHaveBeenCalledWith(
|
||||
{ user_id: "alice" },
|
||||
expect.any(Number),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,568 @@
|
||||
/// <reference types="jest" />
|
||||
/**
|
||||
* Tests for Qdrant native BM25 keyword search (server-side `Qdrant/bm25`
|
||||
* inference). Fully mocked — no real Qdrant server is required.
|
||||
*
|
||||
* Covers both the happy path and the failure modes that matter for an opt-in,
|
||||
* capability-gated feature:
|
||||
* - fresh collections get the `bm25` sparse slot (modifier idf); migrations don't,
|
||||
* - insert/update attach the server-side BM25 inference vector,
|
||||
* - keywordSearch queries the `bm25` slot and maps results to the common shape,
|
||||
* - collection-init variations (slot present/absent, wrong size, 401/403/409,
|
||||
* transient verify failure, fatal error),
|
||||
* - malformed/hostile query responses and filter construction,
|
||||
* all proving the adapter degrades to `null` (semantic-only) instead of crashing.
|
||||
*/
|
||||
|
||||
jest.setTimeout(15000);
|
||||
|
||||
type MockClient = Record<string, jest.Mock>;
|
||||
|
||||
function buildMockClient(
|
||||
overrides: Partial<MockClient> = {},
|
||||
collectionInfo: any = { config: { params: { vectors: { size: 768 } } } },
|
||||
): MockClient {
|
||||
return {
|
||||
createCollection: jest.fn().mockResolvedValue(undefined),
|
||||
createPayloadIndex: jest.fn().mockResolvedValue(undefined),
|
||||
getCollection: jest.fn().mockResolvedValue(collectionInfo),
|
||||
scroll: jest.fn().mockResolvedValue({ points: [] }),
|
||||
upsert: jest.fn().mockResolvedValue(undefined),
|
||||
retrieve: jest.fn().mockResolvedValue([]),
|
||||
search: jest.fn().mockResolvedValue([]),
|
||||
query: jest.fn().mockResolvedValue({ points: [] }),
|
||||
delete: jest.fn().mockResolvedValue(undefined),
|
||||
deleteCollection: jest.fn().mockResolvedValue(undefined),
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
jest.mock("@qdrant/js-client-rest", () => ({
|
||||
QdrantClient: jest.fn().mockImplementation(() => buildMockClient()),
|
||||
}));
|
||||
|
||||
import { Qdrant } from "../src/vector_stores/qdrant";
|
||||
|
||||
const BASE_CONFIG = {
|
||||
collectionName: "test_memories",
|
||||
embeddingModelDims: 768,
|
||||
dimension: 768,
|
||||
};
|
||||
|
||||
// Existing collection that already carries a bm25 slot.
|
||||
const INFO_WITH_SLOT = {
|
||||
config: {
|
||||
params: { vectors: { size: 768 }, sparse_vectors: { bm25: {} } },
|
||||
},
|
||||
};
|
||||
// Existing collection without a bm25 slot (legacy / pre-hybrid-search).
|
||||
const INFO_NO_SLOT = {
|
||||
config: { params: { vectors: { size: 768 } } },
|
||||
};
|
||||
|
||||
let warnSpy: jest.SpyInstance;
|
||||
let errSpy: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
warnSpy = jest.spyOn(console, "warn").mockImplementation(() => {});
|
||||
errSpy = jest.spyOn(console, "error").mockImplementation(() => {});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
warnSpy.mockRestore();
|
||||
errSpy.mockRestore();
|
||||
});
|
||||
|
||||
function makeStore(client: MockClient): Qdrant {
|
||||
return new Qdrant({ client: client as any, ...BASE_CONFIG });
|
||||
}
|
||||
|
||||
describe("Qdrant BM25 keyword search — collection setup", () => {
|
||||
it("creates the main collection with the bm25 sparse slot (modifier idf)", async () => {
|
||||
const client = buildMockClient();
|
||||
const store = makeStore(client);
|
||||
await store.initialize();
|
||||
|
||||
const createCall = client.createCollection.mock.calls.find(
|
||||
(c) => c[0] === "test_memories",
|
||||
);
|
||||
expect(createCall).toBeDefined();
|
||||
expect(createCall![1].sparse_vectors).toEqual({
|
||||
bm25: { modifier: "idf" },
|
||||
});
|
||||
});
|
||||
|
||||
it("does NOT add the bm25 slot to the memory_migrations collection", async () => {
|
||||
const client = buildMockClient();
|
||||
const store = makeStore(client);
|
||||
await store.initialize();
|
||||
|
||||
const migrationsCall = client.createCollection.mock.calls.find(
|
||||
(c) => c[0] === "memory_migrations",
|
||||
);
|
||||
expect(migrationsCall).toBeDefined();
|
||||
expect(migrationsCall![1].sparse_vectors).toBeUndefined();
|
||||
});
|
||||
|
||||
it("409 with an existing bm25 slot → enables keyword search, no warning", async () => {
|
||||
const client = buildMockClient(
|
||||
{ createCollection: jest.fn().mockRejectedValue({ status: 409 }) },
|
||||
INFO_WITH_SLOT,
|
||||
);
|
||||
const store = makeStore(client);
|
||||
await store.initialize();
|
||||
|
||||
expect(await store.keywordSearch("anything")).not.toBeNull();
|
||||
expect(client.query).toHaveBeenCalled();
|
||||
expect(warnSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("409 without a bm25 slot → disabled + warns once", async () => {
|
||||
const client = buildMockClient(
|
||||
{ createCollection: jest.fn().mockRejectedValue({ status: 409 }) },
|
||||
INFO_NO_SLOT,
|
||||
);
|
||||
const store = makeStore(client);
|
||||
await store.initialize();
|
||||
|
||||
expect(await store.keywordSearch("anything")).toBeNull();
|
||||
expect(client.query).not.toHaveBeenCalled();
|
||||
expect(warnSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("401 (auth-restricted existing collection) with slot → enabled", async () => {
|
||||
const client = buildMockClient(
|
||||
{ createCollection: jest.fn().mockRejectedValue({ status: 401 }) },
|
||||
INFO_WITH_SLOT,
|
||||
);
|
||||
const store = makeStore(client);
|
||||
await store.initialize();
|
||||
expect(await store.keywordSearch("x")).not.toBeNull();
|
||||
});
|
||||
|
||||
it("403 with no slot → disabled (graceful)", async () => {
|
||||
const client = buildMockClient(
|
||||
{ createCollection: jest.fn().mockRejectedValue({ status: 403 }) },
|
||||
INFO_NO_SLOT,
|
||||
);
|
||||
const store = makeStore(client);
|
||||
await store.initialize();
|
||||
expect(await store.keywordSearch("x")).toBeNull();
|
||||
});
|
||||
|
||||
it("existing collection with WRONG vector size → init rejects (size guard intact)", async () => {
|
||||
const client = buildMockClient(
|
||||
{ createCollection: jest.fn().mockRejectedValue({ status: 409 }) },
|
||||
{ config: { params: { vectors: { size: 1536 } } } }, // mismatch vs 768
|
||||
);
|
||||
const store = makeStore(client);
|
||||
await expect(store.initialize()).rejects.toThrow(/wrong vector size/i);
|
||||
});
|
||||
|
||||
it("transient getCollection failure during verify → does NOT crash init, stays disabled", async () => {
|
||||
const client = buildMockClient({
|
||||
createCollection: jest.fn().mockRejectedValue({ status: 409 }),
|
||||
getCollection: jest
|
||||
.fn()
|
||||
.mockRejectedValue({ status: 500, message: "committing" }),
|
||||
});
|
||||
const store = makeStore(client);
|
||||
await expect(store.initialize()).resolves.toBeUndefined();
|
||||
expect(await store.keywordSearch("x")).toBeNull();
|
||||
});
|
||||
|
||||
it("fatal createCollection error (500, not 401/403/409) → init rejects", async () => {
|
||||
const client = buildMockClient({
|
||||
createCollection: jest.fn().mockRejectedValue({ status: 500 }),
|
||||
});
|
||||
const store = makeStore(client);
|
||||
await expect(store.initialize()).rejects.toBeDefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe("Qdrant BM25 keyword search — insert / update", () => {
|
||||
async function freshStore(): Promise<{ store: Qdrant; client: MockClient }> {
|
||||
const client = buildMockClient();
|
||||
const store = makeStore(client);
|
||||
await store.initialize();
|
||||
return { store, client };
|
||||
}
|
||||
|
||||
it("attaches a server-side BM25 inference vector on insert", async () => {
|
||||
const { store, client } = await freshStore();
|
||||
await store.insert(
|
||||
[[0.1, 0.2, 0.3]],
|
||||
["mem-1"],
|
||||
[
|
||||
{
|
||||
data: "Alice reported a duplicate AWS invoice",
|
||||
textLemmatized: "alice report duplicate aws invoice",
|
||||
},
|
||||
],
|
||||
);
|
||||
|
||||
const point = client.upsert.mock.calls.at(-1)![1].points[0];
|
||||
expect(point.id).toBe("mem-1");
|
||||
expect(point.vector[""]).toEqual([0.1, 0.2, 0.3]);
|
||||
expect(point.vector.bm25).toEqual({
|
||||
text: "alice report duplicate aws invoice",
|
||||
model: "Qdrant/bm25",
|
||||
});
|
||||
});
|
||||
|
||||
it("falls back to payload.data when textLemmatized is absent", async () => {
|
||||
const { store, client } = await freshStore();
|
||||
await store.insert([[0.1]], ["mem-2"], [{ data: "plain text" }]);
|
||||
|
||||
const point = client.upsert.mock.calls.at(-1)![1].points[0];
|
||||
expect(point.vector.bm25).toEqual({
|
||||
text: "plain text",
|
||||
model: "Qdrant/bm25",
|
||||
});
|
||||
});
|
||||
|
||||
it("empty textLemmatized falls through to data", async () => {
|
||||
const { store, client } = await freshStore();
|
||||
await store.insert(
|
||||
[[0.1]],
|
||||
["m"],
|
||||
[{ textLemmatized: "", data: "fallback" }],
|
||||
);
|
||||
const point = client.upsert.mock.calls.at(-1)![1].points[0];
|
||||
expect(point.vector.bm25).toEqual({
|
||||
text: "fallback",
|
||||
model: "Qdrant/bm25",
|
||||
});
|
||||
});
|
||||
|
||||
it("omits the bm25 vector when the point has no text (dense still present)", async () => {
|
||||
const { store, client } = await freshStore();
|
||||
await store.insert([[0.1, 0.2]], ["m"], [{ textLemmatized: "", data: "" }]);
|
||||
const point = client.upsert.mock.calls.at(-1)![1].points[0];
|
||||
expect(point.vector[""]).toEqual([0.1, 0.2]);
|
||||
expect(point.vector.bm25).toBeUndefined();
|
||||
});
|
||||
|
||||
it("preserves the given id on insert", async () => {
|
||||
const { store, client } = await freshStore();
|
||||
await store.insert([[0.1]], ["123"], [{ data: "x" }]);
|
||||
const point = client.upsert.mock.calls.at(-1)![1].points[0];
|
||||
expect(point.id).toBe("123");
|
||||
});
|
||||
|
||||
it("batch insert attaches bm25 to every text-bearing point", async () => {
|
||||
const { store, client } = await freshStore();
|
||||
await store.insert(
|
||||
[[0.1], [0.2], [0.3]],
|
||||
["a", "b", "c"],
|
||||
[{ data: "one" }, { data: "" }, { textLemmatized: "three" }],
|
||||
);
|
||||
const points = client.upsert.mock.calls.at(-1)![1].points;
|
||||
expect(points[0].vector.bm25.text).toBe("one");
|
||||
expect(points[1].vector.bm25).toBeUndefined();
|
||||
expect(points[2].vector.bm25.text).toBe("three");
|
||||
});
|
||||
|
||||
it("re-encodes the bm25 vector on update", async () => {
|
||||
const { store, client } = await freshStore();
|
||||
await store.update("mem-1", [0.4, 0.5], {
|
||||
data: "updated",
|
||||
textLemmatized: "updat",
|
||||
});
|
||||
const point = client.upsert.mock.calls.at(-1)![1].points[0];
|
||||
expect(point.vector[""]).toEqual([0.4, 0.5]);
|
||||
expect(point.vector.bm25).toEqual({ text: "updat", model: "Qdrant/bm25" });
|
||||
});
|
||||
|
||||
it("update with no text → named dense only (bm25 not re-attached)", async () => {
|
||||
const { store, client } = await freshStore();
|
||||
await store.update("m", [0.9], { user_id: "u" });
|
||||
const point = client.upsert.mock.calls.at(-1)![1].points[0];
|
||||
expect(point.vector[""]).toEqual([0.9]);
|
||||
expect(point.vector.bm25).toBeUndefined();
|
||||
});
|
||||
|
||||
it("inserts a plain dense vector (no named/sparse) on legacy collections", async () => {
|
||||
const client = buildMockClient(
|
||||
{ createCollection: jest.fn().mockRejectedValue({ status: 409 }) },
|
||||
INFO_NO_SLOT,
|
||||
);
|
||||
const store = makeStore(client);
|
||||
await store.initialize();
|
||||
|
||||
await store.insert(
|
||||
[[0.1, 0.2]],
|
||||
["mem-1"],
|
||||
[{ data: "hello", textLemmatized: "hello" }],
|
||||
);
|
||||
|
||||
const point = client.upsert.mock.calls.at(-1)![1].points[0];
|
||||
expect(point.vector).toEqual([0.1, 0.2]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Qdrant BM25 keyword search — querying & result mapping", () => {
|
||||
it("queries the bm25 slot and maps results to {id, payload, score}", async () => {
|
||||
const client = buildMockClient({
|
||||
query: jest.fn().mockResolvedValue({
|
||||
points: [
|
||||
{ id: "mem-1", score: 4.2, payload: { data: "AWS invoice" } },
|
||||
{ id: "mem-2", score: 1.1, payload: { data: "other" } },
|
||||
],
|
||||
}),
|
||||
});
|
||||
const store = makeStore(client);
|
||||
await store.initialize();
|
||||
|
||||
const results = await store.keywordSearch("aws invoice", 5, {
|
||||
user_id: "u1",
|
||||
});
|
||||
|
||||
expect(client.query).toHaveBeenCalledWith(
|
||||
"test_memories",
|
||||
expect.objectContaining({
|
||||
query: { text: "aws invoice", model: "Qdrant/bm25" },
|
||||
using: "bm25",
|
||||
limit: 5,
|
||||
with_payload: true,
|
||||
}),
|
||||
);
|
||||
expect(results).toEqual([
|
||||
{ id: "mem-1", payload: { data: "AWS invoice" }, score: 4.2 },
|
||||
{ id: "mem-2", payload: { data: "other" }, score: 1.1 },
|
||||
]);
|
||||
});
|
||||
|
||||
async function storeWith(queryImpl: jest.Mock): Promise<Qdrant> {
|
||||
const client = buildMockClient({ query: queryImpl });
|
||||
const store = makeStore(client);
|
||||
await store.initialize();
|
||||
return store;
|
||||
}
|
||||
|
||||
it("query rejects → null (no throw)", async () => {
|
||||
const store = await storeWith(
|
||||
jest.fn().mockRejectedValue(new Error("boom")),
|
||||
);
|
||||
expect(await store.keywordSearch("x")).toBeNull();
|
||||
expect(errSpy).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("response missing the `points` array → null (no throw)", async () => {
|
||||
const store = await storeWith(jest.fn().mockResolvedValue({}));
|
||||
expect(await store.keywordSearch("x")).toBeNull();
|
||||
expect(errSpy).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("response is null → null (no throw)", async () => {
|
||||
const store = await storeWith(jest.fn().mockResolvedValue(null));
|
||||
expect(await store.keywordSearch("x")).toBeNull();
|
||||
});
|
||||
|
||||
it("point with numeric id → stringified", async () => {
|
||||
const store = await storeWith(
|
||||
jest.fn().mockResolvedValue({
|
||||
points: [{ id: 42, score: 1.0, payload: { data: "d" } }],
|
||||
}),
|
||||
);
|
||||
const res = await store.keywordSearch("x");
|
||||
expect(res![0].id).toBe("42");
|
||||
});
|
||||
|
||||
it("point with missing score → score undefined (pipeline coerces to 0)", async () => {
|
||||
const store = await storeWith(
|
||||
jest.fn().mockResolvedValue({ points: [{ id: "a", payload: {} }] }),
|
||||
);
|
||||
const res = await store.keywordSearch("x");
|
||||
expect(res![0].score).toBeUndefined();
|
||||
});
|
||||
|
||||
it("point with missing payload → {}", async () => {
|
||||
const store = await storeWith(
|
||||
jest.fn().mockResolvedValue({ points: [{ id: "a", score: 2 }] }),
|
||||
);
|
||||
const res = await store.keywordSearch("x");
|
||||
expect(res![0].payload).toEqual({});
|
||||
});
|
||||
|
||||
it("empty query string is forwarded and yields [] (graceful)", async () => {
|
||||
const queryImpl = jest.fn().mockResolvedValue({ points: [] });
|
||||
const store = await storeWith(queryImpl);
|
||||
const res = await store.keywordSearch("");
|
||||
expect(res).toEqual([]);
|
||||
expect(queryImpl.mock.calls[0][1].query).toEqual({
|
||||
text: "",
|
||||
model: "Qdrant/bm25",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("Qdrant BM25 keyword search — query construction & filters", () => {
|
||||
async function freshStore(): Promise<{ store: Qdrant; client: MockClient }> {
|
||||
const client = buildMockClient();
|
||||
const store = makeStore(client);
|
||||
await store.initialize();
|
||||
return { store, client };
|
||||
}
|
||||
|
||||
it("defaults topK to 5 when omitted", async () => {
|
||||
const { store, client } = await freshStore();
|
||||
await store.keywordSearch("x");
|
||||
expect(client.query.mock.calls[0][1].limit).toBe(5);
|
||||
});
|
||||
|
||||
it("passes a simple equality filter through createFilter", async () => {
|
||||
const { store, client } = await freshStore();
|
||||
await store.keywordSearch("x", 3, { user_id: "u1" });
|
||||
const arg = client.query.mock.calls[0][1];
|
||||
expect(arg.limit).toBe(3);
|
||||
expect(arg.using).toBe("bm25");
|
||||
expect(arg.filter).toEqual({
|
||||
must: [{ key: "user_id", match: { value: "u1" } }],
|
||||
});
|
||||
});
|
||||
|
||||
it("builds an OR (should) clause for logical filters", async () => {
|
||||
const { store, client } = await freshStore();
|
||||
await store.keywordSearch("x", 5, {
|
||||
$or: [{ user_id: "u1" }, { agent_id: "a1" }],
|
||||
});
|
||||
const filter = client.query.mock.calls[0][1].filter;
|
||||
expect(filter.should).toHaveLength(2);
|
||||
});
|
||||
|
||||
it("empty filter object → filter is undefined", async () => {
|
||||
const { store, client } = await freshStore();
|
||||
await store.keywordSearch("x", 5, {});
|
||||
expect(client.query.mock.calls[0][1].filter).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe("Qdrant BM25 keyword search — reactive downgrade on upsert failure", () => {
|
||||
it("insert(): upsert fails once, retries with plain dense vector, disables bm25", async () => {
|
||||
const upsert = jest
|
||||
.fn()
|
||||
.mockRejectedValueOnce({
|
||||
status: 500,
|
||||
message: "InferenceService is not initialized.",
|
||||
})
|
||||
.mockResolvedValueOnce(undefined);
|
||||
const client = buildMockClient({ upsert });
|
||||
const store = makeStore(client);
|
||||
await store.initialize();
|
||||
|
||||
await store.insert(
|
||||
[[0.1, 0.2]],
|
||||
["mem-1"],
|
||||
[{ data: "hello", textLemmatized: "hello" }],
|
||||
);
|
||||
|
||||
expect(upsert).toHaveBeenCalledTimes(2);
|
||||
const retryPoint = upsert.mock.calls[1][1].points[0];
|
||||
expect(retryPoint.vector).toEqual([0.1, 0.2]);
|
||||
expect(warnSpy).toHaveBeenCalledTimes(1);
|
||||
expect(await store.keywordSearch("hello")).toBeNull();
|
||||
});
|
||||
|
||||
it("update(): upsert fails once, retries with plain dense vector, disables bm25", async () => {
|
||||
const upsert = jest
|
||||
.fn()
|
||||
.mockRejectedValueOnce({
|
||||
status: 500,
|
||||
message: "InferenceService is not initialized.",
|
||||
})
|
||||
.mockResolvedValueOnce(undefined);
|
||||
const client = buildMockClient({ upsert });
|
||||
const store = makeStore(client);
|
||||
await store.initialize();
|
||||
|
||||
await store.update("mem-1", [0.4, 0.5], {
|
||||
data: "updated",
|
||||
textLemmatized: "updat",
|
||||
});
|
||||
|
||||
expect(upsert).toHaveBeenCalledTimes(2);
|
||||
const retryPoint = upsert.mock.calls[1][1].points[0];
|
||||
expect(retryPoint.vector).toEqual([0.4, 0.5]);
|
||||
expect(warnSpy).toHaveBeenCalledTimes(1);
|
||||
expect(await store.keywordSearch("updat")).toBeNull();
|
||||
});
|
||||
|
||||
it("legacy collection (no bm25 slot): a genuine upsert failure still rejects, not swallowed", async () => {
|
||||
const client = buildMockClient(
|
||||
{
|
||||
createCollection: jest.fn().mockRejectedValue({ status: 409 }),
|
||||
upsert: jest.fn().mockRejectedValue(new Error("network down")),
|
||||
},
|
||||
INFO_NO_SLOT,
|
||||
);
|
||||
const store = makeStore(client);
|
||||
await store.initialize();
|
||||
|
||||
await expect(store.insert([[0.1]], ["m"], [{ data: "x" }])).rejects.toThrow(
|
||||
"network down",
|
||||
);
|
||||
expect(client.upsert).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("after a downgrade, a subsequent insert() sends a plain dense vector on the first attempt", async () => {
|
||||
const upsert = jest
|
||||
.fn()
|
||||
.mockRejectedValueOnce({
|
||||
status: 500,
|
||||
message: "InferenceService is not initialized.",
|
||||
})
|
||||
.mockResolvedValueOnce(undefined)
|
||||
.mockResolvedValueOnce(undefined);
|
||||
const client = buildMockClient({ upsert });
|
||||
const store = makeStore(client);
|
||||
await store.initialize();
|
||||
|
||||
await store.insert([[0.1]], ["mem-1"], [{ data: "first" }]);
|
||||
expect(upsert).toHaveBeenCalledTimes(2);
|
||||
|
||||
await store.insert([[0.2]], ["mem-2"], [{ data: "second" }]);
|
||||
expect(upsert).toHaveBeenCalledTimes(3);
|
||||
const secondInsertPoint = upsert.mock.calls[2][1].points[0];
|
||||
expect(secondInsertPoint.vector).toEqual([0.2]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Qdrant BM25 keyword search — memory_migrations indexing", () => {
|
||||
it("does not create payload indexes for memory_migrations on the existing-collection path", async () => {
|
||||
const client = buildMockClient({
|
||||
createCollection: jest.fn().mockRejectedValue({ status: 409 }),
|
||||
});
|
||||
const store = makeStore(client);
|
||||
await store.initialize();
|
||||
|
||||
const migrationsIndexCalls = client.createPayloadIndex.mock.calls.filter(
|
||||
(c) => c[0] === "memory_migrations",
|
||||
);
|
||||
expect(migrationsIndexCalls).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Qdrant BM25 keyword search — semantic (dense) path", () => {
|
||||
it("search() still targets the unnamed dense slot after BM25 init", async () => {
|
||||
const client = buildMockClient({
|
||||
search: jest
|
||||
.fn()
|
||||
.mockResolvedValue([
|
||||
{ id: "mem-1", score: 0.9, payload: { data: "x" } },
|
||||
]),
|
||||
});
|
||||
const store = makeStore(client);
|
||||
await store.initialize();
|
||||
|
||||
const res = await store.search([0.1, 0.2, 0.3], 5);
|
||||
|
||||
// Plain number[] (not a named vector) keeps hitting the default dense slot.
|
||||
expect(client.search).toHaveBeenCalledWith(
|
||||
"test_memories",
|
||||
expect.objectContaining({ vector: [0.1, 0.2, 0.3] }),
|
||||
);
|
||||
expect(res[0].id).toBe("mem-1");
|
||||
});
|
||||
});
|
||||
@@ -20,6 +20,7 @@ describe("TogetherEmbedder (unit)", () => {
|
||||
jest.resetModules();
|
||||
process.env = { ...originalEnv };
|
||||
delete process.env.TOGETHER_API_KEY;
|
||||
delete process.env.TOGETHER_API_BASE;
|
||||
mockOpenAI.mockClear();
|
||||
mockEmbeddingsCreate.mockReset();
|
||||
mockEmbeddingsCreate.mockResolvedValue({
|
||||
@@ -81,6 +82,35 @@ describe("TogetherEmbedder (unit)", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("honors TOGETHER_API_BASE when no baseURL is configured", async () => {
|
||||
process.env.TOGETHER_API_BASE = "https://gateway.example/v1";
|
||||
|
||||
const embedder = new TogetherEmbedder({ apiKey: "test-key" });
|
||||
|
||||
await embedder.embed("hello");
|
||||
|
||||
expect(mockOpenAI).toHaveBeenCalledWith({
|
||||
apiKey: "test-key",
|
||||
baseURL: "https://gateway.example/v1",
|
||||
});
|
||||
});
|
||||
|
||||
it("prefers an explicit baseURL over TOGETHER_API_BASE", async () => {
|
||||
process.env.TOGETHER_API_BASE = "https://gateway.example/v1";
|
||||
|
||||
const embedder = new TogetherEmbedder({
|
||||
apiKey: "test-key",
|
||||
baseURL: "https://explicit.example/v1",
|
||||
});
|
||||
|
||||
await embedder.embed("hello");
|
||||
|
||||
expect(mockOpenAI).toHaveBeenCalledWith({
|
||||
apiKey: "test-key",
|
||||
baseURL: "https://explicit.example/v1",
|
||||
});
|
||||
});
|
||||
|
||||
it("uses url as a baseURL fallback", async () => {
|
||||
const embedder = new TogetherEmbedder({
|
||||
apiKey: "test-key",
|
||||
|
||||
@@ -531,34 +531,43 @@ describe("Redis – backward compat with mocked client", () => {
|
||||
// ───────────────────────────────────────────────────────────────────────────
|
||||
describe("Supabase – backward compat with mocked client", () => {
|
||||
let SupabaseDB: any;
|
||||
let mockClient: any;
|
||||
let mockTableApi: any;
|
||||
let mockSelectBuilder: any;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
|
||||
jest.doMock("@supabase/supabase-js", () => {
|
||||
const mockClient = {
|
||||
from: jest.fn().mockReturnValue({
|
||||
insert: jest.fn().mockReturnValue({
|
||||
select: jest.fn().mockReturnValue({ error: null }),
|
||||
}),
|
||||
select: jest.fn().mockReturnValue({
|
||||
eq: jest.fn().mockReturnValue({ data: [], error: null }),
|
||||
}),
|
||||
delete: jest.fn().mockReturnValue({
|
||||
eq: jest.fn().mockReturnValue({ error: null }),
|
||||
}),
|
||||
update: jest.fn().mockReturnValue({
|
||||
eq: jest.fn().mockReturnValue({ error: null }),
|
||||
}),
|
||||
upsert: jest.fn().mockReturnValue({ error: null }),
|
||||
}),
|
||||
rpc: jest.fn().mockResolvedValue({ data: [], error: null }),
|
||||
};
|
||||
return {
|
||||
createClient: jest.fn().mockReturnValue(mockClient),
|
||||
__mockClient: mockClient,
|
||||
};
|
||||
});
|
||||
mockSelectBuilder = {
|
||||
limit: jest.fn().mockResolvedValue({ data: [{}], error: null }),
|
||||
range: jest.fn().mockResolvedValue({ data: [], error: null, count: 0 }),
|
||||
maybeSingle: jest.fn().mockResolvedValue({ data: null, error: null }),
|
||||
};
|
||||
mockSelectBuilder.eq = jest.fn().mockReturnValue(mockSelectBuilder);
|
||||
mockSelectBuilder.order = jest.fn().mockReturnValue(mockSelectBuilder);
|
||||
|
||||
mockTableApi = {
|
||||
select: jest.fn().mockReturnValue(mockSelectBuilder),
|
||||
insert: jest.fn().mockReturnValue({ error: null }),
|
||||
delete: jest.fn().mockReturnValue({
|
||||
eq: jest.fn().mockReturnValue({ error: null }),
|
||||
neq: jest.fn().mockReturnValue({ error: null }),
|
||||
}),
|
||||
update: jest.fn().mockReturnValue({
|
||||
eq: jest.fn().mockReturnValue({ error: null }),
|
||||
}),
|
||||
upsert: jest.fn().mockReturnValue({ error: null }),
|
||||
};
|
||||
|
||||
mockClient = {
|
||||
from: jest.fn().mockReturnValue(mockTableApi),
|
||||
rpc: jest.fn().mockResolvedValue({ data: [], error: null }),
|
||||
};
|
||||
|
||||
jest.doMock("@supabase/supabase-js", () => ({
|
||||
createClient: jest.fn().mockReturnValue(mockClient),
|
||||
__mockClient: mockClient,
|
||||
}));
|
||||
|
||||
SupabaseDB = require("../src/vector_stores/supabase").SupabaseDB;
|
||||
});
|
||||
@@ -598,7 +607,86 @@ describe("Supabase – backward compat with mocked client", () => {
|
||||
const p1 = store.initialize();
|
||||
const p2 = store.initialize();
|
||||
await Promise.all([p1, p2]);
|
||||
// No crash = idempotent (Supabase init runs test insert only once)
|
||||
// No crash = idempotent (Supabase init runs a read-only probe query only once)
|
||||
});
|
||||
|
||||
it("_doInitialize probes with a non-destructive select, not an insert", async () => {
|
||||
const store = new SupabaseDB({
|
||||
supabaseUrl: "https://example.supabase.co",
|
||||
supabaseKey: "fake-key",
|
||||
tableName: "memories",
|
||||
collectionName: "test",
|
||||
});
|
||||
|
||||
await store.initialize();
|
||||
|
||||
expect(mockTableApi.insert).not.toHaveBeenCalled();
|
||||
expect(mockTableApi.select).toHaveBeenCalledWith("embedding");
|
||||
expect(mockSelectBuilder.limit).toHaveBeenCalledWith(1);
|
||||
});
|
||||
|
||||
it("list() paginates via .range() across multiple pages when count exceeds page size", async () => {
|
||||
const totalRows = 1500;
|
||||
const rangeMock = jest
|
||||
.fn()
|
||||
.mockImplementation((from: number, to: number) => {
|
||||
const remaining = totalRows - from;
|
||||
const rowCount = Math.max(0, Math.min(to - from + 1, remaining));
|
||||
const data = Array.from({ length: rowCount }, (_, i) => ({
|
||||
id: `id-${from + i}`,
|
||||
metadata: { index: from + i },
|
||||
}));
|
||||
return Promise.resolve({ data, error: null, count: totalRows });
|
||||
});
|
||||
|
||||
const listBuilder: any = {
|
||||
limit: jest.fn().mockResolvedValue({ data: [{}], error: null }),
|
||||
range: rangeMock,
|
||||
};
|
||||
listBuilder.eq = jest.fn().mockReturnValue(listBuilder);
|
||||
listBuilder.order = jest.fn().mockReturnValue(listBuilder);
|
||||
mockTableApi.select.mockReturnValue(listBuilder);
|
||||
|
||||
const store = new SupabaseDB({
|
||||
supabaseUrl: "https://example.supabase.co",
|
||||
supabaseKey: "fake-key",
|
||||
tableName: "memories",
|
||||
collectionName: "test",
|
||||
});
|
||||
|
||||
const [results, count] = await store.list(undefined, totalRows);
|
||||
|
||||
expect(count).toBe(totalRows);
|
||||
expect(results).toHaveLength(totalRows);
|
||||
expect(rangeMock.mock.calls.length).toBeGreaterThan(1);
|
||||
expect(listBuilder.order).toHaveBeenCalledWith("id", { ascending: true });
|
||||
expect(new Set(results.map((r) => r.id)).size).toBe(totalRows);
|
||||
});
|
||||
|
||||
it("search() warns when results are truncated at the PostgREST row cap", async () => {
|
||||
const cappedResults = Array.from({ length: 1000 }, (_, i) => ({
|
||||
id: `id-${i}`,
|
||||
similarity: 0.9,
|
||||
metadata: {},
|
||||
}));
|
||||
|
||||
const warnSpy = jest.spyOn(console, "warn").mockImplementation(() => {});
|
||||
|
||||
const store = new SupabaseDB({
|
||||
supabaseUrl: "https://example.supabase.co",
|
||||
supabaseKey: "fake-key",
|
||||
tableName: "memories",
|
||||
collectionName: "test",
|
||||
});
|
||||
mockClient.rpc.mockResolvedValue({ data: cappedResults, error: null });
|
||||
|
||||
const results = await store.search([0.1, 0.2, 0.3], 5000);
|
||||
|
||||
expect(results).toHaveLength(1000);
|
||||
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining("5000"));
|
||||
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining("1000"));
|
||||
|
||||
warnSpy.mockRestore();
|
||||
});
|
||||
|
||||
it("constructor does not emit an unhandled rejection when init fails", async () => {
|
||||
@@ -606,14 +694,15 @@ describe("Supabase – backward compat with mocked client", () => {
|
||||
jest.doMock("@supabase/supabase-js", () => {
|
||||
const failing = {
|
||||
from: jest.fn().mockReturnValue({
|
||||
insert: jest.fn().mockReturnValue({
|
||||
select: jest.fn().mockResolvedValue({
|
||||
error: { code: "42P01", message: "no table" },
|
||||
select: jest.fn().mockReturnValue({
|
||||
limit: jest.fn().mockResolvedValue({
|
||||
data: null,
|
||||
error: {
|
||||
code: "42501",
|
||||
message: "permission denied for table memories",
|
||||
},
|
||||
}),
|
||||
}),
|
||||
delete: jest.fn().mockReturnValue({
|
||||
eq: jest.fn().mockResolvedValue({ error: null }),
|
||||
}),
|
||||
}),
|
||||
};
|
||||
return { createClient: jest.fn().mockReturnValue(failing) };
|
||||
@@ -5088,20 +5177,22 @@ describe("Memory class – backward compat with all providers", () => {
|
||||
updated_at: new Date().toISOString(),
|
||||
},
|
||||
});
|
||||
mockVStore.list.mockResolvedValue([
|
||||
[
|
||||
{
|
||||
id: memoryId,
|
||||
payload: {
|
||||
memory: "test",
|
||||
hash: "h",
|
||||
created_at: new Date().toISOString(),
|
||||
updated_at: new Date().toISOString(),
|
||||
mockVStore.list
|
||||
.mockResolvedValueOnce([
|
||||
[
|
||||
{
|
||||
id: memoryId,
|
||||
payload: {
|
||||
memory: "test",
|
||||
hash: "h",
|
||||
created_at: new Date().toISOString(),
|
||||
updated_at: new Date().toISOString(),
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
1,
|
||||
]);
|
||||
],
|
||||
1,
|
||||
])
|
||||
.mockResolvedValue([[], 0]);
|
||||
mockVectorStoreFactory.create.mockReturnValue(mockVStore);
|
||||
|
||||
const mem = new MemoryClass({
|
||||
|
||||
@@ -31,7 +31,7 @@ class BaseLlmConfig(ABC):
|
||||
Initialize a base configuration class instance for the LLM.
|
||||
|
||||
Args:
|
||||
model: The model identifier to use (e.g., "gpt-4.1-nano-2025-04-14", "claude-3-5-sonnet-20240620")
|
||||
model: The model identifier to use (e.g., "gpt-5-mini", "claude-3-5-sonnet-20240620")
|
||||
Defaults to None (will be set by provider-specific configs)
|
||||
temperature: Controls the randomness of the model's output.
|
||||
Higher values (closer to 1) make output more random, lower values make it more deterministic.
|
||||
|
||||
@@ -10,7 +10,7 @@ class LLMRerankerConfig(BaseRerankerConfig):
|
||||
Configuration for LLM-based reranker.
|
||||
|
||||
Attributes:
|
||||
model (str): LLM model to use for reranking. Defaults to "gpt-4o-mini".
|
||||
model (str): LLM model to use for reranking. Defaults to "gpt-5-mini".
|
||||
api_key (str): API key for the LLM provider.
|
||||
provider (str): LLM provider. Defaults to "openai".
|
||||
top_k (int): Number of top documents to return after reranking.
|
||||
@@ -20,7 +20,7 @@ class LLMRerankerConfig(BaseRerankerConfig):
|
||||
"""
|
||||
|
||||
model: str = Field(
|
||||
default="gpt-4o-mini",
|
||||
default="gpt-5-mini",
|
||||
description="LLM model to use for reranking"
|
||||
)
|
||||
api_key: Optional[str] = Field(
|
||||
|
||||
+1
-1
@@ -353,7 +353,7 @@ class LLMError(MemoryError):
|
||||
raise LLMError(
|
||||
message="LLM operation failed",
|
||||
error_code="LLM_001",
|
||||
details={"model": "gpt-4", "prompt_length": 500},
|
||||
details={"model": "gpt-5-mini", "prompt_length": 500},
|
||||
suggestion="Please check your LLM configuration and API key"
|
||||
)
|
||||
"""
|
||||
|
||||
+51
-17
@@ -133,6 +133,7 @@ _SENSITIVE_SUFFIXES = (
|
||||
|
||||
# Entity parameters that must be passed via filters, not top-level kwargs
|
||||
ENTITY_PARAMS = frozenset({"user_id", "agent_id", "run_id"})
|
||||
DELETE_ALL_BATCH_SIZE = 1000
|
||||
|
||||
# Tenant-scoping fields that update() must never let caller-supplied metadata overwrite (issues #4490, #6277).
|
||||
_IDENTITY_KEYS = ENTITY_PARAMS | {"actor_id"}
|
||||
@@ -1885,14 +1886,28 @@ class Memory(MemoryBase):
|
||||
|
||||
keys, encoded_ids = process_telemetry_filters(filters)
|
||||
capture_event("mem0.delete_all", self, {"keys": keys, "encoded_ids": encoded_ids, "sync_type": "sync"})
|
||||
# delete all vector memories and reset the collections
|
||||
memories = self.vector_store.list(filters=filters)[0]
|
||||
for memory in memories:
|
||||
self._delete_memory(memory.id)
|
||||
# Keep listing after each batch is deleted. Most vector stores cap
|
||||
# list() at 100 results by default, which silently truncates deletes.
|
||||
deleted_count = 0
|
||||
seen_batches = set()
|
||||
while True:
|
||||
memories = self.vector_store.list(
|
||||
filters=filters, top_k=DELETE_ALL_BATCH_SIZE
|
||||
)[0]
|
||||
if not memories:
|
||||
break
|
||||
batch_ids = tuple(sorted(str(memory.id) for memory in memories))
|
||||
if batch_ids in seen_batches:
|
||||
logger.warning("Stopping delete_all after a repeated memory batch")
|
||||
break
|
||||
seen_batches.add(batch_ids)
|
||||
for memory in memories:
|
||||
self._delete_memory(memory.id)
|
||||
deleted_count += len(memories)
|
||||
|
||||
logger.info(f"Deleted {len(memories)} memories")
|
||||
logger.info(f"Deleted {deleted_count} memories")
|
||||
|
||||
decay_usage_notice = detect_decay_usage_from_delete_all(len(memories))
|
||||
decay_usage_notice = detect_decay_usage_from_delete_all(deleted_count)
|
||||
if decay_usage_notice:
|
||||
display_decay_usage_notice(self, "sync", "delete_all", *decay_usage_notice)
|
||||
else:
|
||||
@@ -3515,26 +3530,45 @@ class AsyncMemory(MemoryBase):
|
||||
|
||||
keys, encoded_ids = process_telemetry_filters(filters)
|
||||
capture_event("mem0.delete_all", self, {"keys": keys, "encoded_ids": encoded_ids, "sync_type": "async"})
|
||||
memories = await asyncio.to_thread(self.vector_store.list, filters=filters)
|
||||
|
||||
delete_tasks = []
|
||||
for memory in memories[0]:
|
||||
delete_tasks.append(self._delete_memory(memory.id, skip_entity_cleanup=True))
|
||||
|
||||
results = await asyncio.gather(*delete_tasks, return_exceptions=True)
|
||||
deleted_count = 0
|
||||
errors = []
|
||||
seen_batches = set()
|
||||
while True:
|
||||
memories = await asyncio.to_thread(
|
||||
self.vector_store.list,
|
||||
filters=filters,
|
||||
top_k=DELETE_ALL_BATCH_SIZE,
|
||||
)
|
||||
batch = memories[0] if memories else []
|
||||
if not batch:
|
||||
break
|
||||
batch_ids = tuple(sorted(str(memory.id) for memory in batch))
|
||||
if batch_ids in seen_batches:
|
||||
logger.warning("Stopping delete_all after a repeated memory batch")
|
||||
break
|
||||
seen_batches.add(batch_ids)
|
||||
delete_tasks = [
|
||||
self._delete_memory(memory.id, skip_entity_cleanup=True)
|
||||
for memory in batch
|
||||
]
|
||||
results = await asyncio.gather(*delete_tasks, return_exceptions=True)
|
||||
batch_errors = [
|
||||
result for result in results if isinstance(result, BaseException)
|
||||
]
|
||||
errors.extend(batch_errors)
|
||||
deleted_count += len(results) - len(batch_errors)
|
||||
|
||||
if self._entity_store is not None:
|
||||
await self._bulk_clear_entity_store(filters)
|
||||
|
||||
errors = [r for r in results if isinstance(r, BaseException)]
|
||||
if errors:
|
||||
logger.warning("Failed to delete %d out of %d memories", len(errors), len(results))
|
||||
logger.warning("Failed to delete %d memories", len(errors))
|
||||
for err in errors:
|
||||
logger.warning("Delete error: %s", err)
|
||||
|
||||
logger.info(f"Deleted {len(results) - len(errors)} memories")
|
||||
logger.info(f"Deleted {deleted_count} memories")
|
||||
|
||||
decay_usage_notice = detect_decay_usage_from_delete_all(len(memories[0]))
|
||||
decay_usage_notice = detect_decay_usage_from_delete_all(deleted_count)
|
||||
if decay_usage_notice:
|
||||
await display_decay_usage_notice_async(self, "async", "delete_all", *decay_usage_notice)
|
||||
else:
|
||||
|
||||
@@ -27,7 +27,7 @@ class LLMReranker(BaseReranker):
|
||||
# Convert BaseRerankerConfig to LLMRerankerConfig with defaults
|
||||
config = LLMRerankerConfig(
|
||||
provider=getattr(config, 'provider', 'openai'),
|
||||
model=getattr(config, 'model', 'gpt-4o-mini'),
|
||||
model=getattr(config, 'model', 'gpt-5-mini'),
|
||||
api_key=getattr(config, 'api_key', None),
|
||||
top_k=getattr(config, 'top_k', None),
|
||||
temperature=0.0, # Default for reranking
|
||||
|
||||
@@ -163,7 +163,10 @@ class ElasticsearchDB(VectorStoreBase):
|
||||
search_query = self.custom_search_query(vectors, top_k, filters)
|
||||
else:
|
||||
search_query = {
|
||||
"knn": {"field": "vector", "query_vector": vectors, "k": top_k, "num_candidates": top_k * 2}
|
||||
# Without `size`, Elasticsearch caps the response at its default of 10 hits
|
||||
# regardless of `knn.k`, silently truncating results when top_k > 10.
|
||||
"size": top_k,
|
||||
"knn": {"field": "vector", "query_vector": vectors, "k": top_k, "num_candidates": top_k * 2},
|
||||
}
|
||||
if filters:
|
||||
filter_conditions = []
|
||||
|
||||
@@ -14,6 +14,8 @@ from mem0.vector_stores.base import VectorStoreBase
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
VECS_MAX_QUERY_LIMIT = 1000
|
||||
|
||||
|
||||
class OutputData(BaseModel):
|
||||
id: Optional[str]
|
||||
@@ -131,11 +133,21 @@ class Supabase(VectorStoreBase):
|
||||
List[OutputData]: Search results
|
||||
"""
|
||||
filters = self._preprocess_filters(filters)
|
||||
limit = top_k
|
||||
if limit > VECS_MAX_QUERY_LIMIT:
|
||||
logger.warning(
|
||||
f"Requested top_k={top_k} exceeds the vecs query limit of {VECS_MAX_QUERY_LIMIT}; "
|
||||
f"capping to {VECS_MAX_QUERY_LIMIT}."
|
||||
)
|
||||
limit = VECS_MAX_QUERY_LIMIT
|
||||
results = self.collection.query(
|
||||
data=vectors, limit=top_k, filters=filters, include_metadata=True, include_value=True
|
||||
data=vectors, limit=limit, filters=filters, include_metadata=True, include_value=True
|
||||
)
|
||||
|
||||
return [OutputData(id=str(result[0]), score=max(0.0, 1.0 - float(result[1])), payload=result[2]) for result in results]
|
||||
return [
|
||||
OutputData(id=str(result[0]), score=max(0.0, 1.0 - float(result[1])), payload=result[2])
|
||||
for result in results
|
||||
]
|
||||
|
||||
def delete(self, vector_id: str):
|
||||
"""
|
||||
@@ -201,12 +213,15 @@ class Supabase(VectorStoreBase):
|
||||
Returns:
|
||||
Dict: Collection information including name and configuration
|
||||
"""
|
||||
info = self.collection.describe()
|
||||
return {
|
||||
"name": info.name,
|
||||
"count": info.vectors,
|
||||
"dimension": info.dimension,
|
||||
"index": {"method": info.index_method, "metric": info.distance_metric},
|
||||
"name": self.collection.name,
|
||||
"count": len(self.collection),
|
||||
"dimension": self.collection.dimension,
|
||||
"index": {
|
||||
"name": self.collection.index,
|
||||
"measure": self.index_measure.value,
|
||||
"is_indexed": self.collection.is_indexed_for_measure(self.index_measure),
|
||||
},
|
||||
}
|
||||
|
||||
def list(self, filters: Optional[dict] = None, top_k: int = 100) -> List[OutputData]:
|
||||
@@ -222,8 +237,15 @@ class Supabase(VectorStoreBase):
|
||||
"""
|
||||
filters = self._preprocess_filters(filters)
|
||||
query = [0] * self.embedding_model_dims
|
||||
limit = top_k
|
||||
if limit > VECS_MAX_QUERY_LIMIT:
|
||||
logger.warning(
|
||||
f"Requested top_k={top_k} exceeds the vecs query limit of {VECS_MAX_QUERY_LIMIT}; "
|
||||
f"capping to {VECS_MAX_QUERY_LIMIT}."
|
||||
)
|
||||
limit = VECS_MAX_QUERY_LIMIT
|
||||
ids = self.collection.query(
|
||||
data=query, limit=top_k, filters=filters, include_metadata=True, include_value=False
|
||||
data=query, limit=limit, filters=filters, include_metadata=True, include_value=False
|
||||
)
|
||||
ids = [id[0] for id in ids]
|
||||
records = self.collection.fetch(ids=ids)
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "mem0ai"
|
||||
version = "2.0.14"
|
||||
version = "2.0.15"
|
||||
description = "Long-term memory for AI Agents"
|
||||
authors = [
|
||||
{ name = "Mem0", email = "support@mem0.ai" }
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ APP_DB_NAME=mem0_app
|
||||
|
||||
# Default LLM and embedder models. Provider must be in BUNDLED_*_PROVIDERS
|
||||
# (see server/main.py). Override to pin a specific model without editing code.
|
||||
MEM0_DEFAULT_LLM_MODEL=gpt-4.1-nano-2025-04-14
|
||||
MEM0_DEFAULT_LLM_MODEL=gpt-5-mini
|
||||
MEM0_DEFAULT_EMBEDDER_MODEL=text-embedding-3-small
|
||||
|
||||
# Anonymous telemetry. Sends a single onboarding event per install
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"@radix-ui/react-tooltip": "^1.0.7",
|
||||
"@reduxjs/toolkit": "^2.3.0",
|
||||
"@tanstack/react-table": "^8.17.3",
|
||||
"axios": "^1.16.0",
|
||||
"axios": "^1.18.0",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.0",
|
||||
"cmdk": "^1.0.0",
|
||||
@@ -45,7 +45,7 @@
|
||||
"framer-motion": "^12.23.12",
|
||||
"lodash": "^4.18.1",
|
||||
"lucide-react": "^0.542.0",
|
||||
"next": "15.5.18",
|
||||
"next": "15.5.21",
|
||||
"next-themes": "^0.4.4",
|
||||
"react": "^19.0.0",
|
||||
"react-copy-to-clipboard": "^5.1.0",
|
||||
|
||||
Generated
+97
-92
@@ -6,9 +6,14 @@ settings:
|
||||
|
||||
overrides:
|
||||
form-data@<4.0.6: '>=4.0.6'
|
||||
postcss@<8.5.10: '>=8.5.10'
|
||||
prismjs@<1.30.0: '>=1.30.0'
|
||||
uuid@<11.1.1: '>=11.1.1'
|
||||
axios@<1.18.0: '>=1.18.0 <2.0.0'
|
||||
brace-expansion@<1.1.16: '>=1.1.16 <2.0.0'
|
||||
brace-expansion@>=3.0.0 <5.0.8: '>=5.0.8 <6.0.0'
|
||||
js-yaml@<3.15.0: '>=3.15.0 <4.0.0'
|
||||
js-yaml@>=4.0.0 <4.3.0: '>=4.3.0 <5.0.0'
|
||||
postcss@<8.5.18: '>=8.5.18 <9.0.0'
|
||||
|
||||
importers:
|
||||
|
||||
@@ -90,8 +95,8 @@ importers:
|
||||
specifier: ^8.17.3
|
||||
version: 8.21.3(react-dom@19.2.7(react@19.2.7))(react@19.2.7)
|
||||
axios:
|
||||
specifier: ^1.16.0
|
||||
version: 1.17.0
|
||||
specifier: ^1.18.0
|
||||
version: 1.18.1
|
||||
class-variance-authority:
|
||||
specifier: ^0.7.1
|
||||
version: 0.7.1
|
||||
@@ -114,8 +119,8 @@ importers:
|
||||
specifier: ^0.542.0
|
||||
version: 0.542.0(react@19.2.7)
|
||||
next:
|
||||
specifier: 15.5.18
|
||||
version: 15.5.18(react-dom@19.2.7(react@19.2.7))(react@19.2.7)
|
||||
specifier: 15.5.21
|
||||
version: 15.5.21(react-dom@19.2.7(react@19.2.7))(react@19.2.7)
|
||||
next-themes:
|
||||
specifier: ^0.4.4
|
||||
version: 0.4.6(react-dom@19.2.7(react@19.2.7))(react@19.2.7)
|
||||
@@ -194,7 +199,7 @@ importers:
|
||||
version: 9.0.8
|
||||
autoprefixer:
|
||||
specifier: ^10.0.1
|
||||
version: 10.5.0(postcss@8.5.15)
|
||||
version: 10.5.0(postcss@8.5.23)
|
||||
eslint:
|
||||
specifier: ^8
|
||||
version: 8.57.1
|
||||
@@ -202,8 +207,8 @@ importers:
|
||||
specifier: 15.5.18
|
||||
version: 15.5.18(eslint@8.57.1)(typescript@5.9.3)
|
||||
postcss:
|
||||
specifier: '>=8.5.10'
|
||||
version: 8.5.15
|
||||
specifier: '>=8.5.18 <9.0.0'
|
||||
version: 8.5.23
|
||||
prettier:
|
||||
specifier: ^3.5.2
|
||||
version: 3.8.4
|
||||
@@ -459,60 +464,60 @@ packages:
|
||||
'@emnapi/core': ^1.7.1
|
||||
'@emnapi/runtime': ^1.7.1
|
||||
|
||||
'@next/env@15.5.18':
|
||||
resolution: {integrity: sha512-hAV85Ckd9QR6RvH04MEKwsfLTksvFpO47j9xwtoIuvuPnlwecpSi+uZTtm8HirVbtlI2Fnz//xpcSTjFdyJk+g==}
|
||||
'@next/env@15.5.21':
|
||||
resolution: {integrity: sha512-hjJI/GfrjWHgNguRIBzItjRRu0m3Nrz17GhxsjuHfjIvg9hyg3239REd2dpI+bpMTFuVrVprHzEQ19m++cDtbw==}
|
||||
|
||||
'@next/eslint-plugin-next@15.5.18':
|
||||
resolution: {integrity: sha512-w4MYq8M26a8PNrfto0JosLf5/3ssln1rsyP96g2DkC8uFVymStM5DLSz5ElxxrPRg2XnTMnFo3kREFlhYvxhWw==}
|
||||
|
||||
'@next/swc-darwin-arm64@15.5.18':
|
||||
resolution: {integrity: sha512-w0WvQf1n+txiwns/9pwIQteCJpZTbxzO2SE0FLcwuD4v0WEh1JPOjdyxWL21XwJsdpx8cFRjyzxzCS/siP7HcQ==}
|
||||
'@next/swc-darwin-arm64@15.5.21':
|
||||
resolution: {integrity: sha512-ZfjqPEdi6TRC/fWx7UDbwb1fbVgyh2uD5tVTRKIDZDlYM+UNuE/LafDG2fwuAoZilADpABh46OY/F5qf9JjqLQ==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
'@next/swc-darwin-x64@15.5.18':
|
||||
resolution: {integrity: sha512-znn71QmDuxm+BOaglihMZfvyySMnNljkVIY5Z2TCssBmm+WqL6c19VhtH5ktFkHa8EZ2bnTUpcNcmNSQsg67og==}
|
||||
'@next/swc-darwin-x64@15.5.21':
|
||||
resolution: {integrity: sha512-TlCf1NpxgQLzTrexuev75xwmNCJMd1/qkJpTVP1GRRcih93hlIBn1P72hkh8T0gnRFr6BmWksQtbyG3jT6jnww==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
'@next/swc-linux-arm64-gnu@15.5.18':
|
||||
resolution: {integrity: sha512-yPPe5MNL+igZUa+OsqQJisqSfh6oarIuA1Q0BDxljGJhRQyZeP+WRHh7rs/jZUGMh5aY0YdIjXZG0VohkKkUdw==}
|
||||
'@next/swc-linux-arm64-gnu@15.5.21':
|
||||
resolution: {integrity: sha512-LXRsq1p+HvHSi7ygwNcSEEcK0zuo5jS75ZlqFHtOH+LF7qntXAJVJxah+1Pi/GyBm7EpkwU7m4EgbvIKrMqm9A==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@next/swc-linux-arm64-musl@15.5.18':
|
||||
resolution: {integrity: sha512-glaCczEWIrHsokFZ3pP08U4BpKxwIdnT+txdOM32OBgpL9Yw4aqx8NejmgtZQZOdstQ5f0L3CasIZudzCuD+nw==}
|
||||
'@next/swc-linux-arm64-musl@15.5.21':
|
||||
resolution: {integrity: sha512-hyGixhFxpDKjqoev6l4KlcRBlt9AXWrGhDZwmwg49sMJM5tnKQPSi+SEj9+e5n+l/bthRGZUdh59GKIs6lQPRw==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@next/swc-linux-x64-gnu@15.5.18':
|
||||
resolution: {integrity: sha512-oUfg2EgJmU3R0OCOWiokGFUTvZiPfXtriXiuF3YNxRoROCdgvTedHIzYoeKH34gsZxS/V7mHbfq2hpAHwhH1/A==}
|
||||
'@next/swc-linux-x64-gnu@15.5.21':
|
||||
resolution: {integrity: sha512-qfE+YfOba6S2+13e8qn1/UozDVNZ2clBlrs8UtDoax4s8ediu6sq93z66OEHUYlb69Tffh5JTNkgtsAKiSuugg==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@next/swc-linux-x64-musl@15.5.18':
|
||||
resolution: {integrity: sha512-JLxSP3KTd9iu/bvUMQxH7RJo9xKSHf55/6RPE4a6FTSZygGn7uvZbCej0AHXydwkggQGSD9UddSjwv6Xz5ESfA==}
|
||||
'@next/swc-linux-x64-musl@15.5.21':
|
||||
resolution: {integrity: sha512-BXLGG+EvIwp/Rrgl6HY8sqvD6BOUOIRz8/naDbeLNX7mlA5H2XRcL6MW/0IGnJISfj5BA9gNhFyJj5yOoiIDJQ==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@next/swc-win32-arm64-msvc@15.5.18':
|
||||
resolution: {integrity: sha512-ir1v7enP52K2HNz3tQQvwF+x7VNxBk1ciiZ18WBPvxf4C59IqdfmHPJYK3vH7rSxpuCVw/8C712wTXNAtEp+NA==}
|
||||
'@next/swc-win32-arm64-msvc@15.5.21':
|
||||
resolution: {integrity: sha512-tNGNOlT0Wn7E4IMsSnufjXN/l2L2/AGdLLpa2vzS89SYCBuihgLn3ngLsIrvndAnWo9nAkus+4gZHTI/Ijx9HA==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
'@next/swc-win32-x64-msvc@15.5.18':
|
||||
resolution: {integrity: sha512-LIu5me6QTANCd25E7I5uIEfvgQ06RK7tvHAbYo3zCb3VpxQEPvMcSpd87NwUABDT6MbGPdEGR5VRiK4PPTJhQg==}
|
||||
'@next/swc-win32-x64-msvc@15.5.21':
|
||||
resolution: {integrity: sha512-DmIdWmC9p4rdNIiQqo8ap0+Cnj6kKtTZnuSCxoYydSc8sgpDgAg9wFhxplunak9imLV0pTvc5WVCOHwm5eHLtQ==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
@@ -1467,7 +1472,7 @@ packages:
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
postcss: '>=8.5.10'
|
||||
postcss: '>=8.5.18 <9.0.0'
|
||||
|
||||
available-typed-arrays@1.0.7:
|
||||
resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==}
|
||||
@@ -1477,8 +1482,8 @@ packages:
|
||||
resolution: {integrity: sha512-s7iGf5GaVMxEG0ENN9x+xTr7GFZCb1ZP/1uATUpCEK2X78nDB3RwbtFCo9pGAf9ru+VwoQ464DkaLEeRM08wJA==}
|
||||
engines: {node: '>=4'}
|
||||
|
||||
axios@1.17.0:
|
||||
resolution: {integrity: sha512-J8SwNxprqqpbfenehxWYXE7CW+wM1BB4w3+N+g+/Wx40xM4rsLrfPmHHxSWIxJLYDgSY/HqlFPIYb2/S3rxafw==}
|
||||
axios@1.18.1:
|
||||
resolution: {integrity: sha512-3nTvFlvpn9Zu/RkHUqtc7/+al4UpRW5az71ap5zccp6e8RAYEzhMTecX8Dz1wWDYrPpUoB1HAQEGEAEvUr7S9g==}
|
||||
|
||||
axobject-query@4.1.0:
|
||||
resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==}
|
||||
@@ -1500,12 +1505,12 @@ packages:
|
||||
resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
brace-expansion@1.1.15:
|
||||
resolution: {integrity: sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==}
|
||||
brace-expansion@1.1.16:
|
||||
resolution: {integrity: sha512-IDw48K2/2kRkg9LdJxurvq3lV3aBgq0REY89duEqFRthjlPdXHKMj7EnQOXVckxzgisinf3nHfrcE2FufFLXMw==}
|
||||
|
||||
brace-expansion@5.0.6:
|
||||
resolution: {integrity: sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==}
|
||||
engines: {node: 18 || 20 || >=22}
|
||||
brace-expansion@5.0.8:
|
||||
resolution: {integrity: sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==}
|
||||
engines: {node: 20 || >=22}
|
||||
|
||||
braces@3.0.3:
|
||||
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
|
||||
@@ -2272,8 +2277,8 @@ packages:
|
||||
js-tokens@4.0.0:
|
||||
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
|
||||
|
||||
js-yaml@4.2.0:
|
||||
resolution: {integrity: sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==}
|
||||
js-yaml@4.3.0:
|
||||
resolution: {integrity: sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==}
|
||||
hasBin: true
|
||||
|
||||
json-buffer@3.0.1:
|
||||
@@ -2378,8 +2383,8 @@ packages:
|
||||
mz@2.7.0:
|
||||
resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==}
|
||||
|
||||
nanoid@3.3.12:
|
||||
resolution: {integrity: sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==}
|
||||
nanoid@3.3.16:
|
||||
resolution: {integrity: sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==}
|
||||
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
|
||||
hasBin: true
|
||||
|
||||
@@ -2397,8 +2402,8 @@ packages:
|
||||
react: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc
|
||||
react-dom: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc
|
||||
|
||||
next@15.5.18:
|
||||
resolution: {integrity: sha512-eKL8zUJkX9Y5lE+RX/2YJoItVdGlIscyVyboeD9wSpp0PaGqjoA4tTpT2qPqz9ax+5IzGESyLSeZ/RCwbSZ2uQ==}
|
||||
next@15.5.21:
|
||||
resolution: {integrity: sha512-/TsdBtkWLhkl+NVL3Uqws2UphNd6IPzOtzSk1fHaf+0P7GQKLZDUytyhns/Ykbzdy9+YRjwG7ONvrHaaTDdFqQ==}
|
||||
engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
@@ -2534,20 +2539,20 @@ packages:
|
||||
resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
peerDependencies:
|
||||
postcss: '>=8.5.10'
|
||||
postcss: '>=8.5.18 <9.0.0'
|
||||
|
||||
postcss-js@4.1.0:
|
||||
resolution: {integrity: sha512-oIAOTqgIo7q2EOwbhb8UalYePMvYoIeRY2YKntdpFQXNosSu3vLrniGgmH9OKs/qAkfoj5oB3le/7mINW1LCfw==}
|
||||
engines: {node: ^12 || ^14 || >= 16}
|
||||
peerDependencies:
|
||||
postcss: '>=8.5.10'
|
||||
postcss: '>=8.5.18 <9.0.0'
|
||||
|
||||
postcss-load-config@6.0.1:
|
||||
resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==}
|
||||
engines: {node: '>= 18'}
|
||||
peerDependencies:
|
||||
jiti: '>=1.21.0'
|
||||
postcss: '>=8.5.10'
|
||||
postcss: '>=8.5.18 <9.0.0'
|
||||
tsx: ^4.8.1
|
||||
yaml: ^2.4.2
|
||||
peerDependenciesMeta:
|
||||
@@ -2564,7 +2569,7 @@ packages:
|
||||
resolution: {integrity: sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==}
|
||||
engines: {node: '>=12.0'}
|
||||
peerDependencies:
|
||||
postcss: '>=8.5.10'
|
||||
postcss: '>=8.5.18 <9.0.0'
|
||||
|
||||
postcss-selector-parser@6.0.10:
|
||||
resolution: {integrity: sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==}
|
||||
@@ -2577,8 +2582,8 @@ packages:
|
||||
postcss-value-parser@4.2.0:
|
||||
resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
|
||||
|
||||
postcss@8.5.15:
|
||||
resolution: {integrity: sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==}
|
||||
postcss@8.5.23:
|
||||
resolution: {integrity: sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg==}
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
|
||||
prelude-ls@1.2.1:
|
||||
@@ -3144,7 +3149,7 @@ snapshots:
|
||||
globals: 13.24.0
|
||||
ignore: 5.3.2
|
||||
import-fresh: 3.3.1
|
||||
js-yaml: 4.2.0
|
||||
js-yaml: 4.3.0
|
||||
minimatch: 3.1.5
|
||||
strip-json-comments: 3.1.1
|
||||
transitivePeerDependencies:
|
||||
@@ -3303,34 +3308,34 @@ snapshots:
|
||||
'@tybys/wasm-util': 0.10.2
|
||||
optional: true
|
||||
|
||||
'@next/env@15.5.18': {}
|
||||
'@next/env@15.5.21': {}
|
||||
|
||||
'@next/eslint-plugin-next@15.5.18':
|
||||
dependencies:
|
||||
fast-glob: 3.3.1
|
||||
|
||||
'@next/swc-darwin-arm64@15.5.18':
|
||||
'@next/swc-darwin-arm64@15.5.21':
|
||||
optional: true
|
||||
|
||||
'@next/swc-darwin-x64@15.5.18':
|
||||
'@next/swc-darwin-x64@15.5.21':
|
||||
optional: true
|
||||
|
||||
'@next/swc-linux-arm64-gnu@15.5.18':
|
||||
'@next/swc-linux-arm64-gnu@15.5.21':
|
||||
optional: true
|
||||
|
||||
'@next/swc-linux-arm64-musl@15.5.18':
|
||||
'@next/swc-linux-arm64-musl@15.5.21':
|
||||
optional: true
|
||||
|
||||
'@next/swc-linux-x64-gnu@15.5.18':
|
||||
'@next/swc-linux-x64-gnu@15.5.21':
|
||||
optional: true
|
||||
|
||||
'@next/swc-linux-x64-musl@15.5.18':
|
||||
'@next/swc-linux-x64-musl@15.5.21':
|
||||
optional: true
|
||||
|
||||
'@next/swc-win32-arm64-msvc@15.5.18':
|
||||
'@next/swc-win32-arm64-msvc@15.5.21':
|
||||
optional: true
|
||||
|
||||
'@next/swc-win32-x64-msvc@15.5.18':
|
||||
'@next/swc-win32-x64-msvc@15.5.21':
|
||||
optional: true
|
||||
|
||||
'@nodelib/fs.scandir@2.1.5':
|
||||
@@ -4312,13 +4317,13 @@ snapshots:
|
||||
|
||||
asynckit@0.4.0: {}
|
||||
|
||||
autoprefixer@10.5.0(postcss@8.5.15):
|
||||
autoprefixer@10.5.0(postcss@8.5.23):
|
||||
dependencies:
|
||||
browserslist: 4.28.2
|
||||
caniuse-lite: 1.0.30001797
|
||||
fraction.js: 5.3.4
|
||||
picocolors: 1.1.1
|
||||
postcss: 8.5.15
|
||||
postcss: 8.5.23
|
||||
postcss-value-parser: 4.2.0
|
||||
|
||||
available-typed-arrays@1.0.7:
|
||||
@@ -4327,7 +4332,7 @@ snapshots:
|
||||
|
||||
axe-core@4.12.1: {}
|
||||
|
||||
axios@1.17.0:
|
||||
axios@1.18.1:
|
||||
dependencies:
|
||||
follow-redirects: 1.16.0
|
||||
form-data: 4.0.6
|
||||
@@ -4347,12 +4352,12 @@ snapshots:
|
||||
|
||||
binary-extensions@2.3.0: {}
|
||||
|
||||
brace-expansion@1.1.15:
|
||||
brace-expansion@1.1.16:
|
||||
dependencies:
|
||||
balanced-match: 1.0.2
|
||||
concat-map: 0.0.1
|
||||
|
||||
brace-expansion@5.0.6:
|
||||
brace-expansion@5.0.8:
|
||||
dependencies:
|
||||
balanced-match: 4.0.4
|
||||
|
||||
@@ -4855,7 +4860,7 @@ snapshots:
|
||||
imurmurhash: 0.1.4
|
||||
is-glob: 4.0.3
|
||||
is-path-inside: 3.0.3
|
||||
js-yaml: 4.2.0
|
||||
js-yaml: 4.3.0
|
||||
json-stable-stringify-without-jsonify: 1.0.1
|
||||
levn: 0.4.1
|
||||
lodash.merge: 4.6.2
|
||||
@@ -5268,7 +5273,7 @@ snapshots:
|
||||
|
||||
js-tokens@4.0.0: {}
|
||||
|
||||
js-yaml@4.2.0:
|
||||
js-yaml@4.3.0:
|
||||
dependencies:
|
||||
argparse: 2.0.1
|
||||
|
||||
@@ -5346,11 +5351,11 @@ snapshots:
|
||||
|
||||
minimatch@10.2.5:
|
||||
dependencies:
|
||||
brace-expansion: 5.0.6
|
||||
brace-expansion: 5.0.8
|
||||
|
||||
minimatch@3.1.5:
|
||||
dependencies:
|
||||
brace-expansion: 1.1.15
|
||||
brace-expansion: 1.1.16
|
||||
|
||||
minimist@1.2.8: {}
|
||||
|
||||
@@ -5368,7 +5373,7 @@ snapshots:
|
||||
object-assign: 4.1.1
|
||||
thenify-all: 1.6.0
|
||||
|
||||
nanoid@3.3.12: {}
|
||||
nanoid@3.3.16: {}
|
||||
|
||||
napi-postinstall@0.3.4: {}
|
||||
|
||||
@@ -5379,24 +5384,24 @@ snapshots:
|
||||
react: 19.2.7
|
||||
react-dom: 19.2.7(react@19.2.7)
|
||||
|
||||
next@15.5.18(react-dom@19.2.7(react@19.2.7))(react@19.2.7):
|
||||
next@15.5.21(react-dom@19.2.7(react@19.2.7))(react@19.2.7):
|
||||
dependencies:
|
||||
'@next/env': 15.5.18
|
||||
'@next/env': 15.5.21
|
||||
'@swc/helpers': 0.5.15
|
||||
caniuse-lite: 1.0.30001797
|
||||
postcss: 8.5.15
|
||||
postcss: 8.5.23
|
||||
react: 19.2.7
|
||||
react-dom: 19.2.7(react@19.2.7)
|
||||
styled-jsx: 5.1.6(react@19.2.7)
|
||||
optionalDependencies:
|
||||
'@next/swc-darwin-arm64': 15.5.18
|
||||
'@next/swc-darwin-x64': 15.5.18
|
||||
'@next/swc-linux-arm64-gnu': 15.5.18
|
||||
'@next/swc-linux-arm64-musl': 15.5.18
|
||||
'@next/swc-linux-x64-gnu': 15.5.18
|
||||
'@next/swc-linux-x64-musl': 15.5.18
|
||||
'@next/swc-win32-arm64-msvc': 15.5.18
|
||||
'@next/swc-win32-x64-msvc': 15.5.18
|
||||
'@next/swc-darwin-arm64': 15.5.21
|
||||
'@next/swc-darwin-x64': 15.5.21
|
||||
'@next/swc-linux-arm64-gnu': 15.5.21
|
||||
'@next/swc-linux-arm64-musl': 15.5.21
|
||||
'@next/swc-linux-x64-gnu': 15.5.21
|
||||
'@next/swc-linux-x64-musl': 15.5.21
|
||||
'@next/swc-win32-arm64-msvc': 15.5.21
|
||||
'@next/swc-win32-x64-msvc': 15.5.21
|
||||
sharp: 0.34.5
|
||||
transitivePeerDependencies:
|
||||
- '@babel/core'
|
||||
@@ -5517,28 +5522,28 @@ snapshots:
|
||||
|
||||
possible-typed-array-names@1.1.0: {}
|
||||
|
||||
postcss-import@15.1.0(postcss@8.5.15):
|
||||
postcss-import@15.1.0(postcss@8.5.23):
|
||||
dependencies:
|
||||
postcss: 8.5.15
|
||||
postcss: 8.5.23
|
||||
postcss-value-parser: 4.2.0
|
||||
read-cache: 1.0.0
|
||||
resolve: 1.22.12
|
||||
|
||||
postcss-js@4.1.0(postcss@8.5.15):
|
||||
postcss-js@4.1.0(postcss@8.5.23):
|
||||
dependencies:
|
||||
camelcase-css: 2.0.1
|
||||
postcss: 8.5.15
|
||||
postcss: 8.5.23
|
||||
|
||||
postcss-load-config@6.0.1(jiti@1.21.7)(postcss@8.5.15):
|
||||
postcss-load-config@6.0.1(jiti@1.21.7)(postcss@8.5.23):
|
||||
dependencies:
|
||||
lilconfig: 3.1.3
|
||||
optionalDependencies:
|
||||
jiti: 1.21.7
|
||||
postcss: 8.5.15
|
||||
postcss: 8.5.23
|
||||
|
||||
postcss-nested@6.2.0(postcss@8.5.15):
|
||||
postcss-nested@6.2.0(postcss@8.5.23):
|
||||
dependencies:
|
||||
postcss: 8.5.15
|
||||
postcss: 8.5.23
|
||||
postcss-selector-parser: 6.1.2
|
||||
|
||||
postcss-selector-parser@6.0.10:
|
||||
@@ -5553,9 +5558,9 @@ snapshots:
|
||||
|
||||
postcss-value-parser@4.2.0: {}
|
||||
|
||||
postcss@8.5.15:
|
||||
postcss@8.5.23:
|
||||
dependencies:
|
||||
nanoid: 3.3.12
|
||||
nanoid: 3.3.16
|
||||
picocolors: 1.1.1
|
||||
source-map-js: 1.2.1
|
||||
|
||||
@@ -5990,11 +5995,11 @@ snapshots:
|
||||
normalize-path: 3.0.0
|
||||
object-hash: 3.0.0
|
||||
picocolors: 1.1.1
|
||||
postcss: 8.5.15
|
||||
postcss-import: 15.1.0(postcss@8.5.15)
|
||||
postcss-js: 4.1.0(postcss@8.5.15)
|
||||
postcss-load-config: 6.0.1(jiti@1.21.7)(postcss@8.5.15)
|
||||
postcss-nested: 6.2.0(postcss@8.5.15)
|
||||
postcss: 8.5.23
|
||||
postcss-import: 15.1.0(postcss@8.5.23)
|
||||
postcss-js: 4.1.0(postcss@8.5.23)
|
||||
postcss-load-config: 6.0.1(jiti@1.21.7)(postcss@8.5.23)
|
||||
postcss-nested: 6.2.0(postcss@8.5.23)
|
||||
postcss-selector-parser: 6.1.2
|
||||
resolve: 1.22.12
|
||||
sucrase: 3.35.1
|
||||
|
||||
@@ -3,6 +3,11 @@ packages:
|
||||
|
||||
overrides:
|
||||
"form-data@<4.0.6": ">=4.0.6"
|
||||
"postcss@<8.5.10": ">=8.5.10"
|
||||
"prismjs@<1.30.0": ">=1.30.0"
|
||||
"uuid@<11.1.1": ">=11.1.1"
|
||||
"axios@<1.18.0": ">=1.18.0 <2.0.0"
|
||||
"brace-expansion@<1.1.16": ">=1.1.16 <2.0.0"
|
||||
"brace-expansion@>=3.0.0 <5.0.8": ">=5.0.8 <6.0.0"
|
||||
"js-yaml@<3.15.0": ">=3.15.0 <4.0.0"
|
||||
"js-yaml@>=4.0.0 <4.3.0": ">=4.3.0 <5.0.0"
|
||||
"postcss@<8.5.18": ">=8.5.18 <9.0.0"
|
||||
|
||||
+3
-2
@@ -19,7 +19,6 @@ from errors import (
|
||||
from fastapi import Depends, FastAPI, HTTPException, Query, Request
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.responses import JSONResponse, RedirectResponse
|
||||
from mem0.exceptions import ValidationError as Mem0ValidationError
|
||||
from models import RequestLog, User
|
||||
from pydantic import BaseModel, Field
|
||||
from rate_limit import limiter
|
||||
@@ -39,6 +38,8 @@ from slowapi import _rate_limit_exceeded_handler
|
||||
from slowapi.errors import RateLimitExceeded
|
||||
from sqlalchemy import func, select
|
||||
|
||||
from mem0.exceptions import ValidationError as Mem0ValidationError
|
||||
|
||||
load_dotenv()
|
||||
|
||||
install_request_id_logging()
|
||||
@@ -113,7 +114,7 @@ POSTGRES_COLLECTION_NAME = os.environ.get("POSTGRES_COLLECTION_NAME", "memories"
|
||||
|
||||
OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY")
|
||||
HISTORY_DB_PATH = os.environ.get("HISTORY_DB_PATH", "/app/history/history.db")
|
||||
DEFAULT_LLM_MODEL = os.environ.get("MEM0_DEFAULT_LLM_MODEL", "gpt-4.1-nano-2025-04-14")
|
||||
DEFAULT_LLM_MODEL = os.environ.get("MEM0_DEFAULT_LLM_MODEL", "gpt-5-mini")
|
||||
DEFAULT_EMBEDDER_MODEL = os.environ.get("MEM0_DEFAULT_EMBEDDER_MODEL", "text-embedding-3-small")
|
||||
|
||||
DEFAULT_CONFIG = {
|
||||
|
||||
@@ -91,7 +91,7 @@ def test_sync_delete_failure_does_not_trigger_decay_usage_notice(monkeypatch):
|
||||
def test_sync_delete_all_decay_usage_runs_after_success(monkeypatch):
|
||||
memory = make_sync_memory()
|
||||
memories = [SimpleNamespace(id="memory-1"), SimpleNamespace(id="memory-2")]
|
||||
memory.vector_store.list.return_value = (memories, None)
|
||||
memory.vector_store.list.side_effect = [(memories, None), ([], None)]
|
||||
decay_notice = MagicMock()
|
||||
first_run_notice = MagicMock()
|
||||
detect_decay = MagicMock(return_value=("delete_all", "bulk_delete", None, 2))
|
||||
@@ -117,6 +117,21 @@ def test_sync_delete_all_decay_usage_runs_after_success(monkeypatch):
|
||||
first_run_notice.assert_not_called()
|
||||
|
||||
|
||||
def test_sync_delete_all_stops_when_vector_store_repeats_batch(monkeypatch):
|
||||
memory = make_sync_memory()
|
||||
memories = [SimpleNamespace(id="memory-1"), SimpleNamespace(id="memory-2")]
|
||||
memory.vector_store.list.side_effect = [(memories, None), (memories, None)]
|
||||
monkeypatch.setattr(memory_main, "capture_event", MagicMock())
|
||||
monkeypatch.setattr(memory_main, "detect_decay_usage_from_delete_all", MagicMock(return_value=None))
|
||||
monkeypatch.setattr(memory_main, "display_first_run_notice", MagicMock())
|
||||
|
||||
result = Memory.delete_all(memory, user_id="u1")
|
||||
|
||||
assert result == {"message": "Memories deleted successfully!"}
|
||||
assert memory.vector_store.list.call_count == 2
|
||||
assert memory._delete_memory.call_count == 2
|
||||
|
||||
|
||||
def test_sync_delete_all_zero_deletes_uses_first_run_notice(monkeypatch):
|
||||
memory = make_sync_memory()
|
||||
memory.vector_store.list.return_value = ([], None)
|
||||
@@ -189,7 +204,7 @@ async def test_async_delete_failure_does_not_trigger_decay_usage_notice(monkeypa
|
||||
async def test_async_delete_all_decay_usage_runs_after_success(monkeypatch):
|
||||
memory = make_async_memory()
|
||||
memories = [SimpleNamespace(id="memory-1"), SimpleNamespace(id="memory-2")]
|
||||
memory.vector_store.list.return_value = (memories, None)
|
||||
memory.vector_store.list.side_effect = [(memories, None), ([], None)]
|
||||
decay_notice = AsyncMock()
|
||||
first_run_notice = AsyncMock()
|
||||
detect_decay = MagicMock(return_value=("delete_all", "bulk_delete", None, 2))
|
||||
@@ -213,3 +228,23 @@ async def test_async_delete_all_decay_usage_runs_after_success(monkeypatch):
|
||||
2,
|
||||
)
|
||||
first_run_notice.assert_not_awaited()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_async_delete_all_stops_when_vector_store_repeats_batch(monkeypatch):
|
||||
memory = make_async_memory()
|
||||
memories = [SimpleNamespace(id="memory-1"), SimpleNamespace(id="memory-2")]
|
||||
memory.vector_store.list.side_effect = [
|
||||
(memories, None),
|
||||
(memories, None),
|
||||
RuntimeError("delete_all should have stopped before a third list() call"),
|
||||
]
|
||||
monkeypatch.setattr(memory_main, "capture_event", MagicMock())
|
||||
monkeypatch.setattr(memory_main, "detect_decay_usage_from_delete_all", MagicMock(return_value=None))
|
||||
monkeypatch.setattr(memory_main, "display_first_run_notice_async", AsyncMock())
|
||||
|
||||
result = await AsyncMemory.delete_all(memory, user_id="u1")
|
||||
|
||||
assert result == {"message": "Memories deleted successfully!"}
|
||||
assert memory.vector_store.list.call_count == 2
|
||||
assert memory._delete_memory.await_count == 2
|
||||
|
||||
@@ -6,7 +6,7 @@ from mem0.reranker.llm_reranker import LLMReranker
|
||||
class TestLLMRerankerConfig:
|
||||
def test_default_config(self):
|
||||
config = LLMRerankerConfig()
|
||||
assert config.model == "gpt-4o-mini"
|
||||
assert config.model == "gpt-5-mini"
|
||||
assert config.provider == "openai"
|
||||
assert config.temperature == 0.0
|
||||
assert config.max_tokens == 100
|
||||
|
||||
+24
-3
@@ -280,19 +280,36 @@ def test_delete(memory_instance):
|
||||
|
||||
def test_delete_all(memory_instance):
|
||||
mock_memories = [Mock(id="1"), Mock(id="2")]
|
||||
memory_instance.vector_store.list = Mock(return_value=(mock_memories, None))
|
||||
memory_instance.vector_store.list = Mock(side_effect=[(mock_memories, None), ([], None)])
|
||||
memory_instance.vector_store.reset = Mock()
|
||||
memory_instance._delete_memory = Mock()
|
||||
|
||||
result = memory_instance.delete_all(user_id="test_user")
|
||||
|
||||
assert memory_instance._delete_memory.call_count == 2
|
||||
memory_instance.vector_store.list.assert_called_with(
|
||||
filters={"user_id": "test_user"}, top_k=1000
|
||||
)
|
||||
# Ensure the collection is NOT dropped — only matched memories should be removed
|
||||
memory_instance.vector_store.reset.assert_not_called()
|
||||
|
||||
assert result["message"] == "Memories deleted successfully!"
|
||||
|
||||
|
||||
def test_delete_all_paginates_beyond_vector_store_page_size(memory_instance):
|
||||
first_batch = [Mock(id=str(index)) for index in range(1000)]
|
||||
second_batch = [Mock(id="1000")]
|
||||
memory_instance.vector_store.list = Mock(
|
||||
side_effect=[(first_batch, None), (second_batch, None), ([], None)]
|
||||
)
|
||||
memory_instance._delete_memory = Mock()
|
||||
|
||||
memory_instance.delete_all(user_id="test_user")
|
||||
|
||||
assert memory_instance._delete_memory.call_count == 1001
|
||||
assert memory_instance.vector_store.list.call_count == 3
|
||||
|
||||
|
||||
def test_get_all(memory_instance):
|
||||
mock_memories = [Mock(id="1", payload={"data": "Memory 1", "user_id": "test_user"})]
|
||||
memory_instance.vector_store.list = Mock(return_value=(mock_memories, None))
|
||||
@@ -431,7 +448,9 @@ class TestEntityIdValidation:
|
||||
|
||||
memory_instance.delete_all(user_id=" alice ")
|
||||
|
||||
memory_instance.vector_store.list.assert_called_once_with(filters={"user_id": "alice"})
|
||||
memory_instance.vector_store.list.assert_called_once_with(
|
||||
filters={"user_id": "alice"}, top_k=1000
|
||||
)
|
||||
|
||||
def test_validate_coerces_non_string_entity_id(self):
|
||||
"""Integer (and other non-string) ids are coerced to str, not crashed on."""
|
||||
@@ -444,7 +463,9 @@ class TestEntityIdValidation:
|
||||
|
||||
memory_instance.delete_all(user_id=42)
|
||||
|
||||
memory_instance.vector_store.list.assert_called_once_with(filters={"user_id": "42"})
|
||||
memory_instance.vector_store.list.assert_called_once_with(
|
||||
filters={"user_id": "42"}, top_k=1000
|
||||
)
|
||||
|
||||
def test_get_all_coerces_integer_user_id(self, memory_instance):
|
||||
"""get_all should accept an integer user_id in filters and scope by its str form."""
|
||||
|
||||
@@ -983,7 +983,7 @@ async def test_async_delete_all_continues_on_partial_failure(mock_sqlite, mock_l
|
||||
mem3.id = "mem-3"
|
||||
mem3.payload = {"data": "three", "created_at": "2024-01-01T00:00:00+00:00", "actor_id": None, "role": None}
|
||||
|
||||
mock_vector_store.list.return_value = ([mem1, mem2, mem3],)
|
||||
mock_vector_store.list.side_effect = [([mem1, mem2, mem3],), ([],)]
|
||||
|
||||
def _get_side_effect(vector_id):
|
||||
if vector_id == "mem-2":
|
||||
@@ -999,6 +999,10 @@ async def test_async_delete_all_continues_on_partial_failure(mock_sqlite, mock_l
|
||||
|
||||
assert result == {"message": "Memories deleted successfully!"}
|
||||
assert mock_vector_store.delete.call_count == 2
|
||||
assert mock_vector_store.list.call_args_list[0].kwargs == {
|
||||
"filters": {"user_id": "test-user"},
|
||||
"top_k": 1000,
|
||||
}
|
||||
|
||||
|
||||
@patch('mem0.utils.factory.EmbedderFactory.create')
|
||||
@@ -1473,7 +1477,7 @@ class TestAsyncDeleteAllEntityRace:
|
||||
mem_b = MagicMock()
|
||||
mem_b.id = "mem-b"
|
||||
mem_b.payload = {"data": "Alice works at Acme", "user_id": "alice"}
|
||||
mock_vector_store.list.return_value = ([mem_a, mem_b],)
|
||||
mock_vector_store.list.side_effect = [([mem_a, mem_b],), ([],)]
|
||||
mock_vector_store.get.side_effect = lambda vector_id: {"mem-a": mem_a, "mem-b": mem_b}[vector_id]
|
||||
mock_vector_factory.return_value = mock_vector_store
|
||||
|
||||
|
||||
@@ -209,6 +209,8 @@ class TestElasticsearchDB(unittest.TestCase):
|
||||
self.assertEqual(body["knn"]["query_vector"], vectors)
|
||||
self.assertEqual(body["knn"]["k"], 5)
|
||||
self.assertEqual(body["knn"]["num_candidates"], 10)
|
||||
# `size` must be set or ES caps the response at its default of 10 hits.
|
||||
self.assertEqual(body["size"], 5)
|
||||
|
||||
# Verify results
|
||||
self.assertEqual(len(results), 1)
|
||||
@@ -216,6 +218,43 @@ class TestElasticsearchDB(unittest.TestCase):
|
||||
self.assertEqual(results[0].score, 0.8)
|
||||
self.assertEqual(results[0].payload, {"key1": "value1"})
|
||||
|
||||
def test_search_sets_size_to_top_k(self):
|
||||
"""Regression for #5909: KNN search must set `size=top_k` or Elasticsearch caps
|
||||
the response at its default of 10 hits regardless of `knn.k`.
|
||||
|
||||
Memory._search_vector_store over-fetches a scoring pool of `max(limit * 4, 60)`
|
||||
candidates for hybrid re-ranking, so even a default search(top_k=20) reaches this
|
||||
layer with top_k=80. Without `size`, that pool is silently truncated to 10.
|
||||
"""
|
||||
self.client_mock.search.return_value = {"hits": {"hits": []}}
|
||||
|
||||
# internal_limit in Memory._search_vector_store for a default search(top_k=20)
|
||||
over_fetch = max(20 * 4, 60)
|
||||
self.es_db.search(query="", vectors=[[0.1] * 1536], top_k=over_fetch)
|
||||
|
||||
body = self.client_mock.search.call_args[1]["body"]
|
||||
self.assertEqual(body["size"], over_fetch)
|
||||
self.assertEqual(body["knn"]["k"], over_fetch)
|
||||
self.assertGreater(body["size"], 10)
|
||||
|
||||
def test_search_with_filters_keeps_size(self):
|
||||
"""Filters must not displace the response size set for KNN search."""
|
||||
self.client_mock.search.return_value = {"hits": {"hits": []}}
|
||||
|
||||
self.es_db.search(
|
||||
query="",
|
||||
vectors=[[0.1] * 1536],
|
||||
top_k=25,
|
||||
filters={"user_id": "u1"},
|
||||
)
|
||||
|
||||
body = self.client_mock.search.call_args[1]["body"]
|
||||
self.assertEqual(body["size"], 25)
|
||||
self.assertEqual(
|
||||
body["knn"]["filter"],
|
||||
{"bool": {"must": [{"term": {"metadata.user_id": "u1"}}]}},
|
||||
)
|
||||
|
||||
def test_custom_search_query(self):
|
||||
# Mock custom search query
|
||||
self.es_db.custom_search_query = Mock()
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
from unittest.mock import Mock, patch
|
||||
import logging
|
||||
from unittest.mock import MagicMock, Mock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from mem0.configs.vector_stores.supabase import IndexMeasure, IndexMethod
|
||||
from mem0.vector_stores.supabase import Supabase
|
||||
from mem0.vector_stores.supabase import VECS_MAX_QUERY_LIMIT, Supabase
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -14,13 +15,12 @@ def mock_vecs_client():
|
||||
|
||||
@pytest.fixture
|
||||
def mock_collection():
|
||||
collection = Mock()
|
||||
collection = MagicMock()
|
||||
collection.name = "test_collection"
|
||||
collection.vectors = 100
|
||||
collection.dimension = 1536
|
||||
collection.index_method = "hnsw"
|
||||
collection.distance_metric = "cosine_distance"
|
||||
collection.describe.return_value = collection
|
||||
collection.index = "ix_vector_cosine_ops_hnsw_m16_efc64_abc1234"
|
||||
collection.is_indexed_for_measure.return_value = True
|
||||
collection.__len__.return_value = 100
|
||||
return collection
|
||||
|
||||
|
||||
@@ -141,10 +141,57 @@ def test_col_info(supabase_instance, mock_collection):
|
||||
"name": "test_collection",
|
||||
"count": 100,
|
||||
"dimension": 1536,
|
||||
"index": {"method": "hnsw", "metric": "cosine_distance"},
|
||||
"index": {
|
||||
"name": "ix_vector_cosine_ops_hnsw_m16_efc64_abc1234",
|
||||
"measure": "cosine_distance",
|
||||
"is_indexed": True,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def test_search_clamps_top_k_to_vecs_limit(supabase_instance, mock_collection, caplog):
|
||||
mock_collection.query.return_value = []
|
||||
|
||||
with caplog.at_level(logging.WARNING, logger="mem0.vector_stores.supabase"):
|
||||
supabase_instance.search(query="", vectors=[[0.1, 0.2, 0.3]], top_k=5000)
|
||||
|
||||
mock_collection.query.assert_called_once_with(
|
||||
data=[[0.1, 0.2, 0.3]], limit=VECS_MAX_QUERY_LIMIT, filters=None, include_metadata=True, include_value=True
|
||||
)
|
||||
assert "5000" in caplog.text
|
||||
assert str(VECS_MAX_QUERY_LIMIT) in caplog.text
|
||||
|
||||
|
||||
def test_search_does_not_clamp_top_k_within_limit(supabase_instance, mock_collection):
|
||||
mock_collection.query.return_value = []
|
||||
|
||||
supabase_instance.search(query="", vectors=[[0.1, 0.2, 0.3]], top_k=5)
|
||||
|
||||
mock_collection.query.assert_called_once_with(
|
||||
data=[[0.1, 0.2, 0.3]], limit=5, filters=None, include_metadata=True, include_value=True
|
||||
)
|
||||
|
||||
|
||||
def test_list_clamps_top_k_to_vecs_limit(supabase_instance, mock_collection, caplog):
|
||||
mock_collection.query.return_value = []
|
||||
mock_collection.fetch.return_value = []
|
||||
|
||||
with caplog.at_level(logging.WARNING, logger="mem0.vector_stores.supabase"):
|
||||
supabase_instance.list(top_k=5000)
|
||||
|
||||
_, kwargs = mock_collection.query.call_args
|
||||
assert kwargs["limit"] == VECS_MAX_QUERY_LIMIT
|
||||
assert "5000" in caplog.text
|
||||
assert str(VECS_MAX_QUERY_LIMIT) in caplog.text
|
||||
|
||||
|
||||
def test_col_info_does_not_raise(supabase_instance):
|
||||
info = supabase_instance.col_info()
|
||||
|
||||
assert isinstance(info, dict)
|
||||
assert info["name"] == "test_collection"
|
||||
|
||||
|
||||
def test_preprocess_filters(supabase_instance):
|
||||
# Test single filter
|
||||
single_filter = {"category": "test"}
|
||||
|
||||
Reference in New Issue
Block a user