Qontextor
The Qontextor agent generates and manages contextual information about the codebase. It operates in two modes: “local” (deterministic) and “AI” (semantic), with powerful querying capabilities.
Dual Modes of Operation
1. Local Mode (Deterministic Analysis):
- Symbol Extraction: Uses Python’s
astmodule to parse code and extract symbols (classes, functions, imports, methods) - Call Graph Analysis: Utilizes
pycg(Python Call Graph) to build dependency maps - Jedi Enhancement: Optional type inference and additional dependency information
- Semantic Enhancement (Complex Mode): Generates embeddings using
sentence-transformersfor similarity searches - All information stored in structured
.q.yamlfiles inqontext.d
2. AI Mode (Semantic Analysis via LLM):
- Uses configured AI provider for context generation
- “Qompresses” file content before sending to reduce tokens
- AI generates YAML structure with symbols, signatures, purposes, dependencies
Scanning & Processing
- Initial Scan (
run_initial_scan): Processes all relevant files inqodeyard - Update Scan (
run_update_scan): Only processes changed files fromconstruQtor - Generates
.q.yamlfiles mirroringqodeyard’s structure
Querying Capabilities
--query <term>: Semantic search using embeddings (requires complex mode)
--verb <pattern>: Find symbols matching verb patterns (e.g., get_.*, create_.*)
--ripple <symbol_name>: Analyze change impact:
- Files where symbol is defined
- Symbols that call this symbol (
called_by) - Symbols this symbol calls (
calls) - Directly impacted files (
depth_1_impact) - Indirectly impacted files (
depth_2_impact)
What’s configurable
config.yaml (under agents.qontextor):
provider(string):'local'(default) or AI provider namemodel(string): AI model if using AI providerlocal_mode(string):'complex'(with embeddings) or'fast'(without)