High-Level Architecture
Core Classes
Runner (skydiscover/runner.py:24)
Top-level entry point that manages the complete discovery run:
- Load configuration and initial program
- Create database and discovery controller
- Run the discovery loop with checkpointing
- Manage monitor server and human feedback
- Save best program and generate reports
DiscoveryController (skydiscover/search/default_discovery_controller.py)
Executes the core sample → prompt → LLM → evaluate → add loop:
_run_iteration):
Advanced algorithms can override
run_discovery() to implement:
- Acceptance gating (GEPA)
- Island migration (AdaEvolve)
- Strategy co-evolution (EvoX)
ProgramDatabase (skydiscover/search/base_database.py:75)
Abstract base class for program storage and sampling:
Database Helper Methods
Database Helper Methods
| Method | Purpose |
|---|---|
get_best_program() | Return highest-scoring program |
get_top_programs(n) | Return top N by score |
_update_best_program(program) | Update best tracking (call in add()) |
save(path, iteration) | Checkpoint to disk |
load(path) | Restore from checkpoint |
get_statistics() | Return population stats for prompts |
log_prompt(...) | Store prompt and response for debugging |
Evaluator (skydiscover/evaluation/evaluator.py:21)
Runs user-provided evaluation functions with timeout and retry:
- Stage 1: Fast validation (e.g., syntax check, basic tests)
- Threshold Check: Only proceed if stage 1 score exceeds threshold
- Stage 2: Full evaluation (e.g., comprehensive benchmarks)
evaluate_stage1() and evaluate_stage2() in your evaluator file.
Data Flow
Program Object
TheProgram dataclass (skydiscover/search/base_database.py:23) carries all information about a candidate:
Evaluation Result
The evaluator returns metrics and optional artifacts:combined_score: Primary optimization target (required)- Any additional numeric metrics (e.g.,
accuracy,latency,cost)
- Error messages or debugging info
- Textual feedback injected into next LLM prompt
- Test results or performance breakdowns
Configuration
SkyDiscover uses a typed configuration system:Registry System
Search algorithms are registered at import time inskydiscover/search/route.py:36:
--search flag maps to these registrations at runtime.
Checkpointing
Checkpoints save full state for resumption:Monitoring
The optional monitor provides real-time visibility:http://localhost:8080/ during runs.
Extension Points
Custom Search Algorithm
Subclass
See
ProgramDatabase and implement add() + sample()See
skydiscover/search/README.md:17Custom Controller
Subclass
See
DiscoveryController and override run_discovery()See
skydiscover/search/README.md:80Custom Context Builder
Control prompt construction logic
See
See
skydiscover/context_builder/README.mdCustom Evaluator
Define
See Evaluators
evaluate(program_path) functionSee Evaluators
Related
Search Algorithms
Learn about available algorithms
Evaluators
Write effective evaluation functions