flowindex
Enables AI coding agents to analyze codebase behavior through entrypoints, call paths, and tests, providing impact analysis and context packs for code changes.
README
FlowIndex

Behavior-first repository indexing for AI coding agents.
FlowIndex maps how a codebase behaves: entrypoints, call paths, tests, runtime traces, and git history. It helps AI coding agents understand impact before editing code.
Most coding-agent tools index files, chunks, symbols, or embeddings. FlowIndex indexes behavior.
It answers questions like:
- What code path handles this feature?
- What will break if I change this function?
- Which tests should run for this patch?
- Which previous bug fixes touched this area?
- What minimal context should an agent receive before editing?
Why behavior-first?
File trees and embedding search tell you what exists. They do not tell you what runs, what breaks, or what matters when you change a shared module.
FlowIndex builds a local, deterministic behavior graph:
- Entrypoints — API routes, webhooks, pages, CLI commands
- Call paths — function-to-function relationships from static analysis
- Tests — pytest, Jest/Vitest detection linked to symbols
- Git history — co-change patterns and bug-fix commit signals
- Impact — transparent risk scoring before you edit
No vector database. No LLM calls. No SaaS. Inspectable SQLite.
How it differs
| Approach | FlowIndex |
|---|---|
| Repo maps / file trees | Behavior graph with entrypoints and call edges |
| Embeddings / RAG | Deterministic lexical + graph ranking |
| Agent frameworks | Developer tool that feeds agents context |
| Generic static analysis | Agent-oriented impact, tests-for, context packs |
Installation
pip install flowindex
MCP support for Cursor / Claude Code:
pip install "flowindex[mcp]"
From source:
git clone https://github.com/adu3110/flowIndex.git
cd flowIndex
pip install -e ".[dev]"
Quickstart
cd your-project
flowindex init # use --here inside nested example dirs
flowindex scan
flowindex overview
flowindex explain "POST /api/payments"
flowindex impact src/services/ledger.py
flowindex tests-for update_ledger
flowindex context "fix duplicate payments when webhook retries"
Demo
cd examples/python_fastapi_app
flowindex init --here
flowindex scan
flowindex context "fix duplicate payments when webhook retries"
CLI examples
# Initialize index in current repo
flowindex init
# Scan and build behavior graph
flowindex scan
# Explain an entrypoint flow
flowindex explain "POST /payments"
# Analyze change impact
flowindex impact services/ledger.py
# Suggest tests for a change
flowindex tests-for services/ledger.py
# Generate agent context pack
flowindex context "fix webhook retry duplicate ledger entries"
MCP usage (Cursor)
Add to Cursor MCP settings (~/.cursor/mcp.json or project settings):
{
"mcpServers": {
"flowindex": {
"command": "flowindex",
"args": ["mcp"],
"cwd": "/absolute/path/to/your/repo"
}
}
}
Run flowindex init && flowindex scan in that repo first.
Start the server manually:
flowindex mcp
Tools: get_repo_overview, explain_entrypoint, get_change_impact, suggest_tests, make_context_pack, and more — see docs/mcp.md.
Architecture
flowchart LR
subgraph ingest [Ingest]
Scan[File Scanner]
Py[Python Parser]
TS[TS/JS Parser]
Git[Git Analyzer]
end
subgraph index [Local Index]
DB[(SQLite)]
Graph[Behavior Graph]
end
subgraph out [Outputs]
CLI[CLI Commands]
MCP[MCP Server]
Pack[Context Packs]
end
Scan --> Py
Scan --> TS
Py --> Graph
TS --> Graph
Git --> Graph
Graph --> DB
DB --> CLI
DB --> MCP
DB --> Pack
Example context pack
flowindex context "fix duplicate payments when webhook retries"
# FlowIndex Context Pack
## Task
fix duplicate payments when webhook retries
## Likely Relevant Entrypoints
- POST /payments
- POST /stripe/webhook
## Likely Relevant Files
- main.py
- services/ledger.py
- services/payments.py
## High-Risk Symbols
- update_ledger()
- handle_stripe_webhook()
## Tests to Run
- tests/test_payments.py
## Caution
- services/ledger.py has high change risk.
- update_ledger() is shared by refunds and payments.
Limitations
FlowIndex is a static-analysis tool, not a runtime tracer. Here is what works well and what is on the roadmap:
| Claim | Current reality |
|---|---|
| Behavior indexing | Static analysis + git co-change heuristics. Runtime traces not yet ingested. |
| Call paths | Cross-file resolution via import graph + named symbol matching. Not a full compiler-grade call graph. |
| Test selection | Name similarity, import edges, graph coverage links, co-change patterns. Not coverage-backed. |
| Git history | Scoped to the indexed repo root even inside monorepos. Commit relevance is keyword-matched, not coverage-tracked. |
| TS/JS support | Heuristic parser: functions, arrow functions, classes, class methods, qualified calls. Tree-sitter is on the roadmap. |
| Context packs | Import-aware file ranking. May miss files with no keyword match in their name. |
Roadmap
- [ ] Tree-sitter parsers for TS/JS and richer call resolution
- [ ] Runtime trace ingestion (OpenTelemetry, test coverage)
- [ ] Cross-repo dependency indexing
- [ ] Patch-aware incremental scan
- [ ] Language servers: Go, Rust, Java
Research questions
- How much agent error reduction comes from behavior graphs vs embeddings?
- What is the minimal context pack size that preserves patch correctness?
- Can co-change graphs predict test selection better than import graphs alone?
- Which entrypoint classes correlate most with production incidents?
Contributing
- Fork and clone the repository
pip install -e ".[dev]"- Make changes with tests
ruff check . && mypy flowindex && pytest- Open a pull request
See docs/ for concepts, CLI reference, and examples.
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。