Skip to main content

ML-Ralph

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.

Requirements

Install

pip install ml-ralph

Or with uv:

uv tool install ml-ralph

Quick Start

1. Initialize Ralph in your project

ml-ralph init

2. Create a PRD with Claude Code

Open Claude Code and use the /ml-ralph skill:

/ml-ralph

Ralph will ask clarifying questions to understand your ML problem and create a PRD.

3. Run the Autonomous Loop

ml-ralph run

Ralph works through the cognitive loop until success criteria are met.

Project Structure

After running Ralph, your project will have:

your-project/
├── .ml-ralph/
│   ├── RALPH.md           # Agent instructions
│   ├── prd.json           # PRD (the contract)
│   ├── ralph.json         # Execution state
│   ├── backlog.json       # Hypotheses queue
│   ├── log.jsonl          # Thinking log (research, learnings, analysis)
├── .claude/skills/ml-ralph/
├── .codex/skills/ml-ralph/
├── CLAUDE.md
└── AGENTS.md

Commands

Command Purpose
ml-ralph init Initialize Ralph in current project
ml-ralph run Run autonomous execution loop

Options

# Use Claude Code (default)
ml-ralph run --tool claude

# Use OpenAI Codex
ml-ralph run --tool codex

# Codex with custom sandbox mode (default: workspace-write)
ml-ralph run --tool codex --sandbox danger-full-access

# Set max iterations (default: 100)
ml-ralph run --max-iterations 200

# Force overwrite on init
ml-ralph init --force

Codex Sandbox Modes

When using --tool codex, you can control the sandbox policy:

Mode Description
read-only Agent can only read files, not modify
workspace-write Agent can modify files in workspace (default)
danger-full-access Full system access (use with caution)

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

Metadata

Release files for ml-ralph 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ml-ralph 0.4.0
File Size Uploaded
ml_ralph-0.4.0.tar.gz 23.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ml-ralph 0.4.0
File Interpreter ABI Platform
ml_ralph-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.2 kB

Release files / ml_ralph-0.4.0.tar.gz

Download URL ml_ralph-0.4.0.tar.gz
Size 23.6 kB
Tags Source
SHA-256 checksum
How to use checksums
89465ad4cdc21e786542701c4cdf3169a03706225c7068bc0bb610473f02a86d
BLAKE2b-256 checksum
How to use checksums
b8e75e2456279e323e6145633ca44338e96b413a595bad2dc473d602ac68f882
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 28, 2026.

Transparency log

Release files / ml_ralph-0.4.0-py3-none-any.whl

Download URL ml_ralph-0.4.0-py3-none-any.whl
Size 18.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc0715cf2337bbfba96ac24415852d0fe9813e0ae7be50d9e00ed03a0d724402
BLAKE2b-256 checksum
How to use checksums
3566b7bd3dab7eaf93e43e8d53303aae4637c2ad6a06d12f09da1d5cb414eb07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page