feat(providers): add Basic Memory provider#47
Open
groksrc wants to merge 1 commit into
Open
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>
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
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