Hysen Labs
Framework
Leeroo-AI/kapso avatar
Leeroo-AI

kapso

A Knowledge-grounded framework for Autonomous ML/AI Program Synthesis and Optimization

97 stars8 forksPythonMIT
DEEP OPEN-SOURCE ANALYSIS

Kapso is a knowledge-grounded framework for autonomous ML program synthesis

A Python framework that combines iterative experimentation with a best-practices knowledge base to design, refine, and deploy ML and AI code.

How Kapso works

Kapso is a knowledge grounded framework for autonomous AI and ML program synthesis and optimization. The README describes it as combining iterative experimentation with a knowledge base of best practices and tricks to discover improvements in ML and AI code. It automates the cycle of designing, testing, and refining algorithms, and eventually adapts the optimized solution for deployment on infrastructure the user chooses. The framework is built around four pillars, each exposed as a method. Evolve, called with .evolve(), runs iterative experiments to build software for a goal, using tree search, coding agents, and knowledge graph context to generate and refine solutions. Learn, called with .learn(), ingests knowledge from repositories, past solutions, or research results, and extracts patterns and best practices into the knowledge graph. Research, called with .research(), runs deep web research to gather ideas and implementation references, and returns structured findings that can feed the knowledge base or serve as context for evolving solutions. Deploy, called with .deploy(), turns a solution into running software, with support for local execution, Docker containers, or cloud platforms such as Modal. The four pillars are presented as a single loop rather than separate tools, so a user can move from gathering domain techniques, to learning from past work, to building a candidate solution, to shipping it.

Installing and using it

The recommended install is from PyPI with pip install leeroo-kapso. For development, or to access the wiki knowledge data, the README gives a from source path: clone the repository, pull Git LFS files for the wiki knowledge data, create a conda environment with Python 3.12, activate it, and install in editable mode. An optional integration connects Kapso to Leeroopedia, a curated ML and AI knowledge base, by installing a separate package and setting an API token in an environment file. The basic usage example in the README shows constructing a Kapso object, optionally with a knowledge graph index, then calling research on a topic such as RLHF and DPO fine-tuning, passing the findings into learn together with a source repository, then calling evolve with a goal and data directory, and finally calling deploy with a strategy such as Modal. The example goal is to fine-tune Llama-3.1-8B for legal clause risk classification with a target F1 above 0.85. The README also links example workflows covering CUDA optimization, PyTorch optimization, ML model development, prompt engineering, and an agentic scaffold. The documented API surfaces are the four pillar methods plus a Source helper for repositories, ideas, and implementations, and a DeployStrategy enum for the deployment target.

Benchmarks the project reports

The README lists several benchmark results that the project claims for itself, and these are reported as the project's own statements rather than independently verified here. In the news section, Kapso is said to have earned the IOAI Grand Master Trophy at IOAI 2026, an International Olympiad in AI, where it competed fully autonomously in the AI Model Track and ranked top three among all AI system participants. The README says Kapso beats the best foundation model on RelBench, Stanford's benchmark for predictive ML over enterprise data, passing KumoRFM-v2 in outcome prediction and forecasting and the best reported results in recommendations, with results said to live on the official RelBench leaderboard. It also states Kapso reached number one on MLE-Bench among open-source systems on Kaggle ML competitions, and number one on ALE-Bench for long horizon algorithmic discovery problems. A technical report is linked as an arXiv paper. The supported benchmarks table lists MLE-Bench for Kaggle ML competitions across tabular, image, text, and audio problems; ALE-Bench for AtCoder algorithmic optimization in C++; RelBench for relational deep learning over multi-table temporal databases with 66 tasks; and IOAI 2026 for six expert designed ML contest tasks across vision, language, and optimization solved fully autonomously on single GPU hardware. The citation entry names the authors and the 2026 arXiv identifier.

Editorial conclusion

The repository is published under the MIT license and its most recent commit was recorded on 2026-08-26. The source lives at https://github.com/Leeroo-AI/kapso.

DEEP OPEN-SOURCE ANALYSIS

Official sources

Community notes

Community notes