From a repository URL to an answer you can check.
RepoKnit reads a repository, splits it into meaningful pieces of code, and finds the pieces that answer your question. Since an answer can only be as good as the evidence found, the finding gets measured too.
This page describes the intended system. Only the frontend exists today, and each component below says where it stands.
The pipeline
Connect
Fetch a public GitHub repository and record the exact commit, so every citation points at one version of the code.
repo + commit SHA
Parse
Find files, languages, functions, classes and imports. Skip binaries, vendored code and anything that looks like a secret.
symbol-aligned chunks
Embed and index
Embed each chunk and store it in Turbopuffer with its path, symbol and line range.
searchable index
Retrieve
Find the chunks relevant to a question, then answer only from them. Citations are checked after the answer is written.
answer + citations
Evaluate
Run retrieval setups against hand-labelled questions. Metrics appear only where labels exist to compute them.
benchmark runs
Why retrieval matters most
A language model can only reason about the code it's shown. If the function that answers your question ranks just outside the results it receives, the model never sees it. It either says it doesn't know or writes something plausible.
So RepoKnit shows retrieved chunks next to every answer, and Search Lab measures retrieval on its own, separately from how convincing the answer reads.
- 1docs/routing.md
- 2tests/test_routes.py
- 3app/views.py
- 4README.md
- 5app/config.py
- the model sees nothing below this line6app/router.py Router.matchthe answer
System architecture
Requests flow left to right. Indexing runs in the background and never inside an HTTP request. Select a component to see what it does.
FastAPI
PlannedAPI
The authority for validation, access control, quotas and retrieval.
- Authentication and signed anonymous sessions
- Server-side quotas and rate limits (fail closed)
- Creates indexing jobs; never indexes inside a request
- Retrieval endpoints and answer streaming
Calls or writes to
- state
- retrieve
- multi-step
- enqueue
Used by
- typed API
Browser
In progressClient
Where engineers ask questions, read source and compare retrieval runs.
Calls or writes to
- Next.js appHTTPS
Next.js app
In progressFrontend
UI, routing and streaming display. This is the only part built so far.
Calls or writes to
- FastAPItyped API
Used by
- BrowserHTTPS
FastAPI
PlannedAPI
The authority for validation, access control, quotas and retrieval.
Calls or writes to
- PostgreSQLstate
- Turbopufferretrieve
- LangGraphmulti-step
- Job queueenqueue
Used by
- Next.js apptyped API
PostgreSQL
PlannedApplication state
Relational source of truth for everything that is not a vector.
Used by
- FastAPIstate
Turbopuffer
PlannedVector search
Stores embedded code chunks with metadata and serves retrieval queries. Not an application database.
Used by
- FastAPIretrieve
- LangGraphretrieve
- Indexing workerupsert
LangGraph
PlannedOrchestration
Bounded multi-step investigations. Simple questions skip it entirely.
Calls or writes to
- Turbopufferretrieve
- LLM provideranswer
- LangSmithtrace
Used by
- FastAPImulti-step
LLM provider
PlannedAnswer synthesis
Writes answers from supplied evidence only, behind a service interface.
Used by
- LangGraphanswer
LangSmith
OptionalTracing & evals
Traces tool calls and evaluation runs, only when explicitly configured.
Used by
- LangGraphtrace
Job queue
PlannedDurable queue
Decouples indexing from HTTP requests.
Calls or writes to
- Indexing workerconsume
Used by
- FastAPIenqueue
Indexing worker
PlannedBackground worker
Fetches, parses, chunks and embeds a repository at a pinned commit.
Calls or writes to
- GitHubfetch @ SHA
- Embedding modelembed
- Parser / chunkerparse
- Turbopufferupsert
Used by
- Job queueconsume
GitHub
PlannedSource
Public repositories only, fetched at a recorded commit SHA.
Used by
- Indexing workerfetch @ SHA
Parser / chunker
PlannedTree-sitter
Turns files into symbol-aligned chunks with line ranges.
Used by
- Indexing workerparse
Embedding model
PlannedProvider
Embeds chunks at index time and queries at search time.
Used by
- Indexing workerembed
Two stores with different jobs
| Property | PostgreSQL | Turbopuffer |
|---|---|---|
| Holds | Repositories, commits, jobs, usage, benchmark labels and runs | Embedded code chunks with path, symbol and line metadata |
| Queried by | Exact lookups and joins | Similarity search plus metadata filters |
| Source of truth for | Application state | Nothing. It's a retrieval index and can be rebuilt |
Rules the backend will follow
None of these are enforced yet, because the backend doesn't exist yet.
- Repository code is never executed.
- Files are read as text at a pinned commit.
- Citations are checked, not trusted.
- Paths and line ranges are validated against stored chunk metadata after the answer is written.
- Missing metrics stay missing.
- A metric that wasn't measured is shown as unavailable, never as zero.
- The server enforces limits.
- Quotas, rate limits and a global kill switch live in the API, not the browser.
- Public repositories only.
- Nothing is sent to tracing tools without explicit configuration.