[PR #16] [CLOSED] feat: Self-improvement runner - AI improving AI #91

Closed
opened 2026-02-27 10:22:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mikeyobrien/ralph-orchestrator/pull/16
Author: @krzemienski
Created: 1/2/2026
Status: Closed

Base: mainHead: feat/self-improvement-runner


📝 Commits (7)

  • c366b52 chore: add Claude Flow and Swarm tooling directories to gitignore
  • 546d9e9 Enhance onboarding: MCP ecosystem integration & agent-assisted analysis
  • 57a3b5c refactor(self-improve): Pure-Python runner using SDK directly
  • b596c09 feat(self-improve): Add web UI and direct prompt file support
  • 67ce18f feat(self-improve): Add full RalphConfig CLI params support
  • 2b06e94 refactor(self-improve): Remove predefined features, require prompt file
  • e317c32 fix(web): Enable auth for self-improve web UI

📊 Changes

7 files changed (+1566 additions, -2 deletions)

View changed files

📝 .gitignore (+5 -0)
examples/ralph-self-improvement.yml (+58 -0)
examples/run_self_improvement.py (+267 -0)
prompts/ONBOARDING_PROMPT.md (+820 -0)
📝 ralph.yml (+19 -1)
scripts/self_improve.py (+395 -0)
📝 tests/test_acp_client.py (+2 -1)

📄 Description

Summary

This PR adds a self-improvement runner that enables Ralph to enhance itself using its own Python SDK.

What's Included

  • scripts/self_improve.py - Pure Python runner using Ralph's API directly (no subprocess CLI calls)
  • examples/ralph-self-improvement.yml - Example configuration for self-improvement tasks

Usage

# Run with a prompt file
python scripts/self_improve.py -P prompts/MY_FEATURE_PROMPT.md

# With web UI monitoring
python scripts/self_improve.py -P prompts/PROMPT.md --with-web-ui

# With custom limits
python scripts/self_improve.py -P prompts/PROMPT.md --max-cost 50 --max-iterations 50

# Check status of predefined features
python scripts/self_improve.py --status

Background: Why This Pattern?

This follows the architecture described in Anthropic's Effective Harnesses for Long-Running Agents - the blog post that introduced Ralph's foundational patterns:

"We developed a two-fold solution: an initializer agent that sets up the environment on the first run, and a coding agent that is tasked with making incremental progress in every session, while leaving clear artifacts for the next session."

Ralph implements this pattern, and now Ralph can use it to improve itself:

  1. Write a prompt describing the feature you want
  2. Run self-improvement with that prompt
  3. Ralph makes incremental progress using proper SDK patterns, leaving clean artifacts

Key Features

  • Inherits user's Claude Code settings - MCP servers, CLAUDE.md, all your tools are available
  • Full parameter control - Context window (200k default), thresholds, costs, all exposed via CLI
  • Web UI integration - Real-time monitoring of self-improvement progress
  • Uses RalphConfig - Proper SDK usage, not subprocess hacks

Next Steps

Opening GitHub issues for proposed features (validation, TUI, onboarding) to get community feedback before running the prompts. This way we can iterate on the approach together.


Been watching a Simpsons marathon while working on this - that scene where Homer tries to improve his car with a crayon up his nose feels relevant to AI self-improvement somehow. 🖍️

Huge appreciation for this project and the community. The patterns from that Anthropic engineering post are genuinely exciting - AI making incremental progress on complex projects is the future.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mikeyobrien/ralph-orchestrator/pull/16 **Author:** [@krzemienski](https://github.com/krzemienski) **Created:** 1/2/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/self-improvement-runner` --- ### 📝 Commits (7) - [`c366b52`](https://github.com/mikeyobrien/ralph-orchestrator/commit/c366b52e9ce79c9ef74aa8fde5e676f21865a945) chore: add Claude Flow and Swarm tooling directories to gitignore - [`546d9e9`](https://github.com/mikeyobrien/ralph-orchestrator/commit/546d9e989f6dec93a60c7e64ad19fe7b2ce3119d) Enhance onboarding: MCP ecosystem integration & agent-assisted analysis - [`57a3b5c`](https://github.com/mikeyobrien/ralph-orchestrator/commit/57a3b5c4759517189e1e3ab556f53290845b14d6) refactor(self-improve): Pure-Python runner using SDK directly - [`b596c09`](https://github.com/mikeyobrien/ralph-orchestrator/commit/b596c09a10670949f97d908d7e3e95ed5a9e935a) feat(self-improve): Add web UI and direct prompt file support - [`67ce18f`](https://github.com/mikeyobrien/ralph-orchestrator/commit/67ce18f3c5539b2908d20c498309cc6d77759ed2) feat(self-improve): Add full RalphConfig CLI params support - [`2b06e94`](https://github.com/mikeyobrien/ralph-orchestrator/commit/2b06e944019c3791469cb1d7fea04f77d0da8f20) refactor(self-improve): Remove predefined features, require prompt file - [`e317c32`](https://github.com/mikeyobrien/ralph-orchestrator/commit/e317c32066fa17394874eceb84abff6a42bc7a9a) fix(web): Enable auth for self-improve web UI ### 📊 Changes **7 files changed** (+1566 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+5 -0) ➕ `examples/ralph-self-improvement.yml` (+58 -0) ➕ `examples/run_self_improvement.py` (+267 -0) ➕ `prompts/ONBOARDING_PROMPT.md` (+820 -0) 📝 `ralph.yml` (+19 -1) ➕ `scripts/self_improve.py` (+395 -0) 📝 `tests/test_acp_client.py` (+2 -1) </details> ### 📄 Description ## Summary This PR adds a self-improvement runner that enables Ralph to enhance itself using its own Python SDK. ### What's Included - `scripts/self_improve.py` - Pure Python runner using Ralph's API directly (no subprocess CLI calls) - `examples/ralph-self-improvement.yml` - Example configuration for self-improvement tasks ### Usage ```bash # Run with a prompt file python scripts/self_improve.py -P prompts/MY_FEATURE_PROMPT.md # With web UI monitoring python scripts/self_improve.py -P prompts/PROMPT.md --with-web-ui # With custom limits python scripts/self_improve.py -P prompts/PROMPT.md --max-cost 50 --max-iterations 50 # Check status of predefined features python scripts/self_improve.py --status ``` ### Background: Why This Pattern? This follows the architecture described in Anthropic's [Effective Harnesses for Long-Running Agents](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents) - the blog post that introduced Ralph's foundational patterns: > "We developed a two-fold solution: an **initializer agent** that sets up the environment on the first run, and a **coding agent** that is tasked with making incremental progress in every session, while leaving clear artifacts for the next session." Ralph implements this pattern, and now Ralph can use it to improve itself: 1. **Write a prompt** describing the feature you want 2. **Run self-improvement** with that prompt 3. **Ralph makes incremental progress** using proper SDK patterns, leaving clean artifacts ### Key Features - **Inherits user's Claude Code settings** - MCP servers, CLAUDE.md, all your tools are available - **Full parameter control** - Context window (200k default), thresholds, costs, all exposed via CLI - **Web UI integration** - Real-time monitoring of self-improvement progress - **Uses RalphConfig** - Proper SDK usage, not subprocess hacks ### Next Steps Opening GitHub issues for proposed features (validation, TUI, onboarding) to get community feedback before running the prompts. This way we can iterate on the approach together. --- *Been watching a Simpsons marathon while working on this - that scene where Homer tries to improve his car with a crayon up his nose feels relevant to AI self-improvement somehow. 🖍️* *Huge appreciation for this project and the community. The patterns from that Anthropic engineering post are genuinely exciting - AI making incremental progress on complex projects is the future.* --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 10:22:11 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ralph-orchestrator#91
No description provided.