Перейти к содержимому

Give CrewAI Real Memory with Mem0 (Local, Measured, Head-to-Head)

EKB Dev AI

0:00 / 0:00

Give CrewAI Real Memory with Mem0 (Local, Measured, Head-to-Head)

96 просмотров · 2 месяца назад
EKB Dev AI
35 подписчиков
96 просмотров · 2 месяца назад
Part 2 of the local agent-memory series. Last time we gave a DSPy pipeline real memory with Mem0 — this time it's CrewAI. I run two CrewAI crews over the exact same course-building tasks: one backed by a shared Mem0 brain, one starting cold every time. Then I measure the gap live — tokens, latency, projected cost, and whether the crew actually REMEMBERED a decision it made 15 tasks earlier. No hand-waving: every token count comes from CrewAI's own get_token_usage_summary(), the deep path is exactly 2 LLM calls, the fast path is exactly 1, and it all runs locally on Ollama. As the shared brain fills up, the memory crew flips to the fast path and its cost/token/latency lines fan apart from the cold crew on a live Streamlit dashboard. I also wire up an "amnesia switch" that wipes the brain mid-race so you can watch the savings collapse and then re-learn. 🔗 Code (open source, MIT): https://github.com/ekb-dev-ai/dspy-cr... ── What's inside ── • CrewAI on a shared Mem0 / Chroma brain (the same store the DSPy demo used) • Fast path vs deep path routing based on memory hits (1 call vs 2) • Why I call LLM.call directly instead of the multi-agent Crew executor • Measured, not estimated — real token usage per step • The "it remembered" recall probe scored with embedding similarity • A live dashboard: animated odometers, memory-vs-cold race charts, a pulsing brain graph • The amnesia switch — wipe memory mid-run and watch cost snap back ── Stack ── CrewAI · Mem0 · Chroma · Ollama (llama3.1:8b + nomic-embed-text) · DSPy · Streamlit · LiteLLM ── Run it yourself ── git clone git@github.com:ekb-dev-ai/dspy-crewai-mem0.git cd dspy-crewai-mem0 poetry install Terminal 1 poetry run demo-reset poetry run demo-dashboard Terminal 2 poetry run demo-crew-race --rounds 2 --pause-seconds 1 ── Watch Part 1 (DSPy + Mem0) ──    • Give Your AI Agent Real Memory (DSPy + Mem...   If this helped, subscribe for more local, measurable AI-agent builds. Drop a comment with what you'd measure next. #CrewAI #Mem0 #AIagents #Ollama #LocalLLM Chapters 00:00 Recap: Part 1 (DSPy + Mem0) & what's different 00:44 Code walkthrough 11:13 live dashboard demo 14:04 conclusion