update worked example READMEs for v3 multi-platform

This commit is contained in:
Safi
2026-04-06 16:20:13 +01:00
parent e11d04f8c2
commit 934957cbfd
4 changed files with 83 additions and 77 deletions
+24 -25
View File
@@ -1,6 +1,6 @@
# Reproducible Example
A small document pipeline (parser, validator, processor, storage, API) with architecture notes and research notes. Six files, two languages, clear call relationships between modules.
A small document pipeline parser, validator, processor, storage, API with architecture notes and research notes. Seven files, two languages, clear call relationships between modules.
Run graphify on it and you get a knowledge graph showing how the modules connect, which functions call which, and how the architecture notes relate to the code.
@@ -8,50 +8,49 @@ Run graphify on it and you get a knowledge graph showing how the modules connect
```
raw/
├── parser.py reads files, detects format, kicks off the pipeline
├── validator.py schema checks, calls processor for text normalization
├── processor.py keyword extraction, cross-reference detection
├── storage.py persists everything, maintains the index
├── api.py HTTP handlers that orchestrate the above four modules
├── architecture.md design decisions and module responsibilities
└── notes.md open questions and tradeoffs, written informally
├── parser.py reads files, detects format, kicks off the pipeline
├── validator.py schema checks, calls processor for text normalization
├── processor.py keyword extraction, cross-reference detection
├── storage.py persists everything, maintains the index
├── api.py HTTP handlers that orchestrate the above four modules
├── architecture.md design decisions and module responsibilities
└── notes.md open questions and tradeoffs
```
## How to run it
## How to run
```bash
pip install graphifyy && graphify install
pip install graphifyy
graphify install # Claude Code
graphify install --platform codex # Codex
graphify install --platform opencode # OpenCode
graphify install --platform claw # OpenClaw
```
Then open Claude Code in this directory and type:
Then open your AI coding assistant in this directory and type:
```
/graphify ./raw
```
Takes under a minute. No PDF or image extraction, so it runs entirely on AST and markdown parsing with no token cost for semantic extraction.
No PDF or image extraction runs entirely on AST and markdown with no token cost for semantic extraction.
## What to expect
The graph should show:
- api.py as a hub node connected to all four modules
- parser.py calling validator.py and storage.py
- validator.py calling processor.py for normalize_text
- processor.py calling storage.py for load_index and save_processed
- architecture.md and notes.md linked to the code modules they discuss
The community detection will likely cluster the four Python modules together and the two markdown files together, or split api.py into its own cluster given its high connectivity.
God nodes will be storage.py (everything reads and writes through it) and api.py (connects to everything at the top level).
- `api.py` as a hub node connected to all four modules
- `storage.py` as the highest-degree god node (everything reads and writes through it)
- `parser.py` calling `validator.py` and `storage.py`
- `architecture.md` and `notes.md` linked to the code modules they discuss
- 2 communities: the four Python modules together, the two markdown files together (or api.py in its own cluster given high connectivity)
## After it runs
Ask questions in Claude Code and it answers from the graph:
Ask questions from your AI coding assistant:
- "what calls storage directly?"
- "what is the shortest path between parser and processor?"
- "which module has the most connections?"
- "what does the architecture doc say about the storage design?"
The graph lives in graphify-out/ and persists across sessions.
The graph lives in `graphify-out/` and persists across sessions.
+21 -22
View File
@@ -1,44 +1,43 @@
# httpx Corpus Benchmark — How to Reproduce
# httpx Corpus Benchmark
A synthetic 6-file Python codebase modeled after httpx's architecture. Tests graphify
on a realistic library codebase with clean layering: exceptions → models → auth/transport → client.
A synthetic 6-file Python codebase modeled after httpx's architecture. Tests graphify on a realistic library with clean layering: exceptions → models → auth/transport → client.
## Corpus (6 files)
All input files are in `raw/`:
```
raw/
├── exceptions.py — full HTTPError hierarchy (RequestError, TransportError, HTTPStatusError, etc.)
├── models.py — URL, Headers, Cookies, Request, Response with raise_for_status
├── auth.py — BasicAuth, BearerAuth, DigestAuth (challenge-response), NetRCAuth
├── utils.py — header normalization, query param flattening, content-type parsing
├── transport.py — ConnectionPool, HTTPTransport, AsyncHTTPTransport, MockTransport, ProxyTransport
└── client.py — Timeout, Limits, BaseClient, Client (sync), AsyncClient
├── exceptions.py — HTTPError hierarchy
├── models.py — URL, Headers, Cookies, Request, Response
├── auth.py — BasicAuth, BearerAuth, DigestAuth, NetRCAuth
├── utils.py — header normalization, query params, content-type parsing
├── transport.py — ConnectionPool, HTTPTransport, AsyncHTTPTransport, MockTransport
└── client.py — Timeout, Limits, BaseClient, Client, AsyncClient
```
## How to run
```bash
pip install graphifyy && graphify install
/graphify ./raw
pip install graphifyy
graphify install # Claude Code
graphify install --platform codex # Codex
graphify install --platform opencode # OpenCode
graphify install --platform claw # OpenClaw
```
Or from the CLI directly:
Then open your AI coding assistant in this directory and type:
```bash
pip install graphifyy
graphify ./raw
```
/graphify ./raw
```
## What to expect
- 144 nodes, 330 edges, 6 communities
- God nodes: `Client`, `AsyncClient`, `Response`, `Request`, `BaseClient`, `HTTPTransport`
- Surprising connections: `DigestAuth` `Response` (auth.py reads Response to parse WWW-Authenticate)
- **~1x token reduction** — 6 files fits in a context window, so there's no compression win here
- Surprising connection: `DigestAuth` linked to `Response` auth.py reads Response to parse WWW-Authenticate headers
- Token reduction: ~1x — 6 files fits in a context window, so there is no compression win here
The graph value on a small corpus is structural, not compressive: you can see the full dependency graph, identify god nodes, and understand architecture at a glance. For token reduction to matter you need 20+ files. At 52 files (Karpathy repos benchmark) graphify achieves 71.5x.
The graph value on a small corpus is structural, not compressive: you can see the full dependency graph, identify god nodes, and understand architecture at a glance. Token reduction scales with corpus size — at 52 files (Karpathy benchmark) graphify achieves 71.5x.
Run `graphify benchmark worked/httpx/graph.json` to verify the numbers yourself.
Actual output is already in this folder: `GRAPH_REPORT.md` (human-readable) and `graph.json` (full graph data).
Run `graphify benchmark worked/httpx/graph.json` to verify the numbers. Actual output is in this folder: `GRAPH_REPORT.md` and `graph.json`. Full eval: `review.md`.
+19 -9
View File
@@ -1,6 +1,6 @@
# Karpathy Repos Benchmark — How to Reproduce
# Karpathy Repos Benchmark
This is the corpus that produced the 71.5x token reduction benchmark.
This is the corpus that produced the **71.5x token reduction** benchmark.
## Corpus (52 files)
@@ -33,9 +33,9 @@ Put all files into a single folder called `raw/`:
```
raw/
├── nanoGPT/ (cloned repo)
├── minGPT/ (cloned repo)
├── micrograd/ (cloned repo)
├── nanoGPT/
├── minGPT/
├── micrograd/
├── attention.pdf
├── flashattention.pdf
├── flashattention2.pdf
@@ -46,10 +46,20 @@ raw/
└── moon_mlp.png
```
Then in Claude Code:
Install and set up the skill for your platform:
```bash
pip install graphifyy
graphify install # Claude Code
graphify install --platform codex # Codex
graphify install --platform opencode # OpenCode
graphify install --platform claw # OpenClaw
```
Then open your AI coding assistant in this directory and type:
```
pip install graphifyy && graphify install
/graphify ./raw
```
@@ -58,6 +68,6 @@ pip install graphifyy && graphify install
- ~285 nodes, ~340 edges, ~17 meaningful communities
- God nodes: `Value` (micrograd), `GPT` (nanoGPT), `Training Script`, `Layer`
- Surprising connections: nanoGPT Block and minGPT Block linked across repos, FlashAttention paper bridging into CausalSelfAttention in both repos
- Token reduction: 71.5x vs reading all 52 files cold
- Token reduction: 71.5x vs reading all 52 files directly
Full eval with scores and analysis: `review.md`
Actual output is in this folder: `GRAPH_REPORT.md` and `graph.json`. Full eval with scores: `review.md`.
+19 -21
View File
@@ -1,45 +1,43 @@
# Mixed Corpus Benchmark — How to Reproduce
# Mixed Corpus Benchmark
A small but realistic mixed-input corpus: Python source files, a markdown paper with
arXiv citations, and one image. Tests graphify's ability to handle different file types
in a single run.
A small mixed-input corpus: Python source files, a markdown paper with arXiv citations, and one image. Tests graphify on different file types in a single run.
## Corpus (5 files)
All input files are in `raw/`:
```
raw/
├── analyze.py — graphify's graph analysis module (god_nodes, surprising_connections, etc.)
├── build.py — graphify's graph builder (build_from_json, networkx wrapper)
├── cluster.py — graphify's Leiden community detection (cluster, score_all)
├── attention_notes.md — Transformer paper notes (Vaswani et al., 2017), with arXiv citation
├── analyze.py — graph analysis module (god_nodes, surprising_connections)
├── build.py — graph builder (build_from_json, NetworkX wrapper)
├── cluster.py — Leiden community detection (cluster, score_all)
├── attention_notes.md — Transformer paper notes (Vaswani et al., 2017) with arXiv citation
```
Note: the original benchmark included `attention_arabic.png` (an Arabic-language figure from the
Attention paper). PNG files are not stored in this repo. To reproduce with the image, save any
diagram or figure from the Attention Is All You Need paper as `raw/attention_arabic.png`.
Note: the original benchmark included `attention_arabic.png` (an Arabic-language figure from the Attention paper). PNG files are not stored in this repo. To reproduce with the image, save any diagram from the Attention Is All You Need paper as `raw/attention_arabic.png`.
## How to run
```bash
pip install graphifyy && graphify install
/graphify ./raw
pip install graphifyy
graphify install # Claude Code
graphify install --platform codex # Codex
graphify install --platform opencode # OpenCode
graphify install --platform claw # OpenClaw
```
Or from the CLI directly:
Then open your AI coding assistant in this directory and type:
```bash
pip install graphifyy
graphify ./raw
```
/graphify ./raw
```
## What to expect
- ~20 nodes, ~19 edges from AST alone (3 Python modules)
- 3 communities: Graph Analysis, Clustering & Scoring, Graph Building
- 3 communities: Graph Analysis, Clustering and Scoring, Graph Building
- God nodes: `analyze.py`, `cluster.py`, `build.py`
- `attention_notes.md` classified as `paper` (arXiv heuristic fires on `1706.03762`)
- If you include the image: 1 extra node describing the figure content via vision
- Token reduction: 5.4x
Full eval with scores and analysis: `review.md`
Actual output is in this folder: `GRAPH_REPORT.md` and `graph.json`. Full eval: `review.md`.