A local-first web dashboard that combines RAG-powered Q&A, an interactive dependency graph, and search so you can explore any repo without leaving your browser. Clone via Git or inspect GitHub URLs with no clone. Your code and API keys stay on your machine.
What makes it different
- One app, one place: Chat with citations, zoom/pan dependency graph, file tree, code preview, and full-text search live in a single dashboard—no switching between tools.
- Interactive code map: The graph is built from real
import/requirelinks. Filter by folder, switch layouts (radial, grid, by folder), and click nodes to open files. Export the graph as SVG. - RAG + your choice of LLM: Semantic search (pgvector) plus lexical match feed the context; you can use Hugging Face or OpenAI (or retrieval-only). Citations are clickable and open the file at the right line.
- Runs entirely locally: No SaaS, no sending code to third parties. Optional PostgreSQL and API keys for embeddings/LLM; everything else works offline.
- Clone repositories from HTTPS/SSH git URLs.
- Inspect a GitHub repo by URL without using
git clone. - Switch between cloned repos and your workspace repo.
- Ask code questions with line-level citations.
- See dominant languages and main code files.
- View a visual dependency graph.
- Optional LLM answers via Hugging Face or OpenAI.
- Full-text search over file paths and content; click a result to open the file at the matching line.
- Line numbers in the code preview; click a citation in chat to jump to that file and line.
- Export the dependency graph as SVG and the chat as Markdown.
- Light/dark theme toggle and keyboard shortcuts (
/to focus chat,Escapeto exit fullscreen). - Rate limiting on chat to avoid runaway API usage.
- Node.js 20+
- PostgreSQL 15+ (optional but recommended)
- Git (only needed for clone mode; URL inspect mode does not require git)
If you forked or renamed the repo, change the clone URL below:
git clone https://github.com/iulia-cyber/RepoSensei.git
cd RepoSensei
cp .env.example .env
# Edit .env and set PGPASSWORD (and optional API keys).
npm install && npm run setup
npm run devThen open http://localhost:4173 (or the port printed in the terminal).
Windows:
.\install-local.cmdmacOS/Linux:
chmod +x ./install-local.sh
./install-local.shManual install (all platforms):
npm install --cache .npm-cache
npm run setup- Open a terminal in this folder.
- Start the app:
node server.jsWindows shortcut:
.\run-localhost.cmdIf the page does not open, run diagnostics:
.\diagnose-localhost.cmd- Open your browser at:
http://127.0.0.1:4173
http://localhost:4173
If port 4173 is already occupied, Repo-Sensei automatically tries the next free ports (4174, 4175, ...).
- Local web dashboard with a modern UI.
POST /api/repo/clonefor cloning a repo from URL/SSH.POST /api/repo/inspect-urlto inspect a GitHub URL snapshot (no clone).GET /api/reposandPOST /api/repo/usefor repository switching.GET /api/repo/summaryfor language stats + main files.POST /api/chatendpoint for Q&A with line-level citations.- Vector-embedding RAG with PostgreSQL
pgvector(semantic chunk retrieval). GET /api/graphendpoint that builds a visual graph from local import/require links.GET /api/metaendpoint showing index and graph stats.GET /api/modelsandPOST /api/model/configfor HF/OpenAI/embedding model setup.POST /api/embeddings/syncto force embedding sync.- PostgreSQL persistence for indexed files, graph edges, and chat history.
GET /api/db-statusendpoint with DB status, snapshot stats, and recent chats.
If you want npm scripts instead of a direct node command:
npm.cmd run devQuality checks:
npm.cmd run checkIndividual commands:
npm run lintnpm run typechecknpm run test
Copy .env.example to .env and set your PostgreSQL credentials:
PGHOST,PGPORT,PGUSER,PGPASSWORD,PGDATABASE
Do not commit .env; it is listed in .gitignore.
In .env:
HF_MODEL=owner/modelHF_API_KEY=your_tokenHF_TIMEOUT_MS=25000
You can also set/update these from the UI via the model config form.
In .env:
OPENAI_API_KEY=...OPENAI_CHAT_MODEL=gpt-4o-miniOPENAI_EMBED_MODEL=text-embedding-3-smallOPENAI_EMBED_DIMENSIONS=1536
Embeddings config:
EMBEDDINGS_ENABLED=1EMBEDDING_CHUNK_LINES=120EMBEDDING_CHUNK_OVERLAP=24EMBEDDING_MAX_CHUNKS_PER_SYNC=1200
This is used for semantic retrieval (pgvector) and OpenAI fallback when Hugging Face is unavailable.
In the UI, use Inspect URL and paste:
https://github.com/owner/repohttps://github.com/owner/repo.git
Optional .env settings:
GITHUB_TOKEN=(recommended for higher rate limits / private repos)GITHUB_SNAPSHOT_MAX_FILES=220GITHUB_SNAPSHOT_MAX_BYTES=18000000GITHUB_SNAPSHOT_CONCURRENCY=8
- Do not commit
.env. It is listed in.gitignore. Use.env.exampleas a template and set your own PostgreSQL password and API keys locally. - Bind to localhost only. Keep
HOST=orHOST=127.0.0.1in.envso the server is not exposed on your network. Do not bind to0.0.0.0unless you add authentication. - The app runs locally; repository data and API keys stay on your machine unless you use optional GitHub URL inspect (which fetches file listings and content via GitHub API).
We welcome issues and pull requests. See CONTRIBUTING.md for how to report bugs, suggest features, and submit changes.
- Create a new repository on GitHub (do not initialize with a README if you already have one).
- Update the
repositoryURL inpackage.jsonto your repo (e.g.https://github.com/iulia-cyber/RepoSensei.git). - Ensure
.envis never committed (it is in.gitignore). Only.env.exampleshould be in the repo.
MIT. See LICENSE.