Skip to main content

index

System module that indexes workspace files for semantic search. Automatically injected when the filesystem module is present and a workspace is configured. Used internally by the context builder to enhance tool discovery with codebase-aware context.

PropertyValue
Module IDindex
Version1.0.0
Typesystem (auto-injected, hidden from agents)
Dependenciesfastembed, qdrant-client

Role in the Architecture

The index module provides:

  1. Workspace scanning -- incrementally scans source files, extracts content, and builds a searchable index.
  2. Semantic embeddings -- uses FastEmbed (paraphrase-multilingual-MiniLM-L12-v2, 384 dimensions) to embed file content, function signatures, class names, and docstrings.
  3. Relation tracking -- records import/export relationships between files for dependency-aware context retrieval.
  4. Context provision -- when the agent needs context about a file or symbol, the index provides the most relevant entries.

How It Works

At bootstrap, if the filesystem module is present:

  1. The compiler detects execution.workspace (or defaults to the YAML file's directory).
  2. The index module is auto-injected.
  3. _auto_index_workspace() registers the workspace as a source and runs an incremental scan.
  4. The scanned entries are embedded and stored in the in-memory Qdrant index.

The index is used by search_tools in the context builder to find relevant code context. It does NOT replace the filesystem module -- filesystem.find and filesystem.grep always use the real filesystem, not the index.


Actions (7)

These actions are for internal use and are hidden from agents:

ActionDescription
register_sourceRegister a data source for indexing
register_extractorRegister a custom content extractor
scanScan a source and update the index (incremental by default)
querySemantic search across indexed entries
relationsExplore the import/export graph from an entry
contextGet optimal LLM context for a target file or symbol
invalidateRemove entries from the index