Autonomous ML agent with cognitive loop
Project description
ML-Ralph
An autonomous ML agent that thinks like an experienced MLE. It works through a cognitive loop: ORIENT → RESEARCH → HYPOTHESIZE → EXECUTE → ANALYZE → VALIDATE → DECIDE.
Based on Ralph by Geoffrey Huntley.
Requirements
- Claude Code or Codex CLI
- A git repo for your ML project
Install
pip install ml-ralph
Or with uv:
uv tool install ml-ralph
Quick Start
1. Initialize Ralph in your project
ml-ralph init
This creates:
your-project/
├── .ml-ralph/
│ └── RALPH.md # Agent instructions
├── .claude/skills/ml-ralph/ # Claude Code skill
├── .codex/skills/ml-ralph/ # Codex skill
├── CLAUDE.md # Claude instructions
└── AGENTS.md # Agent instructions
2. Create a PRD with Claude Code
Open Claude Code in your project and use the /ml-ralph skill:
/ml-ralph
Ralph will ask clarifying questions to understand your ML problem and create a PRD at .ml-ralph/prd.json.
3. Run the Autonomous Loop
ml-ralph run
Ralph works through the cognitive loop until success criteria are met.
Commands
| Command | Purpose |
|---|---|
ml-ralph init |
Initialize Ralph in current project |
ml-ralph run |
Run autonomous execution loop |
Options
# Use Codex instead of Claude (default: claude)
ml-ralph run --tool codex
# Set max iterations (default: 100)
ml-ralph run --max-iterations 200
# Force overwrite on init
ml-ralph init --force
The Cognitive Loop
ORIENT → RESEARCH → HYPOTHESIZE → EXECUTE → ANALYZE → VALIDATE → DECIDE
↑ │
└─────────────────────────────────────────┘
- ORIENT: Understand the problem, constraints, failure modes
- RESEARCH: Learn from existing knowledge, find SOTA approaches
- HYPOTHESIZE: Form testable bets with expected outcomes
- EXECUTE: Implement minimal changes, run experiments
- ANALYZE: Understand results, examine failures, find patterns
- VALIDATE: Check for leakage, ensure results are trustworthy
- DECIDE: Keep/revert/pivot based on evidence
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ml_ralph-0.3.0.tar.gz.
File metadata
- Download URL: ml_ralph-0.3.0.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbc9a4f1f8749a77fa2a169767e7d9c35e9e865bcbf7b036c5669467e9e01536
|
|
| MD5 |
05f0cf712debf32aac7783190f6492d2
|
|
| BLAKE2b-256 |
9a71c383b1245c2eec1b028359f2fd011719011b8bdc18a4cc1a9cded0bb0faa
|
Provenance
The following attestation bundles were made for ml_ralph-0.3.0.tar.gz:
Publisher:
publish.yml on pentoai/ml-ralph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ml_ralph-0.3.0.tar.gz -
Subject digest:
cbc9a4f1f8749a77fa2a169767e7d9c35e9e865bcbf7b036c5669467e9e01536 - Sigstore transparency entry: 864336562
- Sigstore integration time:
-
Permalink:
pentoai/ml-ralph@b5dc9338d6f76cfd7231f3c729486af32d9992dc -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/pentoai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b5dc9338d6f76cfd7231f3c729486af32d9992dc -
Trigger Event:
release
-
Statement type:
File details
Details for the file ml_ralph-0.3.0-py3-none-any.whl.
File metadata
- Download URL: ml_ralph-0.3.0-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4d9ee910eb946afa763ecce6529baf18f2d8fc6db0d007051e12a73340237c7
|
|
| MD5 |
430c9da2586d68a97da9ec9469ee1349
|
|
| BLAKE2b-256 |
8ad879d6f35c3a3112c28ffaa3de67793f48a5a13eb858db7ace519af958443e
|
Provenance
The following attestation bundles were made for ml_ralph-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on pentoai/ml-ralph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ml_ralph-0.3.0-py3-none-any.whl -
Subject digest:
f4d9ee910eb946afa763ecce6529baf18f2d8fc6db0d007051e12a73340237c7 - Sigstore transparency entry: 864336565
- Sigstore integration time:
-
Permalink:
pentoai/ml-ralph@b5dc9338d6f76cfd7231f3c729486af32d9992dc -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/pentoai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b5dc9338d6f76cfd7231f3c729486af32d9992dc -
Trigger Event:
release
-
Statement type: