agentleFS
FlowElement-aiFlowElement-ai/m_flow/AGENTS.md

m_flow

AGENTS.md4.5k starsChanged 3 months agoApache-2.0View on GitHub

This file is intended for AI coding assistants (Cursor, Copilot, etc.) and human contributors alike. It describes the repository layout, toolchain, and conventions needed to make changes safely. See m_flow-mcp/README.md for Docker and API-mode options. Test layout: CI (.github/workflows/) runs the same commands; passing locally ≈ passing CI. Follow Conventional Commits:

  • Reads credentials
  • Installs packages
Files
AGENTS.md

M-flow — Developer & Agent Reference

This file is intended for AI coding assistants (Cursor, Copilot, etc.) and human contributors alike. It describes the repository layout, toolchain, and conventions needed to make changes safely.


1. Repository Map

m_flow/                 Python core (FastAPI + pipeline engine)
  api/                  HTTP routers: add, memorize, search, delete, …
  cli/                  CLI entrypoint (`mflow`)
  adapters/             DB adapters (graph, vector, cache)
  llm/                  LLM providers, prompts, structured output
  core/                 Domain models (Episode, Facet, FacetPoint, …)
  memory/               Memory processing (episodic, procedural)
  retrieval/            Search & retrieval algorithms
  pipeline/             Composable pipeline tasks & orchestration
  auth/                 Authentication & multi-tenancy
  eval/                 Evaluation harnesses & adapters
  shared/               Logging, settings, loaders, cross-cutting utilities
  tests/                Pytest suite (unit / integration / CLI)

m_flow-frontend/        Next.js console (pnpm)
m_flow-mcp/             MCP server — exposes memory as tool calls
mflow_workers/          Modal / worker helpers for distributed runs
examples/               Runnable demo scripts (Python, notebooks)
alembic/                SQL migration scripts (Alembic)

Extension Points

  • New data source → add a loader under shared/loaders/
  • New pipeline step → add a task under pipeline/
  • New graph DB → implement the adapter interface in adapters/graph/
  • New vector store → implement adapter in adapters/vector/
  • New LLM provider → extend llm/LLMGateway.py

2. Local Development

Python backend (requires Python 3.10 – 3.13)

# Bootstrap
uv sync --dev --all-extras --reinstall

# Run the API server
uv run python -m m_flow.api.client

# CLI quick-start
uv run mflow add "M-flow builds structured memory for agents."
uv run mflow memorize
uv run mflow search "How does M-flow work?"
uv run mflow -ui          # launches backend + frontend + MCP

Frontend console (Next.js / pnpm)

cd m_flow-frontend
pnpm install
pnpm dev              # http://localhost:3000
pnpm lint && pnpm build

MCP server

cd m_flow-mcp
uv sync --dev --all-extras
uv run python src/server.py                  # stdio
uv run python src/server.py --transport sse  # SSE mode

See m_flow-mcp/README.md for Docker and API-mode options.


3. Quality Gates

Tests

PYTHONPATH=. uv run pytest m_flow/tests/unit/ -v          # ~963 test cases
PYTHONPATH=. uv run pytest m_flow/tests/integration/ -v   # needs .env keys

Test layout:

DirectoryScope
m_flow/tests/unit/Pure-logic, no network
m_flow/tests/integration/Requires LLM / DB credentials
m_flow/tests/cli_tests/CLI smoke tests

Linting & Formatting

uv run ruff check .       # lint (line-length 100, see pyproject.toml)
uv run ruff format .      # auto-format
uv run mypy m_flow/       # optional type-check

CI (.github/workflows/) runs the same commands; passing locally ≈ passing CI.


4. Conventions

Code Style

AspectRule
Indentation4 spaces (Python), 2 spaces (TS/YAML)
Namingsnake_case functions/modules, PascalCase classes
Type hintsRequired on public API signatures
Error handlingStructured; use m_flow.shared.logging_utils
ImportsSorted by ruff; no wildcard imports

Commit Messages

Follow Conventional Commits:

feat(graph): add temporal edge weighting
fix(api): handle missing auth cookie
docs: update installation instructions

Pull Requests

  1. Branch from dev.
  2. Include scope, local test commands run, and any UI/MCP impacts.
  3. Sign commits (git commit -s) and affirm the DCO (see CONTRIBUTING.md).
  4. PR titles are validated by CI (pr_lint workflow).

5. Docker

docker compose up                       # backend only
docker compose --profile ui up          # backend + frontend
docker compose --profile neo4j up       # backend + Neo4j

Environment variables are documented in .env.template.

Download now (ZIP)

Trending

Quiet since April.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 1 mentionMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the FlowElement-ai/m_flow repository that our weekly crawl found: only 1 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about FlowElement-ai/m_flow

The biggest 1 of 1 mention linking to the repository that our crawl found. Each line is their own headline.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.