Skip to main content
Kapso is a set of pluggable components wired together by factories around a central orchestration loop. Swapping a coding agent, a search strategy or a knowledge backend is a config change, not a code change.

Component responsibilities

Kapso (main API)

The user-facing entry point that provides the four-pillar API:

OrchestratorAgent

The central coordinator. Each iteration it computes budget progress, hands the strategy the problem statement plus the previous iteration’s feedback, runs one search iteration, and stops when the judge’s verdict says the goal is met (and the handler’s task semantics honor that vote) or a budget dial reaches 100%. The faithful loop sketch lives on the orchestrator page; solve() returns a SolveResult with the deliverable experiment and the stop reason.

Pluggable components

All major components are created via factories and can be swapped via configuration:

Configuration flow

Data flow

  1. Problem Handler provides problem context
  2. Experiment History accessed via MCP tools
  3. Search Strategy generates and selects solutions
  4. Experiment Workspace manages git branches
  5. Coding Agent generates code and runs evaluation
  6. Coding agent ends its session with XML result tags (summary, evaluation path and output, score)
  7. Feedback Generator validates evaluation and decides stop/continue
  8. 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
  • Parent/child lineage across candidates
  • RepoMemory inheritance across branches

Execution Flow

Step-by-step execution process

Feedback Generator

How evaluation is validated and feedback generated

Knowledge graph

How knowledge is acquired and used

Components

Deep dive into core components
Related pages: Execution Flow · Feedback Generator · Knowledge graph · Components Kapso is an open-source framework by Leeroo that builds software toward measurable goals through experiment campaigns. Source code: github.com/Leeroo-AI/kapso · Install: pip install leeroo-kapso · Every page as plain text: llms.txt.