Back to browse
GitHub Repository
21 starsPython

Breathe-Memory – Associative memory injection for LLMs (not RAG)

by mvyshnyvetska·Mar 26, 2026·6 points·1 comment

AI Analysis

●●SolidBig BrainNiche Gem

Graph-based context compression beats lossy summarization when tokens run out.

Strengths
  • SYNAPSE extracts anchors in 2ms via regex before traversing concept graph with BFS
  • GraphCompactor preserves semantic structure (topics, decisions, artifacts) not narrative
  • Interface-based design swaps any database, LLM, or vector store without code changes
Weaknesses
  • LLM memory management is crowded (Mem0, LangChain, Zep) with no clear adoption path
  • Reference implementation needs PostgreSQL + pgvector, adds operational complexity
Category
Target Audience

LLM application developers building long-running agents or chat systems

Similar To

Mem0 · LangChain Memory · Zep

Post Description

LLMs forget. The standard fix is RAG — retrieve chunks, stuff them in. It works until it doesn't: irrelevant chunks waste tokens, summaries lose structure, and nothing actually models how memory works.

Breathe-memory takes a different approach: associative injection. Before each LLM call, it extracts anchors from the user's message (entities, temporal references, emotional signals), traverses a concept graph via BFS, runs optional vector search, and injects only what's relevant — typically in <60ms.

When context fills up, instead of summarizing, it extracts a structured graph: topics, decisions, open questions, artifacts. This preserves the semantic structure that summaries destroy.

The whole thing is ~1500 lines of Python, interface-based, zero mandatory deps. Plug in any database, any LLM, any vector store. Reference implementation uses PostgreSQL + pgvector.

https://github.com/tkenaz/breathe-memory

We've been running this in production for several months. Open-sourcing because we think the approach (injection over retrieval) is underexplored and worth more attention.

We've also posted an article about memory injections in a more human-readable form, if you want to see the thinking under the hood: https://medium.com/towards-artificial-intelligence/beyond-ra...

Similar Projects

AI/ML●●●Banger

Sleeping LLM – A language model that remembers by sleeping

Direct weight editing for persistent memory—MEMIT meets LoRA consolidation with null-space math.

WizardryBig BrainZero to One
vbaranov87
203mo ago