ypi  by rawwerks

Recursive coding agent for complex problem decomposition

Created 2 months ago
293 stars

Top 90.2% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This project provides a recursive coding agent, ypi, built upon the Pi coding agent. It enables LLMs to recursively decompose complex problems, analyze large codebases, and generate code through self-delegation, offering an advanced tool for developers and researchers seeking sophisticated AI-assisted coding capabilities.

How It Works

ypi extends the Pi agent by introducing an rlm_query function and a system prompt that guides Pi towards recursive problem-solving. Each recursive call spawns a child Pi process within an isolated jj workspace, ensuring that modifications are safely contained and reviewable. The design emphasizes self-similarity, where each agent depth operates with the same prompt and tools, relying on decomposition rather than specialization. Notably, the system prompt includes the source for rlm_query, allowing the agent to potentially modify its own recursive machinery. Bounded recursion is enforced through multiple guardrails, including depth limits, timeouts, and call counts, ensuring termination.

Quick Start & Requirements

Installation can be done globally via npm install -g ypi, or executed directly using npx ypi or bunx ypi. Alternatively, a manual installation involves cloning the repository, updating submodules, and adding the directory to the PATH. Execution examples include interactive mode (ypi), one-shot commands (ypi "Refactor..."), and specifying different LLM providers/models (ypi --provider anthropic ...). Key dependencies include Node.js/npm/bun for installation methods and the underlying Pi coding agent, which requires its own LLM provider configuration. The jj version control system is utilized for workspace isolation.

Highlighted Details

  • Recursive Decomposition Pattern: Agents are prompted with a "size-first → search → chunk → delegate → combine" strategy applicable at various scales.
  • Isolated Workspaces: Utilizes jj for creating distinct workspaces for each child process, preventing interference with the parent's working copy.
  • Bounded Recursion: Implements strict guardrails including a maximum depth (RLM_MAX_DEPTH=3), timeout (RLM_TIMEOUT=60s), and maximum call count (RLM_MAX_CALLS=20).
  • Cost Management: Includes features for monitoring LLM spend and token usage via the rlm_cost command, with configurable budgets (RLM_BUDGET).
  • Pi Compatibility: Functions as a thin layer over Pi, leveraging its native session handling, extensions, and model/provider configurations by default.

Maintenance & Community

The project structure includes a pi-mono/ Git submodule for the upstream Pi coding agent. Specific details regarding maintainers, community channels (like Discord or Slack), or active sponsorships are not provided in the README.

Licensing & Compatibility

The provided README does not specify a software license. This absence makes it impossible to determine compatibility for commercial use, closed-source linking, or other distribution scenarios without further clarification.

Limitations & Caveats

The recursive nature of the agent implies potential for significant LLM costs, although guardrails are in place to mitigate this. The reliance on jj for version control and workspace management may present a learning curve for users unfamiliar with it. The absence of a specified license is a critical caveat for any adoption decision.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
2
Issues (30d)
0
Star History
43 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems") and Elie Bursztein Elie Bursztein(Cybersecurity Lead at Google DeepMind).

ROMA by sentient-agi

0.1%
5k
A meta-agent framework for building hierarchical multi-agent systems
Created 11 months ago
Updated 2 months ago
Feedback? Help us improve.