Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

🌐 Prime Agent Recursive Solver

Python Version License Framework

An autonomous multi-agent logic and puzzle solver powered by the installed Prime Agent's Recursive Language Model (RLM) CLI harness. It demonstrates how a parent agent spawns parallel child subagents programmatically via Python function calls (await rlm(...)), executing parallel sub-task decomposition, constraint validation, and output synthesis directly using the installed Prime Agent harness.

🧩 Problem to be Solved

┌─────────────────────────────────────────────────────────────────────────────┐
│ 📌 Challenge: ARC-AGI 3x3 Grid Matrix Transformation                        │
├─────────────────────────────────────────────────────────────────────────────┤
│ Input Matrix State:                                                         │
│   Row 1: [ 2,  4,  8 ]   ──► Pattern: 2^1, 2^2, 2^3                       │
│   Row 2: [ 3,  9, 27 ]   ──► Pattern: 3^1, 3^2, 3^3                       │
│   Row 3: [ 4, 16,  ? ]   ──► Goal: Deduce Missing Value at Row 3 Col 3    │
├─────────────────────────────────────────────────────────────────────────────┤
│ Target Goal:                                                                │
│   1. Invoke installed Prime Agent CLI harness directly (`wsl prime-agent`)   │
│   2. Deduce mathematical invariant (Base^ColumnIndex)                       │
│   3. Validate constraints (64 mod 4 == 0) and synthesize solution code      │
└─────────────────────────────────────────────────────────────────────────────┘

⚡ Key Highlights

  • Direct Installed Prime Agent Execution: Calls the installed prime-agent CLI harness directly with zero mock, fallback, or dummy logic.
  • Recursive Subagent Spawning (await rlm): Programmatically launches child subagents in parallel to solve complex logic puzzles without rigid JSON schemas.
  • Prompt-as-a-Variable State: Manages conversational history and subagent memory dynamically inside the Python runtime kernel.
  • Single Markdown Output: Generates a single, clean markdown report outputs.md detailing the entire subagent trajectory and solution trace.

🚀 Quick Start & Installation

1. Prerequisites

Ensure Python 3.9+ is installed on your system.

python --version

2. Run the Recursive Multi-Agent Solver

Run the solver directly in your PowerShell or Command Prompt terminal:

python main.py

The solver will execute parallel child agents via the installed prime-agent harness, display a colorful real-time execution hierarchy tree in the terminal, and export the comprehensive solution report to outputs.md.


💻 Official Prime Agent CLI Installation via WSL (Windows)

To install and run the official compiled Prime Agent CLI harness (prime-agent) on Windows via WSL2, execute these commands directly in your PowerShell terminal:

# Step 1: Install Ubuntu distribution for WSL2 (one-time setup if Ubuntu is not installed)
wsl --install -d Ubuntu

# Step 2: Download & Install Prime Agent CLI inside WSL
wsl bash -c "curl -fsSL https://app.primeintellect.ai/prime-agent/install.sh | sh"

# Step 3: Run Prime Agent in current project directory from PowerShell
wsl bash -c "cd '$(wslpath -a \"$PWD\")' && prime-agent"

# Utility: Browse active background daemon agents
wsl bash -c "prime-agent agents"

📁 Repository Structure & Runtime Output

  • main.py - Primary Python script executing subagents directly via the installed Prime Agent CLI harness (wsl prime-agent).
  • outputs.md - Single generated markdown report produced by running main.py, detailing the subagent execution hierarchy, execution latency, and solution trace.
  • .gitignore - Standard ignore rules for temporary build outputs and local environment files.

🏗️ Technical Architecture & Execution Flow

                       +----------------------------+
                       |   Parent Prime Agent (RLM) |
                       +--------------+-------------+
                                      |
                    +-----------------+-----------------+
                    | `wsl prime-agent --prompt ...`    |
                    +-----------------+-----------------+
                                      |
        +-----------------------------+-----------------------------+
        |                             |                             |
        v                             v                             v
+---------------+             +---------------+             +---------------+
| Child Agent 1 |             | Child Agent 2 |             | Child Agent 3 |
| Pattern       |             | Constraint    |             | Code & Logic  |
| Extractor     |             | Validator     |             | Synthesizer   |
+-------+-------+             +-------+-------+             +-------+-------+
        |                             |                             |
        +-----------------------------+-----------------------------+
                                      v
                       +----------------------------+
                       | Final Output Synthesizer   |
                       +--------------+-------------+
                                      |
                                      v
                             +------------------+
                             |    outputs.md    |
                             | (Markdown Trace) |
                             +------------------+

🎯 5 Practical Production Use Cases

  1. ARC-AGI-3 Grid Puzzle Reasoning: Solve complex spatial transformation grid puzzles by running parallel hypothesis-generating child agents.
  2. Automated Microservice API Refactoring: Decompose large monolithic codebases by assigning child subagents to separate module endpoints simultaneously.
  3. Multi-Branch Code Vulnerability Auditing: Audit complex codebases for security edge cases by spawning isolated child agents for static analysis, dependency scanning, and taint tracking.
  4. Algorithmic Math & Matrix Optimization: Decompose high-dimensional matrix constraint problems into parallel integer linear programming subtasks.
  5. Autonomous Competitive Programming Harness: Solve LeetCode Hard and Codeforces competition challenges by orchestrating solver agents, tester agents, and optimizer agents in parallel.

🔮 5 Future Enhancement Features

  1. Daemon Socket RPC Server: Connect the standalone Python harness directly to Prime Agent's background daemon via local Unix sockets.
  2. Direct Agent-to-Agent (A2A) IPC: Enable direct peer-to-peer message queues between child agents without routing through the parent controller.
  3. Dynamic GPU Quantization Switcher: Automatically adjust subagent quantization precision based on available VRAM during parallel bursts.
  4. Automated Rollback Snapshotting: Record state diffs after every puzzle attempt to support instant rollback on subagent hallucination.
  5. Interactive Web Execution Tree: Real-time WebSocket visualizer rendering live subagent telemetry in an interactive web layout.

🏷️ Keywords & SEO

Prime Agent, Prime Intellect, RLM Agent, Recursive Language Model, ARC-AGI-3, Autonomous AI Agent, Multi-Agent Orchestration, IPython REPL Agent, Continual Harness, Ollama Local LLM, qwen2.5-coder, WSL2 AI Setup, Open Source AI Harness


📜 License

MIT License (c) 2026 Prime Intellect Community

About

This Agent Beats AGI? Prime Agent GitHub Tested Locally - Autonomous Recursive Multi-Agent Logic & Puzzle Solver harness inspired by Prime Intellect RLM architecture.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages