Skip to main content

Mapify

A semantic codebase mapping engine for AI.

Mapify scans a project, parses the abstract syntax trees (ASTs) of its code, and produces a lightweight semantic knowledge graph — a machine-readable map of how files, classes, functions, API calls, routes, state, and database models are connected. Every node is ranked with PageRank, so Mapify can tell you which files architecturally matter most: the "God Nodes".

Feed that map to an LLM as plain JSON and your AI agents get precise, grounded context about how a codebase is wired together.


Features

  • AST-grade parsing via tree-sitter, with regex fallbacks for SQL & Prisma
  • Semantic graph — classes, functions, imports, API calls, route handlers, React state, and database reads/writes as typed nodes & relationships
  • God Nodes — the most important files, ranked by PageRank
  • Fast & safe — skips .gitignore-ignored and build directories automatically
  • Four outputs — Blueprint, Symbol Table, Graph (JSON + GraphML), Summary
  • Cross-platform — works on macOS, Linux, and Windows

Supported Languages

Language Extensions Parser
Python .py tree-sitter
TypeScript .ts, .tsx tree-sitter
JavaScript .js, .jsx tree-sitter
Go .go tree-sitter
Rust .rs tree-sitter
Java .java tree-sitter
C / C++ .c, .h, .cpp, .hpp tree-sitter
Ruby .rb tree-sitter
SQL .sql regex
Prisma .prisma regex

Missing grammars never crash Mapify — it simply skips languages that aren't installed (all grammars ship by default).

Installation

From PyPI

pip install mapifyy-cli

Or, for an isolated globally-available install:

pipx install mapifyy-cli

From source

git clone https://github.com/uditc0derr/mapifyy-cli
cd mapifyy-cli
python -m venv .venv && source .venv/bin/activate
pip install -e .

Quick Start

cd your-project-folder
mapify run .

This generates a mapify-out/ folder and prints a summary:

╭──────────────────────────────────────╮
│ Mapify Engine                       │
│ Target: /path/to/your-project       │
╰──────────────────────────────────────╯
✔ Discovered 128 valid files.
✔ Knowledge Graph generated successfully!
Saved to: /path/to/your-project/mapify-out
     God Nodes (most important files)
┏━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━┓
┃ # ┃ Node                   ┃ Type ┃  Score ┃
┡━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━┩
│ 1 │ src/app/main.py        │ file │ 0.3667 │
│ 2 │ src/services/auth.py   │ file │ 0.2333 │
└───┴────────────────────────┴───────┴────────┘

The Score column is the node's PageRank value: how central a file is to your architecture. Higher is more important; the top-ranked files are your God Nodes. (If PageRank can't be computed, a degree-centrality fallback is used.)

CLI reference

# Map a whole directory
mapify run ./src

# Map a single file
mapify run ./src/main.py

# Custom output location (default: mapify-out/codebase_blueprint.json)
mapify run . --output artifacts/blueprint.json

# Change how many God Nodes are reported (default: 5)
mapify run . --god-nodes 10

# Show the version
mapify --version

Tips for better results

  • Mapify always respects your .gitignore, plus a built-in denylist (.git/, node_modules/, .venv/, __pycache__/, dist/, build/, .next/, and more).
  • mapify-out/ is excluded, so Mapify never maps its own output.
  • No .gitignore present? Add one — it makes analysis dramatically cleaner.

Generated Outputs

mapify run writes everything into mapify-out/ (or the folder you pass to --output):

File Contents
codebase_blueprint.json Per-file AST extract: classes, functions, imports, calls, API calls, states, routes, DB reads/writes, hash, size
symbol_table.json Global registry of every function, class, module, route, and model
semantic_graph.json NetworkX node-link graph. Edges: imports, calls, calls_api, uses_state, defines_route, reads, writes, contains
semantic_graph.graphml The same graph in GraphML — open it in Gephi, yEd, or Cytoscape
summary.json Stats, node breakdown, execution summary, and the top God Nodes

Node types & relationships

Node types: file, class, function, module, api, state, route, database_model.

Edges: contains, imports, calls, calls_api, uses_state, defines_route, reads, writes.

How It Works

  1. Discover — walk the target directory, honoring .gitignore and the denylist.
  2. Parse — extract symbols from each file with tree-sitter queries.
  3. Resolve — link imports and calls between files (dotted and relative imports like ../utils/x).
  4. Build — assemble the typed, directed graph with NetworkX.
  5. Rank — run PageRank to compute the God Nodes.
  6. Export — write the Blueprint, Symbol Table, Graph (JSON + GraphML), and Summary.

Project Structure

src/mapify/
├── cli.py          # Typer CLI (run / --version)
├── parser.py       # AST extraction (tree-sitter + regex fallbacks)
├── graph.py        # NetworkX semantic graph + PageRank God Nodes
├── symbols.py      # Global symbol registry & import resolution
├── resolver.py     # Cross-file import & call resolution
└── utils/
    └── file_ops.py # File discovery, .gitignore handling, hashing

Development

git clone https://github.com/uditc0derr/mapifyy-cli
cd mapifyy-cli
python -m venv .venv && source .venv/bin/activate
pip install -e .
mapify run . --output mapify-out/codebase_blueprint.json

Mapify maps itself — run the command above to inspect the outputs it produces about its own codebase.

Contributing

Pull requests are welcome. For significant changes, please open an issue first to discuss what you'd like to do.

License

MIT — see the project repository for details.

Release files for mapifyy-cli 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mapifyy-cli 1.0.2
File Size Uploaded
mapifyy_cli-1.0.2.tar.gz 15.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mapifyy-cli 1.0.2
File Interpreter ABI Platform
mapifyy_cli-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 33.7 kB

Release files / mapifyy_cli-1.0.2.tar.gz

Download URL mapifyy_cli-1.0.2.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e18b51acc2ce27525059432e36bde5d6a9698ce20d55550e9355c418a2e92554
BLAKE2b-256 checksum
How to use checksums
1ac327040ba7b97d6830f799ac6058ff5c8c918d1732612aa4d5cf5cd46a5d64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.13

Release files / mapifyy_cli-1.0.2-py3-none-any.whl

Download URL mapifyy_cli-1.0.2-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ff0d6e45c04fbda6f9adf169371161c530c5938c06ecc164ad8c4fa439a184f
BLAKE2b-256 checksum
How to use checksums
90e1128d9d9e12346862273cad79d0e19c4e4c9606f22369d62529a853aa52da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.13

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page