Behavior-first repository indexing for AI coding agents
Project description
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"
Record a GIF locally: brew install vhs && ./scripts/record-demo.sh
See docs/demo-output.txt for captured terminal output.
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.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flowindex-0.1.0.tar.gz.
File metadata
- Download URL: flowindex-0.1.0.tar.gz
- Upload date:
- Size: 35.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ea71aef8d86c211d2ddbaa4a6da5b89f04504cd6876c9bb7221479c3819e070
|
|
| MD5 |
a28c595d825c35e81cd050b0fe671b30
|
|
| BLAKE2b-256 |
54ae5a4c9776b0dc5a41b72f7104b92b00ed223d42d87b0c3f9c8ca18310e4dd
|
Provenance
The following attestation bundles were made for flowindex-0.1.0.tar.gz:
Publisher:
publish.yml on adu3110/flowIndex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flowindex-0.1.0.tar.gz -
Subject digest:
5ea71aef8d86c211d2ddbaa4a6da5b89f04504cd6876c9bb7221479c3819e070 - Sigstore transparency entry: 1939344259
- Sigstore integration time:
-
Permalink:
adu3110/flowIndex@d29f92103cab06a552586c9f9a680403dfb637d4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/adu3110
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d29f92103cab06a552586c9f9a680403dfb637d4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file flowindex-0.1.0-py3-none-any.whl.
File metadata
- Download URL: flowindex-0.1.0-py3-none-any.whl
- Upload date:
- Size: 38.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08c64ac6865ce4dc979ee5f8bb0bbc2ecda22255d731843a39cd776b64146a80
|
|
| MD5 |
145b8f347e292b8b3be4848f1de7d18d
|
|
| BLAKE2b-256 |
5bf62b1d7a9c466db5f7325d7fcfc9cb358b1cbe4b3a51cc6be4824603aa115d
|
Provenance
The following attestation bundles were made for flowindex-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on adu3110/flowIndex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flowindex-0.1.0-py3-none-any.whl -
Subject digest:
08c64ac6865ce4dc979ee5f8bb0bbc2ecda22255d731843a39cd776b64146a80 - Sigstore transparency entry: 1939344334
- Sigstore integration time:
-
Permalink:
adu3110/flowIndex@d29f92103cab06a552586c9f9a680403dfb637d4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/adu3110
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d29f92103cab06a552586c9f9a680403dfb637d4 -
Trigger Event:
release
-
Statement type: