swarm-tools  by joelhooks

AI agents for coordinated task execution and autonomous learning

Created 1 month ago
311 stars

Top 86.8% on SourcePulse

GitHubView on GitHub
Project Summary

This project addresses complex coding tasks by orchestrating AI agents within OpenCode. It breaks down large problems into manageable "cells," assigns them to parallel workers, learns from past execution outcomes, and ensures continuity through context-aware checkpointing, boosting developer productivity and code quality.

How It Works

A coordinator agent analyzes tasks, queries historical data (CASS), selects a decomposition strategy, and creates Git-backed work items ("cells"). Parallel worker agents execute these cells with file reservations managed by Swarm Mail, an actor-model communication system built on event sourcing and local-first primitives (libSQL). Outcomes feed a learning system that refines future strategies.

Quick Start & Requirements

  • Install: npm install -g opencode-swarm-plugin@latest
  • Prerequisites: Bun runtime, OpenCode environment. Optional: CASS (historical context), UBS (bug scanning), Ollama (local embeddings for semantic memory; falls back to full-text search).
  • Setup: Run swarm setup (one-time) and swarm init (project initialization).
  • Docs: swarmtools.ai (primary link).

Highlighted Details

  • Parallel Execution: Workers operate concurrently, coordinated via Swarm Mail and file reservations to prevent conflicts.
  • Learning System: Adapts decomposition strategies based on success/failure rates, inverting patterns that fail >60% and decaying confidence over time.
  • Context Survival: State is checkpointed in embedded libSQL, allowing swarms to resume execution after OpenCode context compaction.
  • Actor-Model Messaging: Swarm Mail uses event sourcing primitives (DurableMailbox, DurableLock) for robust, local-first inter-agent communication.
  • Git-Backed Work Items: The "hive" (.hive/) tracks tasks via Git, enabling distributed coordination without central servers.
  • Knowledge Injection: Loadable "Skills" packages provide domain-specific workflows and code examples.
  • Cross-Agent Search: CASS indexes past AI coding sessions to leverage existing solutions.
  • Verification Gates: Coordinator reviews worker output, employing a 3-strike rule to flag architectural issues.

Maintenance & Community

The project is structured as a Bun + Turborepo monorepo. Specific details on active contributors, sponsorships, or community channels (e.g., Discord/Slack) are not provided in the README.

Licensing & Compatibility

  • License: MIT.
  • Compatibility: Permissive MIT license allows for commercial use and integration into closed-source projects.

Limitations & Caveats

Requires Bun and OpenCode. Full functionality, particularly semantic memory and historical context, depends on optional dependencies like Ollama and CASS. The system's complexity, built on primitives like event sourcing and actor models, may present a steeper learning curve for new adopters.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
113
Issues (30d)
17
Star History
259 stars in the last 30 days

Explore Similar Projects

Starred by Andrew Ng Andrew Ng(Founder of DeepLearning.AI; Cofounder of Coursera; Professor at Stanford), Thomas Wolf Thomas Wolf(Cofounder of Hugging Face), and
4 more.

ag2 by ag2ai

0.5%
4k
AgentOS for building AI agents and facilitating multi-agent cooperation
Created 1 year ago
Updated 1 day ago
Feedback? Help us improve.