How it works

From URL to answer

RepoPilot runs a fully server-side pipeline: fetch, parse, map, and answer. Here is exactly what happens after you paste a repository link.

01

Paste a repository URL

You enter a public URL such as https://github.com/vercel/swr. RepoPilot validates it against an allowlist of public git hosts (GitHub, GitLab, Bitbucket, Codeberg) before anything is fetched.

02

Fetch the repository as a tarball

Instead of a git clone, RepoPilot downloads a single archive of the default branch from the host’s codeload endpoint. This needs no git binary at runtime — which is why analysis works on serverless runtimes — and is faster for large repositories because only one request is made.

03

Extract and index the file tree

The archive is extracted into an ephemeral temporary directory and walked to build a browsable file tree. Directories are collapsible, and very deep or wide folders are capped (250 items per folder, depth 8) to keep the UI fast.

04

Parse source with a real AST

Supported languages (.ts, .js, .tsx, .jsx, .py, .java, .go, .rs) are parsed with @babel/parser. Import and export statements become real dependency edges — RepoPilot knows exactly what imports what, not just what the folders look like.

05

Build the architecture graph

The dependency edges are clustered into modules and rendered as a Mermaid flowchart. The result is an architecture diagram you can read at a glance: entry points, key modules, and how they connect.

06

Summarize the repository

RepoPilot computes a summary — total files, languages, entry points, key modules, and an overall complexity rating — shown at the top of the overview along with clickable file previews.

07

Chat with file-level AI context

When you ask a question, the AI receives the system prompt describing the repository, a token-limited context of the file tree and dependency map, and the source of the file you currently have selected. It streams its answer back to you.

Built for big repositories

Large monorepos can be expensive to analyze. RepoPilot keeps them responsive with a few deliberate limits:

  • Single-request fetch. The default branch is downloaded as one archive — no history, no extra branches.
  • Concurrent parsing. Dependency extraction runs across multiple workers (default 16).
  • Parse capping. Deep dependency edges are only built for the first 3,000 files by default; every file remains browsable regardless.
  • 5-minute route budget. Serverless functions get up to 300 seconds for analysis.
On free (Hobby) Vercel deployments, function time is clamped to 60 seconds. Most repositories — including large ones like vercel/next.js (~22k files) — finish well inside that window.

Under the hood

Fetch

Host codeload endpoints: GitHub codeload.github.com, GitLab archive URLs, Bitbucket /get/, Codeberg archive URLs.

Parsing

@babel/parser and @babel/traverse build ASTs and extract import/export relationships.

Graph

Dependency edges are clustered into modules and rendered as a Mermaid flowchart in the browser.

AI

The Vercel AI SDK + OpenRouter stream answers using a token-limited context builder that injects the repository structure and the selected file.

Ephemeral by design

Extracted repositories live in os.tmpdir(). Stale copies older than one hour are pruned on the next analysis, and nothing is persisted to a database. The pipeline is read-only: source code is parsed and read, never executed.