Skip to main content

Three minds, one context — Multi-agent AI orchestrator for Claude Code, Codex, and Gemini CLI.

Project description

Trinity Agent

Three minds, one context. Multi-agent AI orchestrator that unifies Claude Code, Codex, and Gemini CLI through shared context, round-based deliberation, and task distribution.

Quick Start

# Install
pip install trinity-agent

# Initialize in your project
trinity init

# Run a deliberation
trinity ask "인증 시스템 아키텍처를 설계해줘"

# Interactive mode (tmux)
trinity ask "질문" --interactive

How It Works

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│   Claude    │     │    Codex    │     │   Gemini    │
│  (Architect)│     │(Implementer)│     │  (Reviewer) │
└──────┬──────┘     └──────┬──────┘     └──────┬──────┘
       │                   │                   │
       └───────────┬───────┴───────────────────┘
                   │
           ┌───────┴───────┐
           │   Orchestrator │
           │  Shared Context│
           │   Consensus    │
           └───────────────┘
  1. Shared Context — All agents read/write to a shared markdown file
  2. Round-based Deliberation — Agents discuss in rounds until consensus
  3. Consensus Detection — Keyword-based agreement detection
  4. Task Distribution — Assign tasks based on agent strengths

Commands

Command Description
trinity init Initialize .trinity/ in current directory
trinity ask "question" Run deliberation on a prompt
trinity status Show agent status
trinity context Display shared context
trinity config [key] Show configuration
trinity logs View orchestrator logs
trinity reset --keep-context Reset session (preserve context)
trinity attach Attach to tmux session
trinity status-watch Live status dashboard

Configuration

Edit .trinity/trinity.config:

[general]
session_name = "trinity"
max_deliberation_rounds = 5
consensus_threshold = 0.6

[agents.claude]
provider = "claude-code"
cli_command = "claude"
role_prompt = "You are the Architect..."
enabled = true

[agents.codex]
provider = "codex"
cli_command = "codex"
role_prompt = "You are the Implementer..."
enabled = true

[agents.gemini]
provider = "gemini-cli"
cli_command = "gemini"
role_prompt = "You are the Reviewer..."
enabled = true

Architecture

Module Description
trinity.orchestrator Top-level coordinator
trinity.agents Provider-specific agent wrappers (Claude, Codex, Gemini)
trinity.deliberation Protocol, consensus, task distribution
trinity.completion Completion detection (Hook, PromptReturn, Idle)
trinity.context Shared context engine, monitor, session rotation
trinity.health Agent health monitoring
trinity.workspace Workspace isolation (git worktree), managed home
trinity.retry Retry with exponential backoff
trinity.error_handler Crash recovery and agent respawn

Requirements

Development

git clone https://github.com/hongdangmoo49/Trinity.git
cd Trinity
uv sync
uv run pytest tests/ -v

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

trinity_agent-0.1.0.tar.gz (123.9 kB view details)

Uploaded Source

Built Distribution

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

trinity_agent-0.1.0-py3-none-any.whl (58.6 kB view details)

Uploaded Python 3

File details

Details for the file trinity_agent-0.1.0.tar.gz.

File metadata

  • Download URL: trinity_agent-0.1.0.tar.gz
  • Upload date:
  • Size: 123.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.4

File hashes

Hashes for trinity_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 87bfaf4285eeb060a05397e851f3ba17c433b97c5c6a396d8f519d82a6bb2cee
MD5 178ae09e3dec1acdaff7c3b705c4813e
BLAKE2b-256 94f5bff2cf4c1daa7d6e363b7d34829f190f8b276c5268bb34f7028e49127eae

See more details on using hashes here.

File details

Details for the file trinity_agent-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for trinity_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 481762a552e32a31f2d9f8b4e091161ed40b5206389558ecd4b14236985c91f5
MD5 bb94907910365323ee483433f6d99ea1
BLAKE2b-256 21dfe9a2e9477928ffd1aa60318cab2c3176685fe1e040893463f81e291e3d3e

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