Skip to content

M Flow

A bio-inspired cognitive memory engine — a new paradigm for Graph RAG.

Install

$pip install mflow-ai

Install command taken from the project's README or registry entry. Always review code before running it.

M-flow

RAG matches chunks. GraphRAG structures context. M-flow scores evidence paths.

Retrieval through reasoning and association — M-flow operates like a cognitive memory system.

m-flow.ai · flowelement.ai · Quick Start · Architecture · Examples · OpenClaw Skill · Contact


What is M-flow?

The real shift is not whether a system builds a graph, but what the graph is allowed to do at retrieval time.

Graph topology encodes relevance.

In most RAG systems, retrieval is still dominated by similarity: the query is embedded, textual units are ranked by vector distance, and structure—if present—mainly helps organize, summarize, or expand context. Many GraphRAG systems add entities, relations, and community structure, but the graph often remains supportive rather than decisive in scoring.

M-flow takes a different approach: the graph is the scoring engine. When a query arrives, vector search casts a wide net across multiple granularities to find entry points. Then the graph takes over — propagating evidence along typed, semantically weighted edges, and scoring each knowledge unit by the strongest chain of reasoning that connects it to the query.

Relevance is not a score. It's a path.

That distinction matters because similarity and relevance are not identical.
Similarity is proximity in representation space. Relevance is whether the system can connect the query to the answer through a coherent structure of evidence.

Similar and relevant sometimes overlap, but they are fundamentally different.
Consider an everyday query: "Why was Maria upset at Monday's standup?"

Traditional retrieval — keyword overlap can look related, yet miss the real cause:

flowchart LR
    Q["Query: Why was Maria upset\nat Monday's standup?"] -->|"similarity on repeated words:\nstandup / upset / team"| C1["Document: how to run effective\ndaily standups (handling conflict,\nteam communication tips)"]
    C1 -->|"✗ high keyword overlap,\nbut generic advice"| R["Looks relevant by words,\nnot the cause of THIS event"]

M-flow retrieval — anchor at matching granularity, then graph propagation to the Episode bundle:

M-flow stores knowledge in a four-layer cone graph: Episode → Facet → FacetPoint → Entity. A query lands on the layer that matches its granularity — a precise cue hits a fine-grained FacetPoint; a broader theme hits a Facet or an Episode summary. Here the specific cue "I wasn't told about the deadline" anchors on a FacetPoint at the same granularity, and graph propagation then routes up through its Facet to the Episode it belongs to. Each returned bundle is one Episode, scored by its strongest path of evidence.

Similar plugs

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

Java 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io