Basic Concepts
HyperFlow is a self-improving agent framework. Instead of manually tuning an AI agent, you let another AI agent do it automatically.
The core idea comes from evolutionary computation and Quality-Diversity (QD) algorithms: maintain an archive of agent versions, evaluate each one, and use the best-performing versions as starting points for further improvement.
The Two Agents
TaskAgent ? The Worker
The TaskAgent serves as the problem solver for domain-specific tasks. It receives a formatted prompt, optionally uses tools, and returns a prediction.
- Input: A task description.
- Output: A prediction.
- Tools: Domain-specific, optional.
MetaAgent ? The Improver
The MetaAgent's job is to make the TaskAgent better. It acts as the "mutation operator". It reads past evaluation results, identifies failures, and edits source code (prompts, logic, tools) to fix them.
- Input: Repo path + eval results path + parent score
- Output: Modified source code on disk (patches/diffs)
- Tools:
bash(run shell commands) +editor(view/edit files) ? built-in
The Evolutionary Loop
The evolutionary loop (run_generate_loop) is the heart of the system. It runs multiple generations, each improving on a previous one.
The Archive
The archive is the central data structure stored as a JSON Lines (JSONL) file that records the history of all generations. It serves as a versioned record of evolutionary improvement, acting as a family tree where different generations can branch from different original parent versions.