Skip to main content

Programmable, LEADER-DRIVEN agent teams on CAVE: a team leader (an intelligent dovetail) orchestrates teammates by writing message files, guard-railed by conditions on messages, on an ephemeral CAVE server. Compose teams with a tiny algebra; run ANY agent runtime (MiniMax/Claude shown). Requires the CAVE runtime.

Project description

cave-teams

Programmable, leader-driven agent teams on CAVE.

Run 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.

pip install cave-teams          # pulls cave-harness (the CAVE runtime) + pydantic

The model

Teams are always a leader + teammates:

  1. The task arrives as a file in the team's session dir; the leader checks it.
  2. The leader — an intelligent autonomous dovetailwrites a message to a teammate (often just "read {path}").
  3. 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.
  4. The leader decides the next message, or ends the run and returns a report.

Conditions on messages come in two tiers:

  • Closed-world (enforced by cave-teams): turn order, membership, format — compiled from the team's algebra.
  • 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.

Quickstart

from cave_teams import Team, AgentRef, seq, cave_team
from cave_teams.examples import MiniMaxRuntime

class Brief(Team):                       # a topology = a Team subclass (Class · Link · Config)
    op = "brief"
    def build(self):
        return seq(AgentRef("researcher"), AgentRef("writer"))

leader = MiniMaxRuntime("leader", tools=None)            # writes its message files (needs file tools)
teammates = {
    "researcher": MiniMaxRuntime("researcher", tools=[]),
    "writer":     MiniMaxRuntime("writer", tools=[]),
}

result = cave_team(
    Brief({}), agent_runtimes=teammates, leader_runtime=leader,
    task="Topic: why octopuses are intelligent.",
    open_rules={"researcher": ["research must be accurate before the writer uses it"]},
)
print(result["report"])

A backend is any object with .run(str) -> str — that's all set_runtime needs. The MiniMax/Claude backends are just an example instance; CAVE runs any agent runtime.

The algebra

Compose teammates with a tiny algebra; it compiles to the guardrails (whose turn it is):

seq(a, b)          # a then b           a >> b
par(a, b)          # a and b together   a | b
gate(body, phi)    # loop until phi
choice(routes)     # guarded branch
team(G)            # a composition as one Link → a team is a teammate (closure law)

Topologies are also configs (save under .cave/golden/, reuse, scan_caves) and classes (subclass a Team, override build()).

Lower-level run

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.

Requires

  • cave-harness (the CAVE runtime; import name cave) — pulled in automatically.
  • For the MiniMax/Claude example backends: the heaven framework + MINIMAX_API_KEY in the environment.

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

cave_teams-0.2.0.tar.gz (53.8 kB view details)

Uploaded Source

Built Distribution

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

cave_teams-0.2.0-py3-none-any.whl (63.8 kB view details)

Uploaded Python 3

File details

Details for the file cave_teams-0.2.0.tar.gz.

File metadata

  • Download URL: cave_teams-0.2.0.tar.gz
  • Upload date:
  • Size: 53.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for cave_teams-0.2.0.tar.gz
Algorithm Hash digest
SHA256 466a011b057f26f994ebf47b90c8f7d1324eb8caedc1dd416497975752969f52
MD5 17ef9f8ac644e94694f825fb3dadd4ea
BLAKE2b-256 4f0efa14b1fd5e0ca36d301938f3849c7f55ed3aa61f02a34018923af8681411

See more details on using hashes here.

File details

Details for the file cave_teams-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cave_teams-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 63.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for cave_teams-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c8390c0c748eee544b904cf32ef8715aa05f3f77a6b8a8807f9a5319a7b5ba9f
MD5 b6d9713bd7e0c6f507c936ef00bb99ad
BLAKE2b-256 e702c5ffe0b295688a8cc238455d68b9ffdaba4d83270158f7574e19c5f103f4

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