Symptom: TS OSS `memory.search()` returns entity rows (fragment text
like "a fan of", "recommending thriller movies and") mixed in with
real memories. The broken rows have `hash: undefined` and
`createdAt: undefined` because they came from the entity store, not
the memory pipeline.
Root cause: `MemoryVectorStore` uses a single `vectors` SQLite table
and ignores `collectionName` internally. The entity store is created
as a parallel instance with `collectionName: "${name}_entities"` in
`memory/index.ts:193`, but both default to the same `dbPath`
(`~/.mem0/vector_store.db`) when the caller doesn't set one. Both
writers append to the same `vectors` table, so a search that reads
that table returns rows from both collections.
The existing mitigation at `memory/index.ts:199` (dbPath.replace) only
fires when `dbPath` is set explicitly. The default (unset) case fell
through with no isolation.
Fix: `getDefaultVectorStoreDbPath(collectionName?)` now derives the
default filename from the collection name
(`vector_store_${name}.db`). `MemoryVectorStore` passes
`config.collectionName` into the helper. Memory vs entity stores now
land in separate files automatically, even when the caller doesn't set
`dbPath`. Explicit `dbPath` users are unaffected — the existing
suffix-swap in `memory/index.ts` still handles them.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The word 'anything' triggers a server-side 500 in the v3 search
endpoint's BM25/lemmatization pipeline.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Take team's upstream changes for search return type
(Promise<{results: Array<Memory>}>) and test assertions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- crud.test.ts: add() returns {event_id, status} not an array
- search.test.ts: use snake_case user_id in filters for v3 compatibility
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The v3 API returns {results: [...]} and the client should pass that
through without unwrapping. Updated return type to Promise<{results: Array<Memory>}>,
removed the unwrap logic, and fixed integration tests to access .results.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Someone else's changes unwrap the v3 envelope in the client,
so the return type should stay as Array<Memory> for consistency.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change TS client search() return type from Promise<Array<Memory>>
to Promise<{ results: Array<Memory> }> to match v3 API envelope.
Update unit test mocks to return {results: []} and fix assertions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
search() now unwraps { results: [...] } -> [...] internally (same
pattern getAll() already uses), so callers always get Array<Memory>.
Removes redundant unwrap logic from integration test helpers and
search.test.ts that caused TS2339 'Property results does not exist
on type never' — the false branch of Array.isArray() was unreachable
since search() is typed as returning Array<Memory>.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v3 search returns {results: [...]} instead of a bare array.
Updated waitForSearchResults helper and search edge case tests
to unwrap the v3 envelope.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Restore LMStudioEmbedder, LMStudioLLM, DeepSeekLLM in TS factory.ts
(accidentally removed during graph store cleanup — unrelated to graphs)
- Add langchain>=0.1.0 to Python extras dep group (was transitively
provided by langchain-neo4j in the removed graph group, still needed
by mem0/llms/langchain.py and mem0/embeddings/langchain.py)
- Add pytest.importorskip("langchain") to test_langchain.py for graceful
skip when langchain isn't installed
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update mock URLs in memoryClient.crud.test.ts and
memoryClient.search.test.ts to match v3 endpoints:
- add: /v1/memories/ -> /v3/memories/
- search: /v2/memories/search/ -> /v3/memories/search/
- deleteAll: stays on /v1/memories/ (no v3 equivalent)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>