ANY//DOCS
DEBack to site

Codebase Index

Overview

Codebase Index lets the AI chat search your open project by meaning rather than exact text. Once the index is built, you can ask questions like "where are OPC UA connections opened?" and the assistant finds the most relevant code, ranked by similarity, and answers from it. It works across both PLC code (SCL) and the general-purpose languages in your workspace.

The index is local-first: your code is turned into a searchable form by an embeddings endpoint that you configure — typically a model server running on your own machine — and the result is stored locally. Pointed at a local endpoint, nothing leaves your machine. Codebase Index is a Pro+ / Enterprise feature and stays off until you enable it.

Setup

  1. Open the AnyAutomation settings (Ctrl+,) and select the Codebase Index category (the database icon).
  2. Turn on Enable Indexing.
  3. Enter the Embedding URL — the address of an OpenAI-compatible embeddings endpoint, for example a local model server — and the Embedding Model to use. Add an API Key if your endpoint requires one.
  4. (Optional) Under Storage, choose the Vector Store: LanceDB (a local store, the default, no server needed) or Qdrant (an external server, for larger or shared indexes). For Qdrant, fill in the Qdrant URL and, if needed, the Qdrant API Key.

The Search & Tuning section lets you adjust how many results a search returns and how close a match has to be. The Reranking section is optional: point the Reranker URL at a reranking server (and fill in a Reranker Model / Reranker API Key if it needs them) to re-score results for sharper relevance, or leave it empty to skip reranking. Every setting is saved automatically.

Configuration scope

At the top of the Codebase Index settings page, a Global | Local toggle controls which settings you are editing:

  • Global — applies to every workspace you open.
  • Local — applies only to the current project. Disabled when no folder is open.

The API key and the endpoint addresses always stay global and cannot be overridden per project. A small badge next to each field — DEFAULT, LOCAL, or GLOBAL — shows where the current value comes from, and a reset arrow restores a field to its default.

Enabling indexing in the Global scope indexes every workspace you open; enabling it only in the Local scope indexes just that one project.

Indexing

To build or refresh the index for the open project, run Codebase Index: Index Workspace from the Command Palette (Ctrl+Shift+P), or click the database icon in the chat input box and choose Index Workspace.

When indexing is enabled globally, Studio also indexes each folder you open in the background — you only need to have marked the workspace as trusted. While a background index runs, an Indexing Codebase… spinner appears in the status bar; otherwise the status bar shows a Codebase Index entry you can click for quick actions.

Searching from the AI chat

With the index built, the assistant searches it automatically through the Semantic Code Search tool whenever you ask about your code. You can also reference it explicitly in a message with @semantic_code_search. Each result includes the matched code snippet, its file and line range, and a relevance score, so the assistant answers from your actual code rather than from memory.

Turn on Auto-Context in the Codebase Index settings to have Studio attach the most relevant code to each chat message automatically: as you type, the top matches appear as removable chips above the input, and you can drop any you don't want before sending. Use Auto-Context Max Results to set how many it attaches.

Status and management

  • The Codebase Index status-bar entry, and the chat-input database icon, open a quick menu: Index Workspace, Clear Index, or Open Settings.
  • Codebase Index: Clear Index removes the stored index for the current project.
  • Codebase Index: Show Status opens the same quick menu from the Command Palette.

Notes

  • Codebase Index only indexes a local folder you have open, and background indexing only runs for a workspace you have marked as trusted.
  • If indexing is disabled, or the embedding URL and model are not set, the commands and the chat tool tell you what to configure.
  • The feature requires a Pro+ or Enterprise license.