Skip to content

Claw SDK

Declarative multi-agent society framework. Model agents as graph nodes, relationships as typed edges.

Quick Example

import asyncio
from claw import Agent, Society, Delegation, Oversight, LocalRuntime, auto_detect_llm

s = Society("code-review")
pm = Agent(name="pm", role="project manager")
coder = Agent(name="coder", role="implementer")
reviewer = Agent(name="reviewer", role="critic")

s.connect(pm, coder, Delegation())
s.connect(coder, reviewer, Oversight(max_rounds=3))

async def main():
    llm = auto_detect_llm()  # Uses whichever API key you have set
    result = await LocalRuntime(llm).run(s, "Fix the login bug")
    print(f"Status: {result.status}, Events: {len(result.trace)}")

asyncio.run(main())

See Agents Fix Real GitHub Issues

A long-running daemon monitors your repository for new issues. When one appears, a 4-agent society autonomously triages, implements a fix, reviews the code, runs tests, and opens a PR.

python examples/github_live.py --repo owner/repo

Install

pip install claw
# or
uv add claw

Features

  • Real LLM support -- 100+ providers via LiteLLM (Anthropic, OpenAI, Gemini, and more)
  • GitHub integration -- create issues, open PRs, post reviews, merge branches
  • Live dashboard -- React frontend with real-time graph visualization
  • ReAct tool loop -- agents think, act, observe, iterate
  • Typed edges -- Cooperation, Competition, Oversight, Delegation, Coopetition
  • Versioned artifacts -- shared work products with full history
  • Human-in-the-loop -- humans are graph nodes, not external observers
  • CLI -- claw run and claw init
  • Docker support -- Dockerfile and docker-compose included

Core Abstractions

Primitive What it is
Agent Graph node. AI (has a model) or human (CLI/Slack/GitHub).
Edge Typed connection between agents with visibility and resolution semantics.
EdgeType Semantic template: Cooperation, Competition, Oversight, Delegation, Coopetition.
Artifact Versioned shared work product. The object of collaboration.
Society The graph itself. Named, serializable, composable.
Runtime Pluggable execution engine. LocalRuntime for dev, DistributedRuntime for prod.

Next Steps