How tomleelive/flowelement-ai-m_flow works
M-flow is a cognitive-memory and GraphRAG product: users ingest material, the system constructs structured memory, and search follows evidence paths to return episode bundles. The graph includes the documented management, procedural-memory, and integration surfaces. Some subsystem links are documented only at the product level; unsampled implementation details are not assumed.
Main entry points: memorize.py Memory construction · get_ingest_router.py REST API · ingest.py Ingest orchestration · search.py Search API
Components 25
User surfaces
- Web console
m_flow-frontend/src/app/page.tsx - MCP server
m_flow-mcp/src/server.py - M-flow client
m_flow-mcp/src/m_flow_client.py - REST API
m_flow/api/v1/ingest/routers/get_ingest_router.py
Ingestion and memory
- Ingest orchestration
m_flow/api/v1/ingest/ingest.py - Input storage
m_flow/ingestion/pipeline_tasks/save_data_item_to_storage.py - Raw data add
m_flow/api/v1/add/add.py - Memory construction
m_flow/api/v1/memorize/memorize.py - Episode modeling
m_flow/memory/episodic/models.py - Coreference processing
m_flow/preprocessing/coreference/session_manager.py - Coreference engine
coreference/coreference_module/coreference.py - English coreference
coreference/english_coreference/coreference.py
Graph retrieval
- Search API
m_flow/api/v1/search/search.py - Graph-routed retrieval
m_flow/retrieval/cypher_search_retriever.py - Time parsing
m_flow/retrieval/time/query_time_parser.py
Platform services
- Authentication
m_flow/api/v1/ingest/routers/get_ingest_router.py - Graph store adapters
m_flow/adapters/graph/use_graph_adapter.py - Vector store adapters
m_flow/adapters/vector/create_vector_engine.py - Embedding engine
m_flow/adapters/vector/embeddings/LiteLLMEmbeddingEngine.py - LLM providers
m_flow/llm/backends/litellm_instructor/llm/get_llm_client.py - Relational storage
m_flow/adapters/relational/config.py - Cache interface
m_flow/adapters/cache/cache_db_interface.py - Pipeline tracking
m_flow/pipeline/methods/get_active_pipeline_runs.py
Other components
- User
- LLM service
Connections 28
- User → Web console: uses
- User → MCP server: connects
- Web console → REST API: requests
- MCP server → M-flow client: uses
m_flow-mcp/src/server.py - M-flow client → REST API: calls
- REST API → Authentication: authenticates
m_flow/api/v1/ingest/routers/get_ingest_router.py - REST API → Ingest orchestration: invokes
m_flow/api/v1/ingest/routers/get_ingest_router.py - Ingest orchestration → Input storage: stores inputs
- Ingest orchestration → Raw data add: adds raw data
- Ingest orchestration → Memory construction: builds memory
- Memory construction → Episode modeling: constructs episodes
- Memory construction → Coreference processing: resolves references
- Coreference processing → Coreference engine: uses
m_flow/preprocessing/coreference/session_manager.py - Coreference processing → English coreference: uses
m_flow/preprocessing/coreference/session_manager.py - User → Search API: queries
- Search API → Graph-routed retrieval: retrieves
- Graph-routed retrieval → Vector store adapters: finds anchors
- Graph-routed retrieval → Graph store adapters: propagates evidence
- Search API → Time parsing: parses time
- Memory construction → Graph store adapters: writes memory
- Memory construction → Vector store adapters: indexes memory
- Vector store adapters → Embedding engine: embeds text
m_flow/adapters/vector/create_vector_engine.py - Embedding engine → LLM service: requests vectors
m_flow/adapters/vector/embeddings/LiteLLMEmbeddingEngine.py - Memory construction → LLM providers: extracts knowledge
- Search API → LLM providers: composes answer
- REST API → Relational storage: manages records
- REST API → Cache interface: may cache
- Ingest orchestration → Pipeline tracking: tracks runs