Dual-Graph-RAG · deterministic by design

Turn your legacy codebase into a project expert.

prjxp gives LLM coding assistants — opencode, GitHub Copilot and friends — precise, structurally-correct knowledge about your software. Two graphs, one Lucene index, and no LLM in the index path.

0 LLM calls at index time 1 embedded Lucene engine 16 MCP tools
The problem

Legacy code sits between blind search and extraction cost.

Naive vector search sees a codebase as a bag of text and loses call chains, inheritance and interfaces. LLM-extracting Graph-RAG restores structure — at the price of hours of indexing and a flooded context window.

🧩

Syntactic blind flight

Plain embeddings split code into arbitrary windows. Tightly coupled classes with different names drift far apart in vector space, and call chains vanish.

loses structure
⛏️

Prohibitive extraction cost

Entity extraction through an LLM means compute cost, days of runtime and re-synchronisation on every commit — for millions of lines of legacy code.

slow & non-deterministic
🌀

Context-window stuffing

Dumping large subgraphs into the prompt increases latency, bloats the KV cache and triggers the lost-in-the-middle effect in local models.

unreliable
The architecture

Two graphs. One deterministic index.

prjxp maps code and documentation onto two complementary graphs, both stored in a single embedded Apache Lucene index. Nothing in the code/index path calls an LLM.

▸ Structural AST graph

Classes and methods are nodes; typed fields are edges. The hard, directed dependencies of the code.

  • CALL
  • EXTENDS
  • IMPLEMENTS
  • IMPORT
  • FIELD
  • PARAM
  • RETURN
  • CONTAINS
  • GENERIC_ARG
  • ANNOTATION
px Lucene

▸ Semantic vector graph

Every chunk is an HNSW vector. The neighbourhood graph bridges domain documentation with the technical implementation.

  • HNSW
  • KNN
  • c-TF-IDF
  • Leiden

AST extraction

Chunk-Norris parses source into structured PxChunks and records typed edges between symbols.

deterministic

Embed & store

Tibed embeds the chunks and writes vectors plus full metadata into the Lucene index.

HNSW · Lucene

Community clustering

The Leiden algorithm splits both graphs into tightly coupled structural and thematic clusters.

Leiden

Statistical signatures

TF-IDF and class-based c-TF-IDF sign every chunk and cluster — precise, local, zero LLM cost.

TF-IDF · c-TF-IDF
Why it's different

Retrieval that understands structure

prjxp doesn't just search — it clusters, signs and navigates the codebase. These are the ideas that separate dual-graph RAG from a generic vector database.

🧱

The PxChunk model

Chunks of the same logical unit share an ID and carry hierarchical parent links plus a reference (FQN + signature) — so original source is reconstructed exactly.

structural identity
🌲

Forest of Trees

When a query hits several parts of a system, golden-retriever groups the hits into distinct logical trees, enriches each, and merges them into coherent context.

reconstruction
🕸️

Leiden communities

Both the AST and the semantic graph are clustered with Leiden. Structural modules and thematic knowledge clusters emerge without any model call.

automatic clusters
✍️

Zero-LLM signatures

TF-IDF and c-TF-IDF produce precise term signatures per chunk and per cluster from the Lucene inverted index. Deterministic, cheap, reproducible.

deterministic
🪜

Progressive disclosure

The LLM first receives compact pointers, then climbs to graph neighbours and finally to exact source — only the context it actually needs.

lean context
🛰️

Multi-Project Hub

One long-running hub links many repositories and live workspaces, each stamped in a shared index. The AI always works on the real build state.

one engine, many projects
Measured, not claimed

Highest quality per resource use in the benchmark

Four arms — prjxp (P), a naive file-system agent (N), a code graph (G) and naive vector search (V) — on a frozen corpus. Higher is better in the first three panels.

Score (0–1)
P
0.63
N
0.60
G
0.41
V
0.36
QEI (quality per efficiency)
P
2.02
N
1.45
G
1.11
V
0.70
Effective tokens (lower is better)
P
29,138
N
39,330
G
29,098
V
52,313
P — prjxp hub (dual graph) N — naive file-system agent G — Graphify (code only) V — naive vector search
Peak context · duration (lower is better)
P
11,768
N
13,485
G
13,328
V
17,676
P
33.2 s
N
44.0 s
G
46.2 s
V
51.6 s

Four-arm run, frozen prjxp corpus. A stricter same-run counter-check on two corpora confirms the score advantage (0.639 vs. 0.620 and 0.459 vs. 0.430) — and honestly relativizes cost leadership once the tool schema grows. See the full benchmark →

Deployment

One command. Full stack.

The recommended way to start prjxp is docker compose up -d. That brings up the hub, the web frontend and the Apache reverse proxy together. Prebuilt multi-arch images are published to the GitHub Container Registry. Embeddings run against any OpenAI-compatible endpoint — the application never runs neural inference itself.

🎯 Single Project one container

One container per project. The control script runs the full pipeline — chunk → embed → hub.

  • Index your own codebase in one command
  • MCP server on :7007
  • Re-index after code changes
# index one project, then start the MCP hub
./prjxp /path/to/your-project mcp

🛰️ Multi-Project Hub many projects

A long-running hub serves any number of projects added at runtime from one shared, project-stamped Lucene index.

  • Drop a tar archive into the import dir
  • Or mount live projects + a prjxp.yaml marker
  • Watch lifecycle in the web UI: importing → chunking → embedding → ready
# start hub + frontend, then drop a project in
docker compose up -d
tar czf import/my-project.tar my-project/

Full stack: docker compose up -d → frontend and hub UI at http://localhost, MCP endpoint at http://localhost:7007/mcp.

Fun fact — the Documentation Paradox
"Chunk Norris doesn't need documentation.
Chunk Norris is the source of it!"

Documentation is a generation task, not a manual one. prjxp uses its own retrieval pipeline to write its own technical docs — it doesn't just process code, it understands its own soul.

Give your AI assistant ground truth.

Point prjxp at a project, and let your coding assistant ask real questions about real code — answered from a structurally-correct dual-graph index, not guesswork.