Tech Stack & Ecosystem
The technologies powering Graphify and how it fits into the broader AI coding landscape.
Core Technologies
Python 3.10+
Core language. Chosen for ecosystem compatibility with tree-sitter, NetworkX, and AI model SDKs.
NetworkX
In-memory graph data structure and algorithms. No database needed — the graph serializes to JSON.
tree-sitter
Parser generator for concrete syntax trees. 19 languages. Deterministic, fast, local — no LLM calls.
vis.js
Interactive force-directed graph layout in the browser. Search, filter, click-to-explore.
Leiden (graspologic)
Community detection algorithm. Finds clusters by edge density — no embeddings or vector DB.
Claude / GPT-4
Parallel subagents extract concepts from docs, papers, and images. Only for non-code content.
Optional Dependencies
| Extra | Package(s) | Purpose |
|---|---|---|
[mcp] | mcp | MCP stdio server for agent queries |
[neo4j] | neo4j | Direct push to Neo4j instance |
[pdf] | pypdf, html2text | PDF text extraction |
[watch] | watchdog | File system monitoring for auto-rebuild |
[leiden] | graspologic | Leiden community detection (preferred over Louvain) |
[office] | python-docx, openpyxl | .docx and .xlsx support |
[all] | all of the above | Install everything |
pip install graphifyy[all] # install with all extras
Platform Integration
CLAUDE.md + PreToolUse hook fires before Glob/Grep calls, surfacing graph context automatically.$graphify. Uses AGENTS.md for always-on instructions. Needs multi_agent = true for parallel extraction./graphify. Uses AGENTS.md. Standard skill installation./graphify. Uses AGENTS.md. Sequential extraction only (parallel agent support is early)./graphify. Uses AGENTS.md. Parallel extraction via Task tool.Always-On vs. Explicit Commands
- Reads GRAPH_REPORT.md before file searches
- Gives the AI a "map" of the codebase
- Passive — no user action needed
- Best for: everyday navigation
- Traverses raw graph.json hop by hop
- Traces exact paths between nodes
- Active — user asks specific questions
- Best for: deep investigation
The hook gives your assistant a map. The commands let it navigate the map precisely.
Supported File Types
| Type | Extensions | Extraction Method |
|---|---|---|
| Code | .py .ts .js .go .rs .java .c .cpp .rb .cs .kt .scala .php .swift .lua .zig .ps1 .ex .exs .m .mm | tree-sitter AST + call-graph + rationale |
| Docs | .md .txt .rst | Claude concept extraction |
| Office | .docx .xlsx | Convert to markdown, then Claude |
| Papers | Citation mining + concept extraction | |
| Images | .png .jpg .webp .gif | Claude vision |
Extending Graphify
Adding a New Language
LanguageConfig instance with AST node types for the language_import_<lang>() function for language-specific import handlingextract() dispatch and collect_files()CODE_EXTENSIONS in detect.py and _WATCHED_EXTENSIONS in watch.pypyproject.toml dependenciestests/fixtures/ and tests to tests/test_languages.pyProgrammatic Usage
from graphify.detect import detect
from graphify.extract import extract
from graphify.build import build_from_json
from graphify.cluster import cluster
from graphify.analyze import god_nodes, surprising_connections
files = detect("./my-project")
extractions = extract(files["files"]["code"])
G = build_from_json(extractions)
communities = cluster(G)
gods = god_nodes(G)
Knowledge Check
1. Why does Graphify use two extraction passes instead of one?
2. What does the EXTRACTED confidence tier mean?
3. How does Graphify detect communities?
4. What happens when you run /graphify . --update?
Built from safishamsi/graphify
← Back to Home