RepoLore — AI Codebase Knowledge Base
RepoLore scans your entire codebase and generates a beautiful, navigable knowledge base — project overview, architecture docs with computed diagrams, per-module documentation, deep dives, and an onboarding guide — locally, inside VS Code. Your code never leaves your machine unless you choose a cloud AI provider.
Built for the whole development lifecycle: developer documentation, knowledge transfer, onboarding new teammates, and architecture reviews. DeepWiki-style understanding, but for private code, on your machine, with your choice of model.
Highlights
- 🗺️ Whole-codebase understanding — a tree-sitter code graph (files, classes, functions, imports, calls, inheritance) across 10+ languages: TypeScript, JavaScript, Python, Java, Go, C#, Rust, Ruby, PHP, and a regex fallback for everything else.
- 🗂️ The model plans the wiki — before writing anything, RepoLore ranks your code by what actually matters (PageRank over the import graph, fan-in, symbol density, git churn and recency), then proposes the sections, the pages, and the question each page has to answer. You get documentation shaped around the system, not one page per directory.
- 📎 Citations you can click, checked against the code — pages cite exact ranges like
src/core/graph.ts:120-148, and every citation is verified against the live index: unknown files are demoted, ranges past end-of-file are clamped, and each page records a grounding score. Click a citation and land on those lines.
- 📚 Studio reading experience — a modern wiki app inside VS Code:
Ctrl/Cmd+K command palette with ranked full-text search, scrollspy table of contents, reading progress, syntax-highlighted code with copy buttons, GitHub-style callouts, backlinks and related pages, and a previous/next reading path. Pages are plain markdown in .kb/ — commit them, diff them, read them anywhere.
- 🧭 Graph Explorer — an interactive map of your architecture: the whole-codebase dependency graph (ELK-layouted, crossing-minimized), click any module to focus its neighborhood, pan/zoom, and jump straight into its documentation page.
- 🔌 Any AI provider
- GitHub Copilot via the VS Code Language Model API — zero setup if you use Copilot.
- Anthropic (Claude) and OpenAI via your own API key (stored in VS Code Secret Storage, never in settings files). The OpenAI base URL is configurable for Azure OpenAI, OpenRouter, or any compatible gateway.
- Ollama for fully local generation — code and docs never leave your machine.
- 🔄 Living docs — every page records the content hashes of its source files. When code changes, affected pages are flagged stale in the sidebar, status bar, and page banner with one-click regeneration — or turn on
repolore.sync.autoRegenerate and let the wiki heal itself.
- 💬
@kb researches before it answers — ask anything in VS Code Chat and it decomposes the question, searches, then decides its own next step: read a specific line range, walk the call graph from a symbol, or consult the generated wiki — until it can answer with citations. Retrieval searches symbol-aware code chunks, not just symbol names, fusing lexical ⊕ BM25 ⊕ optional vector search with graph expansion and diversification. Research runs on the cheap model tier; only the final answer uses your chosen one.
- 🗂 Documentation templates — Engineering Wiki (with business/tech-stack/data-model deep dives), API Reference, or Executive Brief; switch styles any time and regenerate.
- 📊 Dashboard — repo stats, language mix, code hotspots (the files that are both central and frequently changed), knowledge-health tiles for grounding and coverage, and a live generation console with per-step model/token/cost telemetry and token-budget guardrails.
- 🧬 Optional semantic index —
RepoLore: Build Semantic Index embeds your code once into a compact local vector store (unchanged chunks are skipped on later runs) so retrieval can find code that shares no keywords with your question. Entirely opt-in; free and local with Ollama.
- 🌐 Website export — one command produces a beautiful, self-contained multi-page static site (light/dark, search, diagrams) that runs from
file:// — host on GitHub Pages or any internal portal, air-gap friendly. Or scaffold a ready-to-run React (Docusaurus) docs project.
- 📽 Executive presentation — export a business-level slide deck for leadership with real codebase stats and a real structure diagram. Present in any browser or print to PDF.
- 📐 Real diagrams — dependency maps, module connections, and inheritance diagrams are computed from resolved imports in the code graph with actual counts — never drawn (or hallucinated) by the model.
- 🚀 Guided onboarding — a native Getting Started walkthrough takes new users from install to generated knowledge base in five minutes.
Getting started
- Open your project folder in VS Code.
- Run
RepoLore: Generate Knowledge Base from the Command Palette. The codebase is indexed automatically first.
- Browse the result in the RepoLore sidebar (book icon) or via
RepoLore: Open Knowledge Base.
- Ask questions in Chat with
@kb how does authentication work?
Choosing an AI provider
| Provider |
Setup |
Best for |
| Copilot |
none (uses your Copilot sign-in) |
interactive Q&A, small repos |
| Anthropic / OpenAI |
RepoLore: Set AI Provider API Key… |
bulk generation on large repos |
| Ollama |
run ollama serve locally |
privacy-critical codebases |
By default (auto), bulk generation prefers a direct API (Anthropic → OpenAI → Ollama) and falls back to Copilot. Copilot requests are rate-limited by GitHub and capped at the model's context window, so a direct API key is recommended for large codebases. Change routing with repolore.provider.bulk / repolore.provider.interactive.
Commands
| Command |
What it does |
RepoLore: Generate Knowledge Base |
Index (if needed) + generate all pages |
RepoLore: Open Knowledge Base |
Open the wiki webview |
RepoLore: Rebuild Code Index |
Full re-index of the workspace |
RepoLore: Regenerate Stale Pages |
Regenerate every drifted page |
RepoLore: Set / Clear AI Provider API Key… |
Manage BYOK secrets |
RepoLore: Cancel Generation |
Stop a running generation |
Settings
All settings live under repolore.* — indexing include/exclude globs and size caps, provider selection and models, per-step model rules and token budgets, output directory (default .kb), max module pages, diagrams on/off, drift-watch and auto-regenerate, and embedding-based retrieval (off / openai / ollama). See the Settings UI for descriptions.
How it works
- Index — files matching your include globs (minus excludes and
.gitignore) are parsed with tree-sitter WASM grammars into a code graph: file/class/interface/function/method nodes with imports/contains/inherits/calls edges. The graph persists in extension storage and updates incrementally on save.
- Plan — the graph is ranked by importance (PageRank, fan-in, symbol density, git churn) and the model proposes the wiki's sections and pages, each with the question it must answer and the queries that will answer it. Planning failures fall back to a fixed, deterministic page plan, so generation always completes.
- Generate — each page runs its own retrieval (lexical ⊕ BM25 over code chunks ⊕ optional vectors → rank fusion → graph expansion → diversification), and the evidence goes into the prompt with real line ranges attached. The model may only describe what's in that evidence, and must cite the exact lines.
- Verify — every citation is checked against the live index; bad links are demoted, bad ranges clamped, and the page records a grounding score plus the source files it was genuinely built from.
- Stay in sync — on save, changed files are re-indexed and hashes compared; pages whose real sources drifted get flagged. Regeneration is per-page, so updates are cheap.
Privacy
- Code is sent only to the AI provider you select, only during generation/chat.
- With Ollama, everything stays on your machine.
- API keys are stored in VS Code Secret Storage (OS keychain), never in settings or the repo.
- The extension requires a trusted workspace and has no telemetry.
Development
npm install
npm run build # bundle extension + webview, copy WASM grammars
npm run typecheck
npm test # unit + integration tests (tree-sitter WASM included)
npm run icon # re-render media/icon.png from media/icon.svg
npm run package # produce the .vsix
Press F5 in VS Code to launch the Extension Development Host.
Author
Sitharaj Seenivasan
Issues and feature requests: github.com/sitharaj88/repolore/issues
License
MIT © Sitharaj Seenivasan
| |