feat(providers): add Basic Memory provider - #47
Conversation
Add a provider that drives a local Basic Memory install (the `bm` CLI's `bm tool ... --local` JSON interface) so Basic Memory can be benchmarked alongside Supermemory, Mem0, Zep, filesystem, and rag. - Maps each containerTag to a dedicated, throwaway BM project, isolated via BASIC_MEMORY_CONFIG_DIR/BASIC_MEMORY_HOME so it never touches the user's real config or projects. - ingest: writes each session as a Markdown note via `bm tool write-note`. - awaitIndexing: polls `bm status` until file/db sync settles, then runs `bm reindex --embeddings` (vector embeddings lag the FTS index and are required for semantic recall). - search: `bm tool search-notes --hybrid` (full-text + semantic). - clear: removes the BM project and its on-disk data. - Resolves the CLI to an absolute path (Bun's spawn does no PATH lookup); overridable via BASIC_MEMORY_CLI. Registers the provider, adds custom answer prompt, documents setup in the providers README, and adds unit tests for the pure helpers. Verified with a local smoke test (ingest -> reindex -> hybrid search -> clear) against a throwaway project. Co-Authored-By: Claude <noreply@anthropic.com>
|
Checked this against current Basic Memory main ( One compatibility fix is needed in Please also propagate a failed embeddings rebuild rather than logging it and reporting every document completed. Similarly, returning I have verified CLI creation/write/status compatibility only; I have not run a scored benchmark or validated hybrid quality. Keeping basicmachines-co/basic-memory#672 open until the provider lands and an end-to-end smoke run verifies ingest, indexing, search and cleanup. |
Summary
Adds a Basic Memory provider to memorybench (GitHub) — an open-source, local-first knowledge graph that stores information as Markdown files and exposes full-text + semantic (vector) search via a CLI and MCP server.
This PR implements the
MemoryProviderinterface for Basic Memory, closing basicmachines-co/basic-memory#672.What changed
src/providers/basic-memory.ts— new provider that drives the localbmCLI vianode:child_process.spawn(matching the pattern used by thefilesystemandragproviders).containerTagmaps to a throwaway BM project rooted underdata/providers/basic-memory/(gitignored). The provider redirectsBASIC_MEMORY_CONFIG_DIR/BASIC_MEMORY_HOMEso it never touches the user's real config or projects.bm tool write-note.bm statusuntil sync settles, then runsbm reindex --full --embeddingsto ensure vector embeddings are up to date (lazy indexing otherwise causes semantic search misses).bm tool search-notes --hybrid(FTS + semantic). BM's default FTS uses implicit-AND which fails on natural-language questions; hybrid mode correctly handles them.providers/index.ts,types/provider.ts(ProviderName),utils/config.ts(no API key required).src/providers/README.mdupdated with a Basic Memory Setup section.Setup (for reviewers)
The CLI path is auto-resolved at init; override with
BASIC_MEMORY_CLIenv var orconfig.baseUrl.🤖 Generated with Claude Code