Skip to content

Repository files navigation

ToGO

togo-framework/live

marketplace pkg.go.dev MIT

Bring AI agents to life in togo — push a prompt, an agent answers, the reply streams back over any channel.

Install

togo install togo-framework/live

What it is

live is an AI-agent bridge. You push a prompt — a chat message, a row in a table, or a third-party message like WhatsApp — and a live agent (Claude or omni, typically running inside its own Coder workspace) answers it. The reply is stored, streamed live over a WebSocket, and delivered back out over the channel the conversation came in on.

It generalizes the autopilot loop from "issue → code → PR" into "prompt → reply → any channel", and reuses the same impl/exec provider slots — so omnigent inside coder composes for free.

Data model

Table Meaning
live_agents a persona + backend (echo/claude/omni) + a scoped MCP token
live_conversations one thread with an agent on one channel (chat/whatsapp/…)
live_messages one turn — role=user (a prompt) or role=agent (a reply)

Inserting a role=user message is "pushing a prompt". status=pending → the agent answers it → a role=agent reply appears and is delivered.

Two runtime modes (one API), via LIVE_MODE

agent (default) — bring the agent to life. A long-running claude/omni inside a Coder workspace polls its inbox and pushes replies through the live MCP bridge. Its loop is literally "call live_inbox → think → call live_reply".

claude/omni (in Coder ws) ──MCP──> live-mcp ──HTTPS──> /api/live/inbox + /reply ──> app DB ──> channel

server — zero always-on workspace. An in-app runner claims pending prompts and invokes the agent one-shot via a Responder (echo/claude/cmd), replaying the transcript for context. Great for demos, tests, and simple deployments.

LIVE_MODE=server LIVE_RESPONDER=claude   # or echo (deterministic) / cmd (any binary)

Quick start

# 1. run an app with live installed (server mode + a seeded demo agent)
LIVE_MODE=server LIVE_RESPONDER=echo LIVE_SEED_AGENT=Ada togo serve

# 2. open the built-in chat board
open http://localhost:8080/live

# 3. or drive it over the API
curl -sX POST localhost:8080/api/live/conversations/$CONV/messages \
  -H content-type:application/json -d '{"body":"hello agent"}'

See example/ for a runnable app + a Playwright end-to-end test.

REST API (/api/live)

Method & path Purpose
POST /agents register an agent → returns its bearer token once
GET /agents list agents
POST /conversations · GET /conversations · GET /conversations/{id} manage threads
GET /conversations/{id}/messages transcript
POST /conversations/{id}/messages push a prompt ({"body":"…"})
GET /ws live event stream (new message, typing)
GET /inbox · POST /reply · POST /typing · GET /history agent surface — Authorization: Bearer <agent token>

The MCP bridge (cmd/live-mcp)

The binary an agent runs inside its workspace to become live. Tools: live_inbox, live_history, live_typing, live_reply. Configure it in the workspace's .mcp.json:

{ "mcpServers": { "live": {
  "command": "live-mcp",
  "env": { "LIVE_API_URL": "https://your-app.example", "LIVE_AGENT_TOKEN": "lat_…" }
} } }

Channels

chat and table are in-app (stored + streamed over the WS). Third-party channels are driver plugins that implement live.Channel and RegisterChannel(...) — the same shape as notifications channels:

  • live-whatsapp — WhatsApp Cloud API (in + out)
  • live-notify — one bridge to the whole notifications system: a conversation on the slack/discord/notify channel delivers through the existing notifications-slack/-discord/-webpush/-fcm/-pusher drivers, no per-provider code. Set LIVE_NOTIFY_CHANNELS=slack,discord for the fan-out notify channel.

Deploying a live agent (agent mode)

A live-agent Coder workspace (or any box / Docker) that installs claude/omni, self-registers (POST /api/live/agents), writes the returned token into its .mcp.json for live-mcp, then polls and answers on its own. Turn-key scripts, docker-compose, and a Coder template are in deploy/ — bash deploy/scripts/agent-boot.sh && bash deploy/scripts/agent-loop.sh.


💎 Premium sponsors — ID8 Media · One Studio

About

AI-agent bridge for togo — push a prompt (chat, table, or WhatsApp) and a live agent answers, streamed back over any channel. Agent-driven (MCP) or server-driven.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages