Repository navigation
feat!: memory core rewrite for multi-agent teams (v0.1.0) - #1
Merged
Merged
Conversation
…marks Correctness - Natural-language queries no longer break FTS5 (every term is quoted); "What did we decide about auth?" used to throw a syntax error. - min_score is applied; scores are normalized 0-1. - Expired memories are hidden immediately, purged within a minute. - write_context updates in place via id (ON CONFLICT upsert, no orphan FTS rows), reports likely duplicates, supports expected_version CAS. - set_state/get_state are versioned with compare-and-set. - Credentials are refused on write. Multi-agent safety - Single MemoryStore class (no global state) used by server, tests and benchmarks. WAL + busy_timeout + BEGIN IMMEDIATE. - In-memory vector index synced across processes via PRAGMA data_version; stale vectors can never overwrite newer content (content-hash guard). - Schema versioning with automatic migration from 0.0.x stores. Retrieval - Default model: multilingual snowflake-arctic-embed-m-v2.0 (PT-BR/EN), cached in ~/.cache/agent-memory-store instead of node_modules. - Convex score fusion (0.7 semantic), chosen on a held-out split. Validation - 37 tests: unit, end-to-end over MCP stdio, 4-process concurrency, metric formulas, plus an opt-in real-model end-to-end test. CI added. - npm run bench: bilingual golden set (150 memories, 120 queries) + latency/RAM, ~30 s, < 1 GB. LongMemEval uses the official protocol. - Removes the previous 92.1% claim, which came from a copy of the search code and a non-standard metric. BREAKING CHANGE: requires Node >= 22.13; default embedding model changed (vectors are recomputed automatically on first start). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Node 22.13-22.15 bundle SQLite without FTS5, so the store failed to open (caught by CI). Bump engines/CI/docs to 22.16 and fail fast with a clear message on older builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 task done
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.
Summary
Critical review and rewrite of agent-memory-store so a team of agents can rely on it: correct, safe for many processes, multilingual (PT-BR/EN), and measured with reproducible benchmarks.
Bugs fixed (all reproduced, now covered by tests)
search_contextthrew FTS5 syntax errors on almost any natural-language query (?,',.,-,/,,, AND/OR/NOT).min_scorewas accepted but ignored; displayed RRF scores were meaningless.INSERT OR REPLACEleft orphan FTS rows.busy_timeout→SQLITE_BUSYwith several agents on onestore.db.node_modules(re-downloaded on everynpxupdate).What's new
MemoryStorecore shared by the server, tests and benchmarks (no copied search logic).write_contextwithid), duplicate warnings,expected_versioncompare-and-set on memories and state.BEGIN IMMEDIATE, cross-process vector index sync viaPRAGMA data_version, content-hash guard against stale embeddings, lease for background re-embedding.snowflake-arctic-embed-m-v2.0) and convex score fusion chosen on held-out queries.Validation
npm test: 37 tests — unit, end-to-end over MCP stdio, 4 processes × 500 writes with a contended CAS counter, metric formulas checked against hand-computed values.AMS_MODEL_TESTS=1adds a real-model end-to-end test (PT memory found by an EN question).npm run bench(~30 s, < 1 GB RAM), Apple M2 8 GB:Breaking changes
Test plan
npm test(37 pass, 1 opt-in skipped)AMS_MODEL_TESTS=1 node --test test/e2e-model.test.jsnpm run benchtwice — identical quality, stable latency🤖 Generated with Claude Code