Skip to content
vikrantdPublic

About

Dynamic Multi-Layer Code Flow, Instant Semantic Call Tracing, and Interactive Architectural Navigation.

Topics

Resources

Stars

7 stars

Watchers

1 watching

Forks

Repository files navigation

TLDRGraph Logo

TLDRGraph 🌐

Sub-10ms Hybrid File Search & Anti-Spaghetti Multi-Flow Code Graphs. ⚡
SQLite FTS5 + Model2Vec Static Retrieval Embeddings + Separate Execution Flow Graphs for Humans & Coding Agents.

PyPI version Documentation Python versions License: MIT


💡 Why TLDRGraph v0.3?

Whole-repo dependency diagrams turn into unreadable spaghetti hairballs the moment a project passes 30 files, while heavy RAG indexers take minutes to embed and flood agent context windows with noisy chunks.

TLDRGraph v0.3 solves both problems from the ground up:

  1. Fast Hybrid File Search (tldrgraph query) — Fuses 4-column weighted SQLite FTS5 BM25 (sub-tokenized CamelCase, snake_case, file paths, and HTTP routes) with Model2Vec (minishlab/potion-retrieval-32M) static retrieval vectors, Reciprocal Rank Fusion (RRF), and 1-hop dependency graph boosting. Indexes 160+ files in <1 second (170× faster than transformer ONNX embeddings) and localizes files in ~1–8 ms.
  2. Separate Flow Graphs Instead of Spaghetti (tldrgraph ui) — Instead of dumping 600 files into one tangled canvas, TLDRGraph isolates each user/system journey into its own 3-to-8 step Layered Flow Graph, paired with Subsystem-scoped Layer Swimlanes (automatically collapsing repetitive clone folders in monorepos) and 1-click file/line navigation (inline code viewer, live /__api/file reader, and vscode://file jump links).
  3. Antigravity-Native Incremental Workflow — Works directly through Antigravity (and other AGENTS.md / .agents/skills coding agents) with zero external API keys: tldrgraph init writes .tldrgraph/agent_brief.json, the agent reads real hub files to curate .tldrgraph/architecture.yaml, and tldrgraph status detects added/modified/removed files instantly via SHA-256 hashes.

📊 SWE-bench Lite & Memory-Recall Benchmark (40 Real GitHub Tasks)

Evaluated on 40 real-world GitHub issues from SWE-bench Lite, measuring ground-truth modified file recall, Mean Reciprocal Rank (MRR), prompt token footprint, query latency, and cold index build time:

Retrieval Method Recall@1 Recall@5 Recall@10 MRR Context Tokens Query Latency Cold Index Time
Aider Repo-Map (AST PageRank) 17.5% 50.0% 72.5% 0.331 ~8,200 2.05 ms —
Mem0 (Memory Vector Store) 42.5% 72.5% 80.0% 0.542 ~12,000 29.14 ms —
Graphify (AST Knowledge Graph) 45.0% 80.0% 82.5% 0.591 ~9,500 1.27 ms —
Codebase-Memory-MCP 50.0% 70.0% 75.0% 0.581 ~14,200 27.21 ms —
PageIndex (Tree-Based ToC) 50.0% 82.5% 85.0% 0.634 ~11,000 1.19 ms —
BM25 Lexical Keyword Search 60.0% 80.0% 85.0% 0.671 ~28,500 19.24 ms —
Chunked Dense Vector RAG 70.0% 95.0% 95.0% 0.797 ~22,400 37.48 ms 104,652 ms
TLDRGraph (FTS5 Zero-Model) 70.0% 95.0% 97.5% 0.792 ~600 2.56 ms 154 ms
TLDRGraph Hybrid (BGE-small + FTS5) 72.5% 95.0% 97.5% 0.831 ~600 31.05 ms 164,035 ms
TLDRGraph Hybrid (Model2Vec + FTS5) 77.5% 95.0% 95.0% 0.836 ~600 8.09 ms 964 ms

🚀 Quickstart

1. Install

pip install tldrgraph

2. Initialize & Build Your Architecture Graph

tldrgraph init .
  • Deterministically parses Python, TypeScript, JavaScript, Go, Rust, and Shell modules.
  • Links cross-file imports, @scope/pkg monorepo aliases, and frontend fetch('/api/...') → backend HTTP route seams.
  • Builds .tldrgraph/search.db (SQLite FTS5 + SHA-256 content-cached Model2Vec slice embeddings).
  • Installs Antigravity skill (.agents/skills/tldrgraph-init/SKILL.md), AGENTS.md, and .tldrgraph/AGENT_CONTRACT.md.
  • Compiles the zero-CDN standalone visualizer at .tldrgraph/TLDRGRAPH_VISUALIZER.html.

Ask Antigravity (or run the tldrgraph-init skill) to curate .tldrgraph/architecture.yaml from .tldrgraph/agent_brief.json and your hub source files, then re-run tldrgraph init ..

3. Localize Files Instantly (tldrgraph query)

tldrgraph query "monthly llm budget quota enforcement"
tldrgraph query "aptitude test grading proctoring" --json

Returns a concise ranked file table (file path, subsystem/layer scope, key symbols/routes, 1-line summary, score) so agents open exact target files immediately instead of running blind grep loops.

4. Explore Multi-Flow Graphs & Navigate to Code (tldrgraph ui)

tldrgraph ui --serve

Opens http://127.0.0.1:8777/ with three focused views:

  1. Flows: Separate step-by-step layered DAGs per feature/journey (LR / TB toggle, keyboard ◀/▶ walkthrough, edge labels, zero cross-flow clutter).
  2. Architecture: High-level System Overview across subsystems + scoped Layer Swimlanes with 1-click upstream caller / downstream dependency spotlighting.
  3. Files & Code: Directory tree, global / or ⌘K search modal, full live source viewer with highlighted symbol line ranges, connected flow pills, and 1-click Open in VS Code / Cursor (vscode://file...).

5. Incremental Drift Detection (tldrgraph status)

tldrgraph status
tldrgraph flows
tldrgraph layers
tldrgraph doctor

tldrgraph status compares live SHA-256 file hashes against .tldrgraph/graph.json in milliseconds, listing exact added_files, modified_files, and removed_files so Antigravity updates only what changed.


📁 Repository State (.tldrgraph/)

File Tracked in Git? Purpose
.tldrgraph/architecture.yaml Yes Human- & Antigravity-editable subsystems, layers, module summaries, and separate Flow Graphs
.tldrgraph/AGENT_CONTRACT.md Yes Schema reference for coding agents
.tldrgraph/graph.json Ignored Compiled graph snapshot with SHA-256 module hashes and enriched line ranges
.tldrgraph/search.db Ignored SQLite FTS5 + SHA-256 cached Model2Vec vector store
.tldrgraph/agent_brief.json Ignored Ranked hub modules, subsystems, and dirty-file handoff for Antigravity
.tldrgraph/TLDRGRAPH_VISUALIZER.html Ignored Zero-CDN standalone interactive multi-flow visualizer

📄 License

Distributed under the MIT License.

About

Dynamic Multi-Layer Code Flow, Instant Semantic Call Tracing, and Interactive Architectural Navigation.

Topics

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages