Overview
Kapso uses a modular architecture with pluggable components connected through factories. The system is designed around a central orchestration loop that coordinates experimentation.Component Responsibilities
Kapso (Main API)
The user-facing entry point that provides the four-pillar API:OrchestratorAgent
The central coordinator that manages the solve loop:Pluggable Components
All major components are created via factories and can be swapped via configuration:| Component | Factory | Registered Types |
|---|---|---|
| Search Strategy | SearchStrategyFactory | generic, benchmark_tree_search |
| Knowledge Search | KnowledgeSearchFactory | kg_graph_search, kg_llm_navigation |
| Coding Agent | CodingAgentFactory | aider, gemini, claude_code, openhands |
| Feedback Generator | Uses CodingAgentFactory | Same as coding agents (default: claude_code) |
Configuration Flow
Data Flow
- Problem Handler provides problem context
- Experiment History accessed via MCP tools
- Search Strategy generates and selects solutions
- Experiment Workspace manages git branches
- Coding Agent generates code and runs evaluation
- Developer Agent returns structured JSON with evaluation results
- Feedback Generator validates evaluation and decides stop/continue
- RepoMemory tracks code understanding across experiments
Directory Structure
Key Design Patterns
Factory Pattern
All pluggable components use factories with decorator-based registration:Configuration Modes
Configuration is organized into modes that bundle related settings:Git-Based Experiment Isolation
Each experiment runs on its own git branch, enabling:- Parallel experimentation
- Easy rollback to any state
- Tree-based solution exploration
- RepoMemory inheritance across branches