Repository navigation
fix(memory): filtered search actually filters; migrate AgentDBClient to agentdb 3.7.2 (2.3.0) - #18
Merged
Merged
Conversation
…entdb 3.7.2
AgentDBClient.search({ filter }) handed the filter to a backend that never
read it, so filtered searches returned unfiltered results (a filter matching
nothing returned everything). The RaBitQ path ignored it as well.
- agentdb ^1.6.1 -> ^3.7.2, now an optional dependency loaded lazily with a
native import() (agentdb 3.x is ESM-only; tsc's CJS output would turn
import() into require()).
- With agentdb loaded, vectors live in an agentdb RVF store
(agentdb/backends createBackend('rvf')): async search, native name-based
filters ({ op, field, value }), isolated in-memory stores, closeAsync() on
cleanup, durable single-file store when an explicit storage.path is given.
- Fallback in-memory store applies the same filter semantics before top-k.
- Filters are normalised by toFilterExpr; unsupported shapes throw.
- EmbeddingService uses the 3.x config and is loaded on first embed();
agentdb's mock-embedding fallback counts as unavailable.
- Deterministic backend errors are not retried.
Tests: real-import child-process suite against agentdb 3.7.2 (filtered
search, isolation, persistence across reopen), fallback filter suite, and a
regression test for the ignored filter. Release 2.3.0.
Co-Authored-By: claude-flow <ruv@ruv.net>
… is absent (Node 18) npm skips optional agentdb 3.x on Node 18 (engines >=20.9), and jest.mock of a missing module fails to resolve. Co-Authored-By: claude-flow <ruv@ruv.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
AgentDBClient.search(q, { filter })passed the filter to a backend that never read it (src/memory/agentdb/client.ts:270→ the in-memory Map store at:172). Filtered searches came back unfiltered. Checked against the old client:filter: { kind: 'x' }returned all 4 items, and a filter matching nothing also returned 4. The RaBitQ path dropped the filter too.Change
^1.6.1→^3.7.2, moved tooptionalDependenciesand loaded lazily with a nativeimport(). agentdb 3.x is ESM-only, and tsc's CommonJS output would turnimport()intorequire().agentdb/backendscreateBackend('rvf')):searchAsync{ op, field, value }(the shape FilterBuilder emits)cleanup()callscloseAsync(), which releases the lock and removes the temp dirvectorDimensionmaps todimension.rvffile when an explicitstorage.pathis given. The default config never writes to disk.toFilterExprnormalises the predicate DSL ($eq $ne $lt $le $gt $ge $in $range) and raw expressions. Unsupported shapes throw instead of quietly widening the search. FilterBuilder silently skips them.EmbeddingServicenow uses the 3.x config shape. The old{ dimensions }config throws on 3.x. It loads on the firstembed(), and agentdb's silent mock-embedding fallback counts as unavailable.storage.backend(auto | agentdb | memory),backendKind,isPersistent, and exported filter helpers.Tests (193 pass, previously 180)
tests/memory/agentdb-real.spec.tsruns a child process (ts-node) against real agentdb 3.7.2, because jest's vm can'timport()ESM. It checks:>=20.9.0.tests/memory/agentdb-filter.spec.tscovers the fallback path, a regression test for the ignored filter, the RaBitQ path, and rejection of unsupported filters.npm audit --omit=devagentdb,@xenova/transformers,sharpand@modelcontextprotocol/sdkhighs from the agentdb 1.x chain, plus stale transitive lock entries (hono, express, body-parser, proxy-addr, fast-uri, ip-address).tar/gl/node-gypcome viajs-pytorch;zodis a direct^3dependency and fixing it needs zod 4.Notes
isNativenow means "agentdb vector backend active".includeVectorsare tracked in process, so they are not restored after a reopen. This is documented in the README and CHANGELOG.🤖 Generated with claude-flow