agentleFS
AbilityaiAbilityai/trinity/AGENTS.md

trinity

AGENTS.md619 starsChanged 2 months agoApache-2.0View on GitHub

Trinity is an autonomous agent orchestration platform: every agent runs in its own Docker container with scheduling, observability, credential injection, channel integrations (Slack/Telegram/WhatsApp), and a tamper-evident audit trail — self-hosted on infrastructure the operator controls. Agents are plain Claude Code (or Gemini CLI) projects; Trinity is where they run in production. Detailed documentation index: docs/user-docs/README.md — guides, agent management, credentials, automation, operations, integrations, and the full API reference live there. This is the authoritative entry point for AI agents. If…

  • Reads credentials
  • Installs packages
  • Sends data out
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    This is a PUBLIC repository: Never commit credentials, API keys, internal URLs, or PII.

    line 131
  2. Very specific:

    Run the stack: ./scripts/deploy/start.sh (Docker must be running).

    line 132

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Trinity — Guide for AI Agents

Trinity is an autonomous agent orchestration platform: every agent runs in its own Docker container with scheduling, observability, credential injection, channel integrations (Slack/Telegram/WhatsApp), and a tamper-evident audit trail — self-hosted on infrastructure the operator controls. Agents are plain Claude Code (or Gemini CLI) projects; Trinity is where they run in production.

Detailed documentation index: docs/user-docs/README.md — guides, agent management, credentials, automation, operations, integrations, and the full API reference live there.

Using this file

This is the authoritative entry point for AI agents. If you are an autonomous agent that just landed in this repository or connected to a Trinity instance, start here. The other root files serve different readers — README.md is for humans evaluating Trinity; CLAUDE.md is the contributor working agreement (Rules of Engagement, SDLC, architectural invariants) that Claude Code auto-loads when you edit this codebase. Read CLAUDE.md only when your task is "contribute code"; for everything else, this file is the map.

How to traverse it: find your task in Route by task → jump to that section → run the commands → stop at the Done when signal. Each task is zero-to-value: the shortest path from landing to a confirmed useful result, ending in one check you can run to prove you got there. If a step is ambiguous or a link is dead, that is a bug — report it on the issue tracker.

Route by task

Your taskGo toDone when
Deploy yourself (or another agent) to a Trinity instanceDeploy an agenttrinity agents list (or GET /api/agents) shows the agent running
Stand up a new Trinity instanceStand up an instancecurl /health → {"status": "healthy"}
Operate an existing instance (chat, schedules, fleet ops)Operate over MCPan MCP tool call (e.g. list_agents) returns results over your API key
Evaluate Trinity / summarize it for your operatorREADME.md, then docs/user-docs/README.md; system design: docs/memory/architecture.md (+ docs/memory/architecture/ for area detail)you can state what Trinity is, how to run it, and its license
Contribute to Trinity's codebaseWork on this repository — Claude Code also auto-loads CLAUDE.mdtests pass and a PR is open against dev

Key facts

Web UIhttp://localhost (port 80)
Backend APIhttp://localhost:8000 — OpenAPI at /docs
MCP serverhttp://localhost:8080/mcp (Streamable HTTP)
Health checkGET http://localhost:8000/health → {"status": "healthy", ...}; 503 + "unhealthy" while DB migrations are incomplete
AuthPOST /api/token with form-encoded username & password → JWT, sent as Authorization: Bearer <token>. MCP API keys (trinity_mcp_*) also work as Bearer tokens
Unauthenticated endpoints/health, /api/auth/mode, /api/setup/status, /api/token
Agent SSH ports2222+ (incrementing per agent)
Required agent filesCLAUDE.md (agent instructions), template.yaml (metadata); optional .env.example, .mcp.json.template
PersistenceSQLite at ~/trinity-data/trinity.db (host bind mount); Redis for transient state
LicenseApache 2.0 — free for any use, commercial included

Stand up a Trinity instance

Prerequisites: Docker + Docker Compose v2; an Anthropic API key (Claude agents) or Google API key (Gemini agents).

git clone https://github.com/abilityai/trinity.git
cd trinity
./scripts/deploy/start.sh --unattended

Then open http://localhost → setup wizard → set the admin email + password (12+ chars, mixed case + digit + symbol) → Settings → Integrations → API Keys to add the model API key.

Verify:

curl -s http://localhost:8000/health
# → {"status": "healthy", "timestamp": "..."}

Manual install and production deployment: docs/user-docs/guides/deploying-trinity.md. From inside Claude Code, /trinity:deploy-new-instance (abilities marketplace) provisions Trinity on any SSH-reachable server and scaffolds an ops agent for it.

Deploy an agent to Trinity

Prerequisite: a running Trinity instance to deploy to — if you don't have one, Stand up an instance first (trinity deploy against no instance fails with a connection error).

An agent is a directory with CLAUDE.md + template.yaml. Minimal template.yaml:

name: my-agent                  # unique identifier (lowercase, hyphens ok)
display_name: "My Agent"
description: "What this agent does"
resources:
  cpu: "2"
  memory: "4g"

Full schema (credentials, runtime selection, metrics, shared folders): docs/TRINITY_COMPATIBLE_AGENT_GUIDE.md. Rather than author one from scratch, start from a ready-made template — catalog: config/agent-templates/README.md (also GET /api/templates / list_templates over MCP).

If you are running inside Claude Code — use the abilities plugins:

/plugin marketplace add abilityai/abilities      # one-time
/plugin install trinity@abilityai
/trinity:connect        # one-time per instance: URL + email code → MCP key + .mcp.json
/trinity:onboard        # per agent: compatibility check, Trinity files, deploy + start
/trinity:sync           # ongoing: push/pull changes between local and remote

Terminal equivalent for the installs: claude plugin marketplace add abilityai/abilities && claude plugin install trinity@abilityai.

Any other runtime — use the CLI (deterministic, scriptable):

pip install trinity-cli
trinity init                          # instance URL + email code → JWT + MCP key
cd my-agent/ && trinity deploy .      # package, upload, create + start the container

Done when trinity agents list shows the agent with status running (uses the key from trinity init — no extra token needed). Equivalent raw-API check, deriving a token first:

TOKEN=$(curl -s -X POST http://localhost:8000/api/token \
  -d 'username=admin&password=YOUR_ADMIN_PASSWORD' | jq -r '.access_token // empty')
curl -s -H "Authorization: Bearer $TOKEN" http://localhost:8000/api/agents

Operate a Trinity instance over MCP

Get an MCP API key (Settings → MCP Keys in the UI; /trinity:connect and trinity init auto-provision one), then configure:

{
  "mcpServers": {
    "trinity": {
      "type": "http",
      "url": "http://localhost:8080/mcp",
      "headers": { "Authorization": "Bearer trinity_mcp_..." }
    }
  }
}

~80 tools: agent lifecycle, chat, schedules, executions, skills, tags, monitoring, loops, system deployment. Catalog: docs/user-docs/integrations/mcp-server.md.

Caveats that matter to agents:

  • Claude Code enforces a 60-second timeout on MCP HTTP tool calls. For longer tasks call chat_with_agent with async=true, parallel=true to get an execution_id immediately, then poll get_execution_result.
  • Agent-scoped keys see only their permitted agents; user-scoped keys see the owner's agents. Details: docs/user-docs/collaboration/agent-permissions.md.

Work on this repository

Claude Code auto-loads CLAUDE.md — full dev guidelines, SDLC, and architectural invariants live there. The short version for other agents:

  • This is a PUBLIC repository. Never commit credentials, API keys, internal URLs, or PII. Use placeholders (your-domain.com, user@example.com). Review git diff before every commit.
  • Run the stack: ./scripts/deploy/start.sh (Docker must be running). Stop: ./scripts/deploy/stop.sh. Rebuild the agent base image after docker/base-image/ changes: ./scripts/deploy/build-base-image.sh.
  • Tests: cd tests && pytest unit/ is the per-PR unit island and needs no backend; every other tier creates and deletes real agents on the instance TRINITY_API_URL points at, so read tests/README.md first — and docs/testing/STRATEGY.md for what each lane proves.
  • Layout: src/backend (FastAPI), src/frontend (Vue 3 + Pinia), src/mcp-server (TypeScript MCP proxy), src/cli, docker/base-image (agent runtime).
  • Backend pattern: router → service → db (src/backend/routers|services|db); schema changes require a versioned migration in src/backend/db/migrations.py.
  • Workflow: GitHub Issues with priority/type/theme labels; feature branches off dev; PRs target dev (releases merge dev → main). Two-tracker open-core model: bugs/refactor/docs live in public abilityai/trinity; features/epics in private abilityai/trinity-enterprise (see .claude/DEVELOPMENT_WORKFLOW.md → Repository Routing). See CONTRIBUTING.md.

Documentation map

ResourceWhat's in it
docs/user-docs/README.mdThe detailed docs index — guides, agents, credentials, collaboration, automation, operations, sharing, integrations, CLI, abilities plugins, API reference
docs/memory/architecture.mdAlways-loaded core: system shape, all invariants, network topology, and the Architecture Map
docs/memory/architecture/Per-area detail read on demand: component/API catalogs, execution, reliability, agent lifecycle + runtime, integrations, observability, workspace, frontend, MCP server, DB schema, security
docs/TRINITY_COMPATIBLE_AGENT_GUIDE.mdAgent template structure in depth
docs/MULTI_AGENT_SYSTEM_GUIDE.mdMulti-agent YAML manifests and coordination patterns
docs/CLI.mdFull trinity CLI reference and multi-instance profiles
docs/KNOWN_ISSUES.mdCurrent limitations and workarounds
docs/testing/STRATEGY.mdHow Trinity is tested — the method, the CI lanes, and the bar a harness must meet; read it before adding or running tests
abilityai/abilitiesThe plugin marketplace — agent lifecycle workflows (scaffold, develop, deploy, iterate)

Programmatic docs Q&A: ./scripts/ask-trinity.sh "your question" from a checkout, or the hosted endpoint linked in docs/user-docs/getting-started/help.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.