Codebase search
Codebase search is how Ingot's agent finds the right code in a project of any size before it reads or changes anything. It ranks code by meaning, by declarations, by exact text and by file names, keeps the result inside a token budget, and shows you which files and lines it used. It works the same in a single package, a monorepo, a React Native app without a src folder, a Flutter app that keeps its code in lib/, or a Python backend next to a mobile client.
Ask with @codebase
Type @codebase anywhere in a chat message:
@codebase where do we refresh the session token after a 401?
Before the agent starts, Ingot searches the index for your message and adds the best matching snippets to it. Chips under your message name each file and line range that was added, so you can see exactly what the agent was given. Click a chip to open the file at those lines. One search per message: follow-up rounds of the same run reuse it.
The agent can also search on its own with the codebase_search tool, for example when a task says "fix the price rounding" without naming a file.
What a search combines
| Source | Finds | Example |
|---|---|---|
| Meaning (vectors) | code that does what you describe, even with other words | "where are prices rounded" → roundPrice |
| Exact text (BM25) | files that use the words of your question most, rare words weighted higher | "invoice total amount" |
| Declarations | functions, classes, methods and types named like the query, in TypeScript/JavaScript, Python, Go, Java, Rust, PHP and Ruby | CartService.total |
| Exact identifiers | lines that contain a name from the question (ripgrep) | refreshToken |
| File names | files whose path matches | billing/invoice.ts |
| Open files | the files you have open or just edited, when they fit the question |
Each source ranks on its own and the lists are merged, so a file found by several sources rises to the top. Every result says which sources found it and which declaration it belongs to:
1. auth/session.ts:12-30 (score 0.91, refreshSession, symbol+semantic+lexical)
Without embeddings
When the embedding provider fails (no network, quota reached, provider down), search keeps working on exact text, declarations, identifiers and file names. The status bar shows Index ready (text only) and the reason in its tooltip; results say "embeddings unavailable". Missing vectors are computed on a later pass, once the provider answers again. On our test project the right file was still in the top 5 for every question with no embeddings at all.
Embeddings
| Provider | Where code goes | Cost |
|---|---|---|
local (default) | stays on your computer | free |
ollama | your local Ollama server | free |
gateway | Ingot's model gateway when you are signed in (uses your plan's AI), otherwise OpenAI with your own key from Settings › Models | per token |
With gateway, snippets of your code are sent to the provider to compute embeddings. Embeddings are cached by content, so only new or changed code is embedded again, and switching branches back costs nothing.
Project map
At the start of every task the agent also gets a short project map: languages, frameworks, the project's packages, entry points, build and test commands, and the most imported files. Packages come from manifests at any depth (package.json, pyproject.toml, go.mod, Cargo.toml, pubspec.yaml, Gradle, Podfile, .csproj), so a monorepo lists each app and library with its framework. See Project map.
Find a declaration
The agent's find_symbol tool asks the language servers, the index's declaration table and a text search at once, so it answers quickly even in languages without a running language server (Agent code tools).
What is indexed
The index follows your project's own rules, whatever its layout:
- every
.gitignoreand.ingot/ignore(and existing editor ignore files) applies to its own folder and below (nested ones in a monorepo too); - dependency and cache folders are skipped everywhere (
node_modules,.venv,Pods,.gradle,vendor,dist, ...); - a folder named like build output (
lib,build,out,target,obj,bin) is skipped only when a manifest next to it says it is output (a tsconfigoutDir, Cargo, Gradle, Xcode, Flutter, .NET). Otherwise it is source: Flutter and Ruby keep their code inlib/; - secrets (
.env*, keys), binaries and minified files are never indexed.
Up to 50,000 files by default (setting below). On a 50,000-file project the first index took about 1.5 minutes on a busy 2-core machine and 51 MB on disk; later changes are picked up in well under a second.
Settings
| Setting | Default | Effect |
|---|---|---|
ingot.index.enabled | true | build and use the index |
ingot.index.hybridSearch | true | combine all sources; off: vectors only |
ingot.chat.codebaseMention | true | @codebase in a message adds code to it |
ingot.chat.codebaseMention.tokenBudget | 3000 | most tokens @codebase adds (the best match always fits) |
ingot.index.maxFiles | 50000 | most files the index reads |
ingot.index.embeddingProvider | local | local, ollama or gateway |
ingot.index.ollamaModel | nomic-embed-text | the Ollama model when the provider is ollama |
ingot.agent.repoMap.enabled | true | give the agent the project map |
They are under Settings › Agent tools › Codebase search, and Codebase search can be turned on or off in Settings › Features.
Limits
@codebasereads the message it is in; it does not search again in later rounds of the same run.- The local embedder matches words, not meaning in other languages; use
ollamaorgatewayfor that. - Very large files (over 256 KB) and files with very long lines are left out.