feat: local OpenAI-compatible backend for mem0-local (zero API spend)#19
Merged
Conversation
mem0-local previously hard-required OPENAI_API_KEY, putting paid API calls inside the benchmark loop. It now picks a backend in priority order: 1. MEM0_OPENAI_COMPAT_BASE_URL (e.g. Ollama at localhost:11434/v1) — LLM and embeddings both route there via mem0's openai provider; the qdrant store is created per-run with matching dimensions (default nomic-embed-text, 768) under MEM0_QDRANT_PATH. Collection names are run-scoped because qdrant rejects dim changes within a collection. 2. OPENAI_API_KEY — mem0's stock defaults, unchanged. 3. Neither — ProviderSkippedError, as before. MEM0_INFER=true switches ingest from raw add to mem0's LLM fact-extraction (its recommended/headline mode); default false matches the existing June 10 baseline semantics. Backend, models, and infer mode are recorded in version_info so every run manifest shows exactly how mem0 was configured — fairness reviewers can see it wasn't hobbled or boosted. Smoke-verified against live Ollama (qwen2.5:3b + nomic-embed-text): both infer modes ingest, search ranks the correct doc first, cleanup works, zero external API calls. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Drew Cain <groksrc@gmail.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
Removes the hard
OPENAI_API_KEYrequirement frommem0-local. Backend priority:MEM0_OPENAI_COMPAT_BASE_URL(e.g. Ollama athttp://localhost:11434/v1) — LLM + embeddings via mem0'sopenaiprovider against the local endpoint; per-run qdrant collections with matching dims (defaultnomic-embed-text/768) underMEM0_QDRANT_PATH.OPENAI_API_KEY— mem0 stock defaults, behavior unchanged.MEM0_INFER=trueenables mem0's LLM fact-extraction at ingest (their recommended mode); defaultfalsepreserves the June 10 baseline semantics. Backend, models, and infer mode land inversion_info→ run manifest, so every run records exactly how mem0 was configured.Why
Zero-API-spend benchmark runs (program decision), and fairness transparency: when we publish comparisons, reviewers can verify mem0's configuration from the manifest rather than trusting prose.
Verification
🤖 Generated with Claude Code