Skip to content

multi-depth architecture views for code understanding and generation in extremely fast speed

License

Notifications You must be signed in to change notification settings

allenanswerzq/llmcc

Repository files navigation

llmcc

multi-depth architecture view for codebases in extremely fast speed

problem: grep and rag based solution don't scale well: slow searches, token cost, stale indexes, expensive cloud infra etc. they dont work too well on large codebases.

llmcc tries a different approach. It builds a multi-depth architecture view that lets agents zoom out to see the big picture, zoom in to see extact symbols they need, such that agents can have a highly comprehensive understanding in very fast speed and token efficient, no complex RAG stuff, fully agentic method, its like grep but for architecture.

Supported Languages

Language Status
Rust ✅ Supported
TypeScript ✅ Supported
C++ 🔜 Planned
Python 🔜 Planned
Go 🔜 Planned
markdown 🔜 Planned
more

Why multi-depth graphs?

People (and coding agents) need to understand systems from different dimensions. Sometimes you need the high-level architecture to see boundaries, ownership, and how subsystems connect; other times you need the low-level implementation details to make a safe, precise change. llmcc provides multiple depths so you can choose the right “distance” from the code for the task.

Depth Perspective Best for
0 Project multi-workspace / repo-to-repo relationships
1 Library/Crate ownership boundaries, public API flow
2 Module subsystem structure, refactor planning
3 File + symbol implementation details, edit planning

Walkthrough: Codex (midterm size multi-crate rust project)

This repo includes many examples under sample. Download and open them in browser for the best viewing experience.

Depth 1: crate graph

Codex crate graph (depth 1)

Depth 2: module graph

Codex module graph (depth 2)

Depth 3: file + symbol graph

Codex file and symbol graph (depth 3)

Examples

By feeding the architectual view into the model, model can very quickly understand the codebase.

Question (one shot/seconds time): explain the core architectual component

Image

Question (one shot/seconds time): if we want to make some chagnes to how promopts gets handled, what places should we looking into you think

Image

Performance

llmcc is designed to be very fast, and we will try to make it faster.

The repo contains benchmark for many famous project output here: sample/benchmark_results_16.md.

Excerpt (PageRank timing, depth=3, top-200):

Project Files LoC Total
databend 3130 627K 2.53s
ruff 1661 418K 1.73s
codex 617 224K 0.46s

Installation

npm / npx (Recommended)

The easiest way to use llmcc is via npm. No build required:

npm install -g llmcc-cli
llmcc --help

Cargo (Rust)

cargo install llmcc

From Source

git clone https://github.com/allenanswerzq/llmcc.git
cd llmcc
cargo build --release
./target/release/llmcc --help

CLI: generate graphs

Generate a crate-level graph for Codex (DOT to stdout):

llmcc \
	-d sample/repos/codex/codex-rs \
	--graph \
	--lang rust \
	--depth 1

Generate a PageRank-filtered file+symbol graph (write to a file):

llmcc \
	-d sample/repos/codex/codex-rs \
	--graph \
	--depth 3 \
	--pagerank-top-k 200 \
	--lang rust \
	-o /tmp/codex_depth3_pagerank.dot

Render DOT to SVG (requires Graphviz):

dot -Tsvg /tmp/codex_depth3_pagerank.dot -o /tmp/codex_depth3_pagerank.svg

For generating sample graphs:

just gen rust

About

multi-depth architecture views for code understanding and generation in extremely fast speed

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published