{"id":51406600,"url":"https://github.com/sancovp/cave-teams","last_synced_at":"2026-07-04T11:30:49.113Z","repository":{"id":367876656,"uuid":"1282662032","full_name":"sancovp/cave-teams","owner":"sancovp","description":"Connect AI agents like code. A provider-agnostic multi-agent orchestration library + Claude Code plugin — compose any agents (Claude, Codex, MiniMax) into teams with a tiny DSL, every topology, a programmable control flow, and a proven-team library.","archived":false,"fork":false,"pushed_at":"2026-06-28T04:52:41.000Z","size":170,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-28T06:11:05.473Z","etag":null,"topics":["agent-framework","agent-orchestration","agent-teams","agentic","agentic-ai","agents","ai","ai-agent-framework","ai-agents","claude","claude-code","codex","dsl","llm","llm-orchestration","multi-agent","multi-agent-systems","orchestration","provider-agnostic","python"],"latest_commit_sha":null,"homepage":"https://sancovp.github.io/cave-teams/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sancovp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-28T04:03:45.000Z","updated_at":"2026-06-28T04:53:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sancovp/cave-teams","commit_stats":null,"previous_names":["sancovp/cave-teams"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sancovp/cave-teams","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sancovp%2Fcave-teams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sancovp%2Fcave-teams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sancovp%2Fcave-teams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sancovp%2Fcave-teams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sancovp","download_url":"https://codeload.github.com/sancovp/cave-teams/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sancovp%2Fcave-teams/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35120680,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-04T02:00:05.987Z","response_time":113,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-framework","agent-orchestration","agent-teams","agentic","agentic-ai","agents","ai","ai-agent-framework","ai-agents","claude","claude-code","codex","dsl","llm","llm-orchestration","multi-agent","multi-agent-systems","orchestration","provider-agnostic","python"],"created_at":"2026-07-04T11:30:48.678Z","updated_at":"2026-07-04T11:30:49.106Z","avatar_url":"https://github.com/sancovp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cave-teams\n\n**Programmable, leader-driven agent teams on [CAVE](https://pypi.org/project/cave-harness/).**\n\nRun many agent \"teams\" — a **team leader** that orchestrates **teammates** — without Claude Code Teams' blockers, reuse them, and use **MiniMax or Claude (or any runtime)**, from Claude Code. cave-teams **uses CAVE** (it doesn't reimplement it): each team **makes an ephemeral CAVE server** that hosts the agents, runs them, and serves the flow, then tears it down.\n\n```bash\npip install cave-teams          # pulls cave-harness (the CAVE runtime) + pydantic\n```\n\n## The model\n\nTeams are always a **leader + teammates**:\n\n1. The **task** arrives as a file in the team's session dir; the leader checks it.\n2. The leader — *an intelligent autonomous dovetail* — **writes a message** to a teammate (often just *\"read {path}\"*).\n3. cave-teams does **not** blindly run the next thing. It **checks the message** against the **guardrails** (is the target in the team? is it that agent's turn? is the format valid?). If it's wrong, it **re-prompts the leader with the error** — and the LLM **fixes itself**. If it's right, it delivers it; the teammate runs; the leader is alerted.\n4. The leader decides the next message, or **ends the run and returns a report**.\n\n**Conditions on messages** come in two tiers:\n\n- **Closed-world** (enforced by cave-teams): turn order, membership, format — compiled from the team's algebra.\n- **Open-world** (`open_rules`): intelligent-reliant checks only the leader can judge; cave-teams surfaces them and *assumes* they hold when the leader invokes the next teammate.\n\n## Quickstart\n\n```python\nfrom cave_teams import Team, AgentRef, seq, cave_team\nfrom cave_teams.examples import MiniMaxRuntime\n\nclass Brief(Team):                       # a topology = a Team subclass (Class · Link · Config)\n    op = \"brief\"\n    def build(self):\n        return seq(AgentRef(\"researcher\"), AgentRef(\"writer\"))\n\nleader = MiniMaxRuntime(\"leader\", tools=None)            # writes its message files (needs file tools)\nteammates = {\n    \"researcher\": MiniMaxRuntime(\"researcher\", tools=[]),\n    \"writer\":     MiniMaxRuntime(\"writer\", tools=[]),\n}\n\nresult = cave_team(\n    Brief({}), agent_runtimes=teammates, leader_runtime=leader,\n    task=\"Topic: why octopuses are intelligent.\",\n    open_rules={\"researcher\": [\"research must be accurate before the writer uses it\"]},\n)\nprint(result[\"report\"])\n```\n\nA backend is **any object with `.run(str) -\u003e str`** — that's all `set_runtime` needs. The MiniMax/Claude backends are just an *example instance*; CAVE runs any agent runtime.\n\n## The algebra\n\nCompose teammates with a tiny algebra; it compiles to the guardrails (whose turn it is):\n\n```python\nseq(a, b)          # a then b           a \u003e\u003e b\npar(a, b)          # a and b together   a | b\ngate(body, phi)    # loop until phi\nchoice(routes)     # guarded branch\nteam(G)            # a composition as one Link → a team is a teammate (closure law)\n```\n\nTopologies are also **configs** (save under `.cave/golden/`, reuse, `scan_caves`) and **classes** (subclass a `Team`, override `build()`).\n\n## Lower-level run\n\n`run_team(team, task, leader, teammate_runtimes, team_dir, open_rules=...)` is the leader-driven loop directly (no CAVE server). `llm_leader(rt)` / `file_leader(rt)` wrap a runtime as the leader (the latter writes its message as a file, per the session/inbox structure). `cave_team(...)` is `run_team` on a freshly-made, torn-down CAVE server.\n\n## Requires\n\n- **`cave-harness`** (the CAVE runtime; import name `cave`) — pulled in automatically.\n- For the MiniMax/Claude example backends: the heaven framework + `MINIMAX_API_KEY` in the environment.\n\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsancovp%2Fcave-teams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsancovp%2Fcave-teams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsancovp%2Fcave-teams/lists"}