Get started

Quox RepoBrain

RepoBrain indexes your repositories once, then gives agents structure-first retrieval: FTS5, a symbol index, and the import graph, returning targeted code with a file:line citation, not a whole file.

Overview

Quox RepoBrain is Quox's code-intelligence engine, shipped as a governed plugin. It indexes your repositories, any git repo, local or remote, and gives agents structure-first retrieval instead of a search box over raw text.

The engine understands three things about your code: what is in it (full-text search), what things are (a symbol index of functions, classes, and definitions), and how it connects (an import graph of every edge between files). A query against RepoBrain returns a handful of targeted snippets, each with a file:line citation, instead of the whole file it lives in.

The query face is called Nucleus. RepoBrain is the product brand and the plugin you enable; Nucleus is what agents actually call, whether that is the repobrain query CLI or the governed API. Internally the plugin keeps the id quox-nucleus, a holdover from before the product had its current name.

Why structure beats grep

Grep and plain text search find strings. They do not know that a function is a function, that two files import each other, or that the answer to "how does auth work here" lives across three files, not one. Ask a plain search tool a structural question and it either returns nothing useful or dumps whole files for an agent to re-read from scratch.

RepoBrain indexes the structure up front:

  • FTS5 full-text search across every indexed file, for queries that are genuinely about content.
  • A symbol index of definitions: functions, classes, exports, so a query for "the auth middleware" finds the definition, not every file that happens to mention the word "auth".
  • An import graph: every import edge between files, so RepoBrain knows how your code connects, not just what each file contains.

The result is retrieval that returns roughly 240 tokens of the right code instead of a 10,000-token file dump, about 42x cheaper per query. Agents cite the file and line the answer came from, rather than guessing or paraphrasing.

When structure-search beats reading files

Reach for RepoBrain instead of having an agent open and read files directly when:

  • You need to know where something is defined, not just where a word appears. A symbol lookup finds the function; grep finds every comment that mentions it too.
  • You need to know what depends on what before changing a shared file, hub, registry, or exported type. The import graph answers "what imports this?" directly.
  • The task spans multiple files and reading each one in full would blow the context budget. A structure-first query returns only the relevant slice of each.
  • You want an agent's answer to be checkable: a file:line citation lets a human or another agent verify the claim in seconds.

Fall back to reading a whole file directly when you already know the exact path and need to see it in full, when the file is small, or when you are about to edit it and need full context regardless of query cost.

The CLI

The primary interface is a single command:

repobrain query "how does the auth middleware work?"

By default it searches the current repo. Two flags extend that:

  • -t <repo>: target a specific repo other than the default, e.g. repobrain query "..." -t quoxflow.
  • -x a,b: search across multiple repos at once, e.g. repobrain query "..." -x quox-dashboard,quoxflow,aee.

Results come back as a short list of snippets, each tagged with its file path, line range, and repo, ready to paste into an agent's context or read directly.

Connecting a repo

A repo is something you connect, not a path you type into a config file. The cockpit's add-repo flow covers both cases:

  • Local repos: point RepoBrain at a path already checked out on the machine it runs on.
  • Remote repos: a GitHub picker lets you choose an organisation and repository directly, without copying a clone URL by hand.

Once connected, RepoBrain indexes the repo in one pass, building the full-text index, the symbol index, and the import graph together. Re-indexing picks up new commits without rebuilding from scratch.

The governed API

Everything the CLI does is also available as a per-org API, so the same structure-first retrieval can be called from a script, a CI job, or another service, not just a terminal. Every request is:

  • Org-scoped: results are limited to the repos your organisation has connected.
  • Provenanced: every snippet returned carries the repo, file, and exact line range it came from.
  • Licence-gated: access to the query API is gated per organisation, like the rest of the platform's governed surfaces.
  • Audited: queries are logged as evidence, so what an agent asked and what it was given back is not just claimed, it is recorded.

Feeding Brain2

RepoBrain is the peer of Brain2, not a competitor to it: RepoBrain reads and maps your code, Brain2 remembers everything else. The bridge between them means your codebase does not stay siloed in a separate tool.

Each indexed file becomes a neuron in Brain2's living graph, and each import edge becomes an axon connecting them, so your code shows up in the same graph as your conversations, your docs, and your team's other connected sources.

That means an agent working from Brain2's automatic context can already be holding a thread from your codebase, not just your notes, and a RepoBrain query can be one of the sources an answer traces back to when it cites its evidence.

Getting started

Enable RepoBrain, connect your first repo (local path or the GitHub picker), and let it index. From the CLI, repobrain query "..." against the default repo is the fastest way to see targeted retrieval in action; add -t or -x once you have more than one repo connected. Agents on the platform can call the same retrieval through the governed API without any extra setup, org-scoped to whatever repos your organisation has connected.