Skip to main content

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ml_ralph-0.3.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ml_ralph-0.3.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

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

Hashes for ml_ralph-0.3.0.tar.gz
Algorithm Hash digest
SHA256 cbc9a4f1f8749a77fa2a169767e7d9c35e9e865bcbf7b036c5669467e9e01536
MD5 05f0cf712debf32aac7783190f6492d2
BLAKE2b-256 9a71c383b1245c2eec1b028359f2fd011719011b8bdc18a4cc1a9cded0bb0faa

See more details on using hashes here.

Provenance

The following attestation bundles were made for ml_ralph-0.3.0.tar.gz:

Publisher: publish.yml on pentoai/ml-ralph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for ml_ralph-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4d9ee910eb946afa763ecce6529baf18f2d8fc6db0d007051e12a73340237c7
MD5 430c9da2586d68a97da9ec9469ee1349
BLAKE2b-256 8ad879d6f35c3a3112c28ffaa3de67793f48a5a13eb858db7ace519af958443e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ml_ralph-0.3.0-py3-none-any.whl:

Publisher: publish.yml on pentoai/ml-ralph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page