Local-first · no cloud · no account · nothing leaves your machine

grafel

Map your codebase, navigate any part.

A local code-knowledge-graph daemon that gives AI agents structural navigation across one or many repos. A companion to grep, not a replacement — its value is navigation; token savings is a side effect.

Where grep gets lost, grafel shows the way.

39
languages
263
frameworks · 186 ORMs
161
tools & platforms
22
MCP tools for agents

The difference, one question at a time

See how an agent works the problem — then flip it.

Pick a real question an AI agent gets asked. Watch it grind through the grep way, then toggle to the grafel way — the answer as a graph: complete, connected, and correct — where grep could only guess.

How the AI talks to it

A companion to grep, not a replacement.

grep matches text across files. grafel maps the structure between them — the questions grep can't answer: where X is defined, who calls Y, how a request flows end to end, what a rename really breaks.

Text vs. structure

grep finds text. grafel finds structure.

grep matches characters across files; grafel resolves what those characters are — a call, a query, a route — and how they connect.

Enumeration vs. navigation

Raw sweep → grep. Navigation → grafel.

Every TODO or every if err != nil is a grep job. "Who calls X?" is a graph traversal.

Setup cost

Zero setup vs. an indexed graph

grep runs anywhere with nothing to install; grafel trades that for a typed index spanning every repo in the group.

Granularity

Line-level vs. entity-level

grep returns matching lines; grafel returns the function, the caller, and the typed edge between them.

Scope

One file vs. infra ↔ code

grep stops at a repo boundary; grafel follows a field across the wire into Terraform, Kafka, and the DB.

Ranking

Unranked vs. BM25-ranked and linked

grep hands back everything it matched; grafel ranks the right symbol to the top and connects it to its neighbors.

Cross-repo payloads

Can't follow the wire vs. tracks the shape

An HTTP field crossing repos is invisible to text search; grafel tracks its shape end to end, DTO to DTO.

Round-trip

Read the files vs. one MCP call

grep answers by making the agent open every file; grafel answers directly over the Model Context Protocol.

Paired in practice

Narrow, then verify

grafel narrows a 500-file repo to the 8 handlers that matter; grep then verifies the exact string inside them.

Rule of thumb

Structural question → grafel. Text sweep → grep.

If the question is "where/who/how does it connect," reach for grafel. If it's "every instance of this string," reach for grep.

Coverage matrix

39 languages. 263 frameworks. 186 ORMs.

Tree-sitter extractors plus framework-aware passes recover the edges that matter — routes, models, jobs, ORM queries, topics — tracked in a generated coverage matrix, not a marketing claim.

Top languages by framework support
Cross-cutting infrastructure · 125 records

The graph model

59 entity kinds. 106 relationship kinds.

Extraction turns source into a graph: nodes are the things in your system, edges are how they relate — the same shape whether it's a function call or a Kafka topic.

Entities · 59

The nodes — what exists in the system.

Relationships · 106

The typed edges — how nodes connect.

The complete set, generated from the type registry.

Under the hood

Built locally, powered by real algorithms.

From AST to graph math — every phase runs on your machine and lands in one compact artifact (graph.fb), never a cloud.

39 languages

AST extraction

Language-aware parsers turn source across 39 languages into typed syntax trees — functions, types, endpoints, fields — the base entities and edges every later pass is built on.

e.g. a Python module → its classes, functions and imports, typed and located, not just lines of text.

per-stack analyzers

Framework & ORM engine

Dedicated analyzers recognize each framework, ORM and tool separately — Spring, Django, FastAPI, Rails, React, Play, Quartz and more — then staged passes resolve references and imports and trace data-lineage, process & event flow, coupling and shared databases: the semantic edges generic parsing can't see.

e.g. a FastAPI route → its handler → the ORM model → the orders table, linked into one traversable path.

ranked retrieval

BM25

Term-frequency × inverse-document-frequency with length normalization — how find ranks the right symbol to the top, where naive grep returns everything and orders nothing.

e.g. agent asks "find the auth middleware" → AuthMiddleware ranked #1, above 200 raw string matches of "auth".

the database

Graph traversal

Callers, reachability and end-to-end paths resolve in a hop across typed edges — the single query that replaces reading N files to trace a chain by hand.

e.g. "who calls PaymentService.charge?" → 3 callers across 2 repos in one hop, no file reads.

GDS

Graph Data Science

PageRank surfaces load-bearing code, community detection recovers module boundaries, betweenness finds articulation points, and taint-flow & def-use passes follow data through the system.

e.g. "what's load-bearing here?" → PageRank surfaces DbPool + AuthMiddleware; community detection recovers the 6 modules.

architecture

serve / engine

An always-on server exposes the graph over MCP while a background engine re-indexes incrementally on each commit — memory-tiered, with a live status plane, and it never phones home.

e.g. the agent queries over MCP while the engine re-indexes your last commit — the answer is always current, no manual reindex.

Get started

Install, then point it at your repo.

A local binary — no account, no cloud call. Install it, then run the wizard from any repo (or a folder of repos) and ask the question you couldn't grep.

1

Install the binary

$ curl -fsSL https://raw.githubusercontent.com/cajasmota/grafel/main/install.sh | bash

Downloads the latest release binary into ~/.grafel/bin.

2

Point it at your repo

Run grafel wizard from your project root to index a single repo — or from a folder that holds several repos to map them as one connected group. The wizard detects what's there, builds the graph, starts the file watcher, and wires up the MCP server for your agent. Everything runs on your machine and stays there.

$ grafel wizard # from your project root, or a folder of repos
Local-first MIT licensed github.com/cajasmota/grafel