// codebase intelligence, self-hosted


RepoLens clones a repo, chunks it into a searchable vector index, and builds a code graph of every symbol and import. Then it answers in plain language — streamed, with file:line citations and diagrams it draws itself.

repolens · workspace

// the problem

You inherit 80,000 lines and a README that lies. Onboarding is grep, guesswork, and interrupting the one person who remembers why.

// how it works

// 01 — index

Clone, chunk, embed

Shallow-clones any GitHub repo, splits source into line-aware overlapping chunks, and embeds each one — 768-dim Gemini vectors, L2-normalised, persisted to SQLite or Postgres.

POST /api/ingest { "source": "https://github.com/…" }
→ 126 chunks · 92 symbols · 83 edges  (1.4s)

// 02 — graph

Map every relationship

A regex-free-zone it is not — but it works: declared symbols with line numbers, plus resolved import edges between files, queryable in SQL.

GET /api/symbols?name=chunk
→ chunkDocument · services/chunker.js:28

// 03 — ask

Grounded answers

Hybrid retrieval — cosine similarity re-ranked by path and symbol matches — feeds an LLM that must cite its sources or admit it can't.

// measured, not promised

Numbers from npm run eval — a golden-set harness that runs real questions through the real pipeline. Re-run it yourself.

0%

retrieval hit-rate@5

0%

citation accuracy

0.0s

p50 answer latency

0

chunks · demo repo

// under the hood

Three runtime dependencies on the API. No vector database to operate — vectors persist as rows, search runs in memory. The whole pipeline is readable in an afternoon.

api
Express 4 · Node ≥18 · ESM
llm
Groq · llama-3.3-70b-versatile, streamed
embeddings
Gemini · gemini-embedding-001 · 768d
persistence
node:sqlite → Postgres via DATABASE_URL
retrieval
cosine + symbol/path re-rank (hybrid)
frontend
Next.js 16 · React 19 · Tailwind 4
diagrams
Mermaid 11, rendered client-side
hardening
helmet · per-IP rate limits · graceful shutdown