FlowElement-xinliuyuansu/m_flow
A bio-inspired cognitive memory engine — a new paradigm for Graph RAG.
M-flow
Summary
M-flow is a memory system for AI agents that retrieves information by scoring evidence paths in a knowledge graph, operating like a cognitive memory system rather than relying solely on similarity search.
How It Works
M-flow organizes knowledge into a four-level cone graph: Episode (broad context), Facet (topic within episode), FacetPoint (atomic fact), and Entity (named things). During retrieval, vector search finds entry points matching the query's granularity, then the graph propagates evidence along semantically weighted edges to score each knowledge unit by the strongest chain of reasoning connecting it to the query. Each hop adds cost, so only coherent, low‑cost paths remain competitive. The system also resolves pronouns to concrete entities during ingestion and can optionally partition memory by recognized faces for multi‑person isolation.
Key Features
- Episodic and procedural memory for hierarchical recall
- Five retrieval modes: Episodic (primary), Procedural, Triplet Completion, Lexical, Cypher
- Support for 50+ file formats (PDF, DOCX, HTML, Markdown, images, audio, etc.)
- Multi‑database support: LanceDB, Neo4j, PostgreSQL/pgvector, ChromaDB, KùzuDB, Pinecone
- LLM‑agnostic: works with OpenAI, Anthropic, Mistral, Groq, Ollama, LLaMA‑Index, LangChain
- Precise summarization that preserves factual details (dates, numbers, names)
- MCP server to expose memory as Model Context Protocol tools
- CLI and web UI for interaction
Limitations
None specified in the README.
Best For
AI agents requiring persistent, long‑context memory with accurate, reasoning‑based retrieval, as demonstrated in benchmarks like LoCoMo‑10 and LongMemEval.