Skip to main content

Parallel multi-agent pipeline for code analysis and transformation.

Project description

parallel-agents

A parallel multi-agent pipeline for code analysis and transformation, powered by Claude.

Fan out code analysis to 8 specialist AI agents running concurrently, then merge results into a unified report with patches, risk assessments, and PR summaries.

Architecture

User Task / GitHub Issue / Repo
  |
Planner Agent (analyzes repo, creates task plan)
  |
Task Splitter (dependency resolution, batch grouping)
  |
Parallel Workers (asyncio fan-out):
  security, test, perf, devops, arch, docs, code, review
  |
Evidence Store (JSON / SQLite)
  |
Judge Agent (merge, resolve conflicts, produce patch)
  |
Final Output (patch + PR summary + risk report)

Installation

From PyPI

pip install parallel-agents
# or with pipx for isolated CLI
pipx install parallel-agents

From npm (wrapper)

npx parallel-agents run --repo ./my-project "Fix security issues"

Standalone binary

Download from GitHub Releases - no Python required.

First Run Checklist

  1. Install package with pip install parallel-agents.
  2. Install Claude Code CLI and complete authentication.
  3. If using GitHub issue URLs, install GitHub CLI and run gh auth login.
  4. Run parallel-agents workers to verify worker config.
  5. Run parallel-agents run --repo ./my-project "Review for security and quality issues".

Quick Start

# Analyze a local repo
parallel-agents run --repo ./my-project "Fix security issues and improve code quality"

# From a GitHub issue
parallel-agents run "https://github.com/org/repo/issues/42" --repo ./local-clone

# Select specific workers
parallel-agents run --workers security,code,review "Refactor the auth module"

# Use SQLite evidence store
parallel-agents run --store sqlite --repo ./project "Add input validation"

# Output as JSON or patch
parallel-agents run --output json --repo ./project "Fix bugs"
parallel-agents run --output patch --repo ./project "Fix bugs" > fix.patch

CLI Commands

Command Description
parallel-agents run <task> Run the pipeline
parallel-agents workers List available workers
parallel-agents show <run-id> View results of a previous run
parallel-agents history List all previous runs
parallel-agents init Generate default configuration

Run Options

Flag Description
--repo, -r Path to repository
--workers, -w Comma-separated workers to enable
--disable-workers, -d Comma-separated workers to disable
--output, -o Output format: rich, json, patch
--model, -m Override model for all agents
--permission-mode Override permission mode: default, acceptEdits, plan, bypassPermissions
--store, -s Evidence store: file or sqlite
--apply-patch Apply generated patch to repo via git apply (explicit opt-in)
--streaming/--no-streaming Toggle live progress display

Programmatic Usage

import asyncio
from parallel_agents import Pipeline, PipelineConfig
from parallel_agents.config import WorkerConfig

config = PipelineConfig(
    workers={
        "security": WorkerConfig(enabled=True),
        "code": WorkerConfig(enabled=True, model="opus"),
        "review": WorkerConfig(enabled=True),
    },
    max_parallel_workers=3,
)

async def main():
    pipeline = Pipeline(config)
    result = await pipeline.run(
        "Review for security issues",
        repo_path="./my-project",
    )
    print(result.summary)
    if result.patch:
        print(result.patch)

asyncio.run(main())

Workers

Worker Focus Area
security OWASP Top 10, dependency vulns, secret scanning
test Coverage gaps, edge cases, test generation
perf Complexity analysis, N+1 queries, bottlenecks
devops CI/CD, Docker, deployment configuration
arch SOLID principles, design patterns, coupling
docs README, docstrings, API documentation
code Implementation, refactoring (uses Opus)
review Code style, best practices, anti-patterns

Configuration

Set via environment variables (prefix PA_), .env file, or programmatically:

export PA_PLANNER_MODEL=opus
export PA_JUDGE_MODEL=opus
export PA_PERMISSION_MODE=default
export PA_PARSE_RETRY_ATTEMPTS=1
export PA_MAX_PARALLEL_WORKERS=4
export PA_STORE_BACKEND=sqlite

PA_PERMISSION_MODE supports default, acceptEdits, plan, and bypassPermissions.

Current Strengths

  • Parallel specialist analysis with a single merged result.
  • CLI, MCP server, PyPI package, npm wrapper, and release workflows.
  • Evidence storage for run history (file or sqlite).

Current Limitations

  • Generated patches should be reviewed before applying.
  • GitHub issue mode requires gh installation and authentication.
  • Output quality still depends on model behavior and repository context quality.

Project Docs

Exit Codes

  • 0: success
  • 1: runtime failure
  • 2: authentication/API key failure
  • 3: parse failure in planner/judge/worker structured output
  • 4: worker execution failure (status=error)
  • 5: no patch available when patch output/apply is requested
  • 6: patch apply/check failure

Requirements

  • Python 3.11+
  • Claude Code CLI installed and authenticated
  • GitHub CLI installed and authenticated for GitHub issue URL mode
  • An Anthropic API key (via Claude Code authentication)

License

MIT

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

parallel_agents-0.4.1.tar.gz (39.0 kB view details)

Uploaded Source

Built Distribution

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

parallel_agents-0.4.1-py3-none-any.whl (51.9 kB view details)

Uploaded Python 3

File details

Details for the file parallel_agents-0.4.1.tar.gz.

File metadata

  • Download URL: parallel_agents-0.4.1.tar.gz
  • Upload date:
  • Size: 39.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for parallel_agents-0.4.1.tar.gz
Algorithm Hash digest
SHA256 cf51ce973af3045ec978ea19710b388b6bd536ce7ca46730de9d12a66b3aa369
MD5 f57cf5769b12624ddc09fc2af9bfe8fa
BLAKE2b-256 2a1e7cc59e25896cef571560b7e8fd4728c9b5225786bb133c2817e090aa5b39

See more details on using hashes here.

File details

Details for the file parallel_agents-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for parallel_agents-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6e515f204612ca1c606e1dd28ba3ee9b7380166f564af8062a74aea72d91a8f2
MD5 093d7c73407d094a1ccd47a03a33b8dd
BLAKE2b-256 a14ec27762ef94a346b868f51cc7bb788ebe22ba014ee91ccc84e9447f9412d7

See more details on using hashes here.

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