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.
| Property | Value |
|---|---|
| Module ID | index |
| Version | 1.0.0 |
| Type | system (auto-injected, hidden from agents) |
| Dependencies | fastembed, qdrant-client |
Role in the Architecture
The index module provides:
- Workspace scanning -- incrementally scans source files, extracts content, and builds a searchable index.
- Semantic embeddings -- uses FastEmbed (
paraphrase-multilingual-MiniLM-L12-v2, 384 dimensions) to embed file content, function signatures, class names, and docstrings. - Relation tracking -- records import/export relationships between files for dependency-aware context retrieval.
- 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:
- The compiler detects
execution.workspace(or defaults to the YAML file's directory). - The index module is auto-injected.
_auto_index_workspace()registers the workspace as a source and runs an incremental scan.- 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:
| Action | Description |
|---|---|
register_source | Register a data source for indexing |
register_extractor | Register a custom content extractor |
scan | Scan a source and update the index (incremental by default) |
query | Semantic search across indexed entries |
relations | Explore the import/export graph from an entry |
context | Get optimal LLM context for a target file or symbol |
invalidate | Remove entries from the index |