feat: adding oss version of companion cookbook#4564
Merged
whysosaket merged 5 commits intomainfrom Mar 28, 2026
Merged
Conversation
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
…ding-ai-companion guide
…a wording, and note formatting
utkarsh240799
previously approved these changes
Mar 27, 2026
whysosaket
reviewed
Mar 28, 2026
| Tell Mem0 what matters: | ||
|
|
||
| ```python | ||
| MEMORY_CONFIG["custom_fact_extraction_prompt"] = """ |
Member
There was a problem hiding this comment.
Please verify from code if this is the right key name. (Just want to double check)
whysosaket
reviewed
Mar 28, 2026
whysosaket
reviewed
Mar 28, 2026
| <Tab title="Open Source"> | ||
| ```python | ||
| memory.add( | ||
| "Max wants direct, data-driven feedback. Skip motivational language.", |
Member
There was a problem hiding this comment.
Let's not encourage use to unstructured add, it should be kv pair as in other places.
whysosaket
reviewed
Mar 28, 2026
| speed_sessions = memory.search( | ||
| "speed work", | ||
| user_id="max", | ||
| filters={"workout_type": "speed"}, |
Member
There was a problem hiding this comment.
can we confirm if filters like this work on oss?
…mpt and clarify config usage
whysosaket
approved these changes
Mar 28, 2026
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.
Description
Audited and tested the Open Source tab of the "Build a Companion with Mem0" cookbook (
docs/cookbooks/essentials/building-ai-companion.mdx) to verify all code snippets work end-to-end with theexact stack described: Ollama (LLM + embeddings) + Qdrant server (Docker).
Tested 9 cookbook patterns — all API calls, config, and filter syntax are correct and functional:
metadatabuckets withmemory_bucket)custom_fact_extraction_prompt)infer=False)expires_onin metadata)run_idmemory.update)delete_allwithrun_id)One issue found:
custom_fact_extraction_promptdoesn't work reliably withllama3.1:8b— the model can't follow the structured JSON extraction prompt, causing it to drop all factsincluding valid ones. The default extraction (without the custom prompt) already filters filler correctly.
Type of Change
Breaking Changes
N/A
Test Coverage
Ran
test_companion.pyagainst the exact cookbook stack (Ollama llama3.1 + nomic-embed-text + Qdrant server on Docker). 17/17 automated checks passed.Checklist