Overview
TheKapso class is the main entry point for the framework. It provides methods for research, learning, evolving, and deploying solutions.
Constructor
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
config_path | str | src/config.yaml | Path to configuration file |
kg_index | str | None | Path to existing .index file for KG |
Examples
Methods
research()
Run deep web research for a query.Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
objective | str | - | What to research |
mode | str | "both" | Research mode: “idea”, “implementation”, or “both” |
depth | str | "deep" | "light" or "deep" |
Returns
ResearchFindings containing:
ideas: List ofSource.Ideaobjectsimplementations: List ofSource.Implementationobjectsreport: OptionalSource.ResearchReport(if mode includes study)
Example
learn()
Learn from knowledge sources.Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
*sources | Source.* | - | One or more source objects |
wiki_dir | str | "data/wikis" | Wiki directory path |
skip_merge | bool | False | Only extract, don’t merge |
kg_index | str | None | Index path for MCP server |
Returns
PipelineResult with:
sources_processed: Number of sources processedtotal_pages_extracted: Pages extractedcreated: New pages creatededited: Pages merged/edited with existingerrors: List of errors
Example
evolve()
Evolve a solution through experimentation.Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
goal | str | - | High-level objective (include success criteria) |
eval_dir | str | None | Path to user-provided evaluation files (copied to kapso_evaluation/) |
data_dir | str | None | Path to data files (copied to kapso_datasets/) |
initial_repo | str | None | Starting repository - see below for options |
max_iterations | int | 10 | Maximum experiment iterations |
mode | str | None | Config mode (GENERIC, MINIMAL, etc.) |
coding_agent | str | None | Coding agent override |
initial_repo Options
The initial_repo parameter accepts three types of values:
| Value | Behavior |
|---|---|
Local path ("/path/to/repo") | Use existing local repository as starting point |
GitHub URL ("https://github.com/org/repo") | Clone the repository and use as starting point |
| None (default) | Search for relevant workflow via workflow_search(goal). If found, clone workflow’s repo. If not found, create empty repo. |
Returns
SolutionResult with:
goal: Original goalcode_path: Path to generated codeexperiment_logs: List of experiment summariesfinal_feedback:FeedbackResultwith stop decision and scoremetadata: Cost, iterations, final evaluation
Example
deploy()
Deploy a solution as running software.Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
solution | SolutionResult | - | Solution from evolve() |
strategy | DeployStrategy | AUTO | Deployment strategy |
env_vars | Dict[str, str] | None | Environment variables |
coding_agent | str | "claude_code" | Agent for adaptation |
Returns
Software instance with:
run(inputs): Execute with inputsstop(): Stop and cleanupstart(): Restartis_healthy(): Health checklogs(): Get logs
Example
index_kg()
Index knowledge data into the KG.Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
wiki_dir | str | None | Path to wiki directory |
data_path | str | None | Path to JSON data file |
save_to | str | - | Path to save .index file |
search_type | str | None | Override search backend |
force | bool | False | Clear existing data |
Returns
Path to created.index file.