README.md

March 26, 2026 ยท View on GitHub

TinyAGI

TinyAGI ๐Ÿฆž

Multi-agent, Multi-team, Multi-channel, 24/7 AI assistant

Run multiple teams of AI agents that collaborate with each other simultaneously with isolated workspaces.

Experimental MIT License Discord Latest Release

โœจ Features

  • โœ… Multi-agent - Run multiple isolated AI agents with specialized roles
  • โœ… Multi-team collaboration - Agents hand off work to teammates via chain execution and fan-out
  • โœ… Multi-channel - Discord, WhatsApp, and Telegram
  • โœ… Web portal (TinyOffice) - Browser-based dashboard for chat, agents, teams, tasks, logs, and settings
  • โœ… Team chat rooms - Persistent async chat rooms per team with real-time CLI viewer
  • โœ… Multiple AI providers - Anthropic Claude, OpenAI Codex, and custom providers (any OpenAI/Anthropic-compatible endpoint)
  • โœ… Auth token management - Store API keys per provider, no separate CLI auth needed
  • โœ… Parallel processing - Agents process messages concurrently
  • โœ… Live TUI dashboard - Real-time team visualizer and chatroom viewer
  • โœ… Persistent sessions - Conversation context maintained across restarts
  • โœ… SQLite queue - Atomic transactions, retry logic, dead-letter management
  • โœ… Plugin system - Extend TinyAGI with custom plugins for message hooks and event listeners
  • โœ… 24/7 operation - Runs as a background process or Docker container

Community

Discord

We are actively looking for contributors. Please reach out.

๐Ÿš€ Quick Start

Prerequisites

Installation & First Run

curl -fsSL https://raw.githubusercontent.com/TinyAGI/tinyagi/main/scripts/install.sh | bash

This downloads and installs the tinyagi command globally. Then just run:

tinyagi

That's it. TinyAGI auto-creates default settings, starts the daemon, and opens TinyOffice in your browser. No wizard, no configuration needed.

  • Default workspace: ~/tinyagi-workspace
  • Default agent: tinyagi (Anthropic/Opus)
  • Channels: none initially โ€” add later with tinyagi channel setup
Development (run from source repo)
git clone https://github.com/TinyAGI/tinyagi.git
cd tinyagi && npm install && npm run build
npx tinyagi start
npx tinyagi agent list
Other installation methods

From Source:

git clone https://github.com/TinyAGI/tinyagi.git
cd tinyagi && npm install && ./scripts/install.sh
๐Ÿณ Docker
docker compose up -d

Set your API key in a .env file or pass it directly:

ANTHROPIC_API_KEY=sk-ant-... docker compose up -d

The API runs on http://localhost:3777. Data is persisted in a tinyagi-data Docker volume.

๐Ÿ“ฑ Channel Setup Guides

Discord Setup

  1. Go to Discord Developer Portal
  2. Create application โ†’ Bot section โ†’ Create bot
  3. Copy bot token
  4. Enable "Message Content Intent"
  5. Invite bot using OAuth2 URL Generator

Telegram Setup

  1. Open Telegram โ†’ Search @BotFather
  2. Send /newbot โ†’ Follow prompts
  3. Copy bot token
  4. Start chat with your bot

WhatsApp Setup

After starting TinyAGI, scan the QR code:

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
     WhatsApp QR Code
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
[QR CODE HERE]

๐Ÿ“ฑ Settings โ†’ Linked Devices โ†’ Link a Device

๐ŸŒ TinyOffice Web Portal

TinyAGI includes a web portal for managing your agents, teams, tasks, and chat โ€” all from the browser.

TinyOffice Office View

Once you start running TinyAGI locally, you can control it by visiting office.tinyagicompany.com. It connects to your local TinyAGI API at localhost:3777 โ€” no account or sign-up needed.

Alternatively, you can run TinyOffice locally:

tinyagi office  # Builds and starts on http://localhost:3000
TinyOffice Features & Setup
  • Dashboard - Real-time queue/system overview and live event feed
  • Chat Console - Send messages to default agent, @agent, or @team
  • Agents & Teams - Create, edit, and remove agents/teams
  • Tasks (Kanban) - Create tasks, drag across stages, assign to agent/team
  • Logs & Events - Inspect queue logs and streaming events
  • Settings - Edit TinyAGI configuration (settings.json) via UI
  • Office View - Visual simulation of agent interactions
  • Org Chart - Hierarchical visualization of teams and agents
  • Chat Rooms - Slack-style persistent chat rooms per team
  • Projects - Project-level task management with filtered kanban boards

Running Locally

Start TinyAGI first (API default: http://localhost:3777), then:

tinyagi office

This auto-detects when dependencies or builds are needed (e.g. after tinyagi update) and starts the production server on http://localhost:3000.

For development with hot-reload:

cd tinyoffice
npm install
npm run dev

If TinyAGI API is on a different host/port, set:

cd tinyoffice
echo 'NEXT_PUBLIC_API_URL=http://localhost:3777' > .env.local

๐Ÿ“‹ Commands

Commands work with the tinyagi CLI.

Core Commands

CommandDescriptionExample
(no command)Install, configure defaults, start, and open TinyOfficetinyagi
startStart TinyAGI daemontinyagi start
stopStop all processestinyagi stop
restartRestart TinyAGItinyagi restart
statusShow current status and activitytinyagi status
channel setupConfigure channels interactivelytinyagi channel setup
logs [type]View logs (discord/telegram/whatsapp/queue/heartbeat/all)tinyagi logs queue

Agent Commands

CommandDescriptionExample
agent listList all configured agentstinyagi agent list
agent addAdd new agent (interactive)tinyagi agent add
agent show <id>Show agent configurationtinyagi agent show coder
agent remove <id>Remove an agenttinyagi agent remove coder
agent reset <id>Reset agent conversationtinyagi agent reset coder
agent provider <id> [provider]Show or set agent's AI providertinyagi agent provider coder anthropic
agent provider <id> <p> --model <m>Set agent's provider and modeltinyagi agent provider coder openai --model gpt-5.3-codex

Team Commands

CommandDescriptionExample
team listList all configured teamstinyagi team list
team addAdd new team (interactive)tinyagi team add
team show <id>Show team configurationtinyagi team show dev
team remove <id>Remove a teamtinyagi team remove dev
team add-agent <t> <a>Add an existing agent to a teamtinyagi team add-agent dev reviewer
team remove-agent <t> <a>Remove an agent from a teamtinyagi team remove-agent dev reviewer
team visualize [id]Live TUI dashboard for team chainstinyagi team visualize dev

Chatroom Commands

CommandDescriptionExample
chatroom <team>Real-time TUI viewer with type-to-sendtinyagi chatroom dev
officeStart TinyOffice web portal on port 3000tinyagi office

Every team has a persistent chat room. Agents post to it using [#team_id: message] tags, and messages are broadcast to all teammates. The chatroom viewer polls for new messages in real time โ€” type a message and press Enter to post, or press q/Esc to quit.

API endpoints:

GET  /api/chatroom/:teamId          # Get messages (?limit=100&since=0)
POST /api/chatroom/:teamId          # Post a message (body: { "message": "..." })

Provider & Custom Provider Commands

CommandDescriptionExample
provider [name]Show or switch global AI providertinyagi provider anthropic
provider <name> --model <model>Switch provider and model; propagates to matching agentstinyagi provider openai --model gpt-5.3-codex
provider <name> --oauth-token <token>Store OAuth token for a built-in providertinyagi provider anthropic --oauth-token sk-ant-oat01-...
provider listList all custom providerstinyagi provider list
provider addAdd a new custom provider (interactive)tinyagi provider add
provider remove <id>Remove a custom providertinyagi provider remove proxy
model [name]Show or switch AI modeltinyagi model opus
Custom provider details

Custom providers let you use any OpenAI or Anthropic-compatible API endpoint (e.g., OpenRouter, proxy servers, self-hosted models).

Define a custom provider in settings.json:

{
  "custom_providers": {
    "my-proxy": {
      "name": "My Proxy",
      "harness": "claude",
      "base_url": "https://proxy.example.com/v1",
      "api_key": "sk-...",
      "model": "claude-sonnet-4-6"
    }
  }
}
FieldRequiredDescription
nameYesHuman-readable display name
harnessYesCLI to use: claude or codex
base_urlYesAPI endpoint URL
api_keyYesAPI key for authentication
modelNoDefault model name for CLI

Assign a custom provider to an agent:

tinyagi agent provider coder custom:my-proxy
tinyagi agent provider coder custom:my-proxy --model gpt-4o

Auth token storage โ€” store credentials for built-in providers so you don't need separate CLI auth:

tinyagi provider anthropic --oauth-token sk-ant-oat01-...
tinyagi provider anthropic --api-key sk-ant-...
tinyagi provider openai --api-key sk-...

Anthropic supports both oauth_token (exported as CLAUDE_CODE_OAUTH_TOKEN) and api_key (exported as ANTHROPIC_API_KEY). OAuth takes priority if both are set. OpenAI keys are saved as models.openai.api_key and exported as OPENAI_API_KEY. If nothing is configured, the process inherits environment variables directly.

API endpoints:

GET    /api/custom-providers              # List custom providers
PUT    /api/custom-providers/:id          # Create or update
DELETE /api/custom-providers/:id          # Delete

See docs/AGENTS.md for more details.

Pairing commands

Use sender pairing to control who can message your agents.

CommandDescriptionExample
pairing pendingShow pending sender approvals (with pairing codes)tinyagi pairing pending
pairing approvedShow approved senderstinyagi pairing approved
pairing listShow both pending and approved senderstinyagi pairing list
pairing approve <code>Move a sender from pending to approved by codetinyagi pairing approve ABCD1234
pairing unpair <channel> <sender_id>Remove an approved sender from the allowlisttinyagi pairing unpair telegram 1234567

Pairing behavior:

  • First message from unknown sender: TinyAGI generates a code and sends approval instructions.
  • Additional messages while still pending: TinyAGI blocks silently (no repeated pairing message).
  • After approval: messages from that sender are processed normally.
Messaging & in-chat commands
CommandDescriptionExample
send <message>Send message to AI manuallytinyagi send "Hello!"
send <message>Route to specific agenttinyagi send "@coder fix bug"

These commands work in Discord, Telegram, and WhatsApp:

CommandDescriptionExample
@agent_id messageRoute message to specific agent@coder fix the bug
@team_id messageRoute message to team leader@dev fix the auth bug
/agentList all available agents/agent
/teamList all available teams/team
@agent_id /resetReset specific agent conversation@coder /reset
/resetReset conversation (WhatsApp/global)/reset or !reset
/restartRestart TinyAGI process/restart
messageSend to default agent (no prefix)help me with this

Note: The @agent_id routing prefix requires a space after it (e.g., @coder fix not @coderfix).

Access control note: before routing, channel clients apply sender pairing allowlist checks.

Update commands
CommandDescriptionExample
updateUpdate TinyAGI to latest versiontinyagi update

Note: If you are on v0.0.1 or v0.0.2, the update script was broken. Please re-install instead:

curl -fsSL https://raw.githubusercontent.com/TinyAGI/tinyagi/main/scripts/install.sh | bash

Your settings and user data will be preserved.

Auto-detection: TinyAGI checks for updates on startup (once per hour).

Disable update checks:

export TINYAGI_SKIP_UPDATE_CHECK=1
Configuration commands
CommandDescriptionExample
resetReset all conversationstinyagi reset
channels reset <chan>Reset channel authenticationtinyagi channels reset whatsapp

๐Ÿค– Using Agents

Use @agent_id prefix to route messages to specific agents:

@coder fix the authentication bug
@writer document the API endpoints
help me with this  โ† goes to tinyagi agent (no prefix needed)
Agent configuration

Agents are configured in .tinyagi/settings.json:

{
  "agents": {
    "coder": {
      "name": "Code Assistant",
      "provider": "anthropic",
      "model": "sonnet",
      "working_directory": "/Users/me/tinyagi-workspace/coder"
    },
    "writer": {
      "name": "Technical Writer",
      "provider": "custom:my-proxy",
      "model": "gpt-5.3-codex",
      "working_directory": "/Users/me/tinyagi-workspace/writer"
    }
  }
}

Each agent operates in isolation:

  • Separate workspace directory - ~/tinyagi-workspace/{agent_id}/
  • Own conversation history - Maintained by CLI
  • Custom configuration - .claude/, heartbeat.md (root), AGENTS.md
  • Independent resets - Reset individual agent conversations

See docs/AGENTS.md for full details on architecture, use cases, and advanced features.

๐Ÿ“ Architecture

Message flow diagram
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     Message Channels                         โ”‚
โ”‚         (Discord, Telegram, WhatsApp, Web, API)             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                     โ”‚ enqueueMessage()
                     โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚               ~/.tinyagi/tinyagi.db (SQLite)               โ”‚
โ”‚                                                              โ”‚
โ”‚  messages: pending โ†’ processing โ†’ completed / dead          โ”‚
โ”‚  responses: pending โ†’ acked                                  โ”‚
โ”‚                                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                     โ”‚ Queue Processor
                     โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              Parallel Processing by Agent                    โ”‚
โ”‚                                                              โ”‚
โ”‚  Agent: coder        Agent: writer       Agent: assistant   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”‚
โ”‚  โ”‚ Message 1โ”‚       โ”‚ Message 1โ”‚        โ”‚ Message 1โ”‚       โ”‚
โ”‚  โ”‚ Message 2โ”‚ ...   โ”‚ Message 2โ”‚  ...   โ”‚ Message 2โ”‚ ...   โ”‚
โ”‚  โ”‚ Message 3โ”‚       โ”‚          โ”‚        โ”‚          โ”‚       โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜       โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜        โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜       โ”‚
โ”‚       โ”‚                  โ”‚                     โ”‚            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ†“                  โ†“                     โ†“
   claude CLI         claude CLI             claude CLI
  (workspace/coder)  (workspace/writer)  (workspace/assistant)

Key features:

  • SQLite queue - Atomic transactions via WAL mode, no race conditions
  • Parallel agents - Different agents process messages concurrently
  • Sequential per agent - Preserves conversation order within each agent
  • Retry & dead-letter - Failed messages retry up to 5 times, then enter dead-letter queue
  • Isolated workspaces - Each agent has its own directory and context

See docs/QUEUE.md for detailed queue system documentation.

โš™๏ธ Configuration

Settings file reference

Located at .tinyagi/settings.json:

{
  "channels": {
    "enabled": ["discord", "telegram", "whatsapp"],
    "discord": { "bot_token": "..." },
    "telegram": { "bot_token": "..." },
    "whatsapp": {}
  },
  "workspace": {
    "path": "/Users/me/tinyagi-workspace",
    "name": "tinyagi-workspace"
  },
  "agents": {
    "tinyagi": {
      "name": "TinyAGI Agent",
      "provider": "anthropic",
      "model": "opus",
      "working_directory": "/Users/me/tinyagi-workspace/tinyagi"
    }
  },
  "teams": {
    "dev": {
      "name": "Development Team",
      "agents": ["coder", "reviewer"],
      "leader_agent": "coder"
    }
  },
  "custom_providers": {
    "my-proxy": {
      "name": "My Proxy",
      "harness": "claude",
      "base_url": "https://proxy.example.com/v1",
      "api_key": "sk-...",
      "model": "claude-sonnet-4-6"
    }
  },
  "models": {
    "anthropic": { "api_key": "sk-ant-...", "oauth_token": "sk-ant-oat01-..." },
    "openai": { "api_key": "sk-..." }
  },
  "monitoring": {
    "heartbeat_interval": 3600
  }
}
Heartbeat configuration

Edit agent-specific heartbeat prompts:

nano ~/tinyagi-workspace/coder/heartbeat.md

Default heartbeat prompt:

Check for:

1. Pending tasks
2. Errors
3. Unread messages

Take action if needed.
Directory structure
tinyagi/
โ”œโ”€โ”€ packages/                # Monorepo packages
โ”‚   โ”œโ”€โ”€ core/                #   Shared types, config, queue, agent invocation
โ”‚   โ”œโ”€โ”€ main/                #   Queue processor entry point
โ”‚   โ”œโ”€โ”€ teams/               #   Team conversation orchestration
โ”‚   โ”œโ”€โ”€ server/              #   API server (REST + SSE)
โ”‚   โ”œโ”€โ”€ channels/            #   Channel clients (Discord, Telegram, WhatsApp)
โ”‚   โ”œโ”€โ”€ cli/                 #   CLI commands
โ”‚   โ””โ”€โ”€ visualizer/          #   TUI dashboard and chatroom viewer
โ”œโ”€โ”€ tinyoffice/              # TinyOffice web portal (Next.js)
โ”œโ”€โ”€ .tinyagi/               # TinyAGI data (created at runtime)
โ”‚   โ”œโ”€โ”€ settings.json        #   Configuration
โ”‚   โ”œโ”€โ”€ tinyagi.db          #   SQLite queue database
โ”‚   โ”œโ”€โ”€ logs/                #   All logs
โ”‚   โ”œโ”€โ”€ channels/            #   Channel state
โ”‚   โ”œโ”€โ”€ files/               #   Uploaded files
โ”‚   โ”œโ”€โ”€ pairing.json         #   Sender allowlist state
โ”‚   โ”œโ”€โ”€ chats/               #   Team conversation history
โ”‚   โ”‚   โ””โ”€โ”€ {team_id}/       #     Per-team chat logs
โ”‚   โ”œโ”€โ”€ .claude/             #   Template for agents
โ”‚   โ”œโ”€โ”€ heartbeat.md         #   Template for agents
โ”‚   โ””โ”€โ”€ AGENTS.md            #   Template for agents
โ”œโ”€โ”€ ~/tinyagi-workspace/    # Agent workspaces
โ”‚   โ”œโ”€โ”€ tinyagi/            #   Default agent
โ”‚   โ”œโ”€โ”€ coder/
โ”‚   โ””โ”€โ”€ writer/
โ””โ”€โ”€ scripts/                 # Installation scripts

๐ŸŽฏ Use Cases

Examples

Personal AI Assistant

You: "Remind me to call mom"
Claude: "I'll remind you!"
[1 hour later via heartbeat]
Claude: "Don't forget to call mom!"

Multi-Agent Workflow

@coder Review and fix bugs in auth.ts
@writer Document the changes
@reviewer Check the documentation quality

Team Collaboration

@dev fix the auth bug
# โ†’ Routes to team leader (@coder)
# โ†’ Coder fixes bug, mentions @reviewer in response
# โ†’ Reviewer automatically invoked, reviews changes
# โ†’ Combined response sent back to user

Teams support sequential chains (single handoff) and parallel fan-out (multiple teammate mentions). See docs/TEAMS.md for details.

Cross-Device Access

  • WhatsApp on phone, Discord on desktop, Telegram anywhere, CLI for automation
  • All channels share agent conversations!

๐Ÿ“š Documentation

๐Ÿ› Troubleshooting

Quick fixes & common issues
# Reset everything (preserves settings)
tinyagi stop && rm -rf .tinyagi/queue/* && tinyagi start

# Reset WhatsApp
tinyagi channels reset whatsapp

# Check status
tinyagi status

# View logs
tinyagi logs all

Common issues:

  • WhatsApp not connecting โ†’ Reset auth: tinyagi channels reset whatsapp
  • Messages stuck โ†’ Clear queue: rm -rf .tinyagi/queue/processing/*
  • Agent not found โ†’ Check: tinyagi agent list
  • Corrupted settings.json โ†’ TinyAGI auto-repairs invalid JSON (trailing commas, comments, BOM) and creates a .bak backup

Need help? GitHub Issues ยท tinyagi logs all

๐Ÿ™ Credits

๐Ÿ“„ License

MIT


TinyAGI - Tiny but mighty! ๐Ÿฆžโœจ

Star History Chart