How armistice-ml/agent24 works
Agent24 is a multi-tenant Messenger support backend. Signed webhook events are normalized and stored with idempotency; incoming messages enqueue work for a worker, which runs an LLM agent and tools, records its reply, then sends it. A dashboard supports authenticated human handling, statistics, and SSE change signals; escalations also enqueue email notifications. The README documents these capabilities and the tenant/RLS model; links for unsampled dashboard and notification internals rely on its statements or the source index.
Main entry points: orchestrator.py Agent orchestration · db.py PostgreSQL · handoff.py Human handoff · webhooks.py Webhook routes
Components 21
Message ingress
- Webhook routes
app/routers/webhooks.py - Messenger parser
app/channels/messenger.py - Message ingestion
app/services/ingest.py
Agent processing
- Agent orchestration
app/agent/orchestrator.py - LLM client
app/agent/llm.py - Agent tools
app/agent/tools.py - Agent prompt
app/agent/prompt.py - Messenger sender
app/channels/sender.py
Dashboard and handoff
- Human handoff
app/services/handoff.py - Dashboard API
app/routers/dashboard.py - Session authentication
app/auth.py - SSE endpoint
app/routers/events.py
Runtime platform
- Job queue
app/services/jobs.py - Worker
app/worker.py - Event hub
app/services/events.py - Escalation email
app/services/notifications.py - Email transport
app/notify/email.py - PostgreSQL
app/db.py - FastAPI app
app/main.py
Other components
- Messenger
- Dashboard user
Connections 30
- Messenger → Webhook routes: posts events
README.md - Webhook routes → Messenger parser: parses payload
app/routers/webhooks.py - Webhook routes → Message ingestion: records messages
app/routers/webhooks.py - Webhook routes → Human handoff: registers echoes
app/routers/webhooks.py - Message ingestion → PostgreSQL: stores messages
app/services/ingest.py - Message ingestion → Job queue: enqueues replies
app/services/ingest.py - Message ingestion → Event hub: emits change
app/services/ingest.py - Worker → Job queue: claims jobs
app/worker.py - Worker → Agent orchestration: handles replies
app/worker.py - Worker → Escalation email: handles notices
app/worker.py - Agent orchestration → LLM client: requests completion
app/agent/orchestrator.py - Agent orchestration → Agent tools: executes tool calls
app/agent/orchestrator.py - Agent orchestration → Agent prompt: builds prompt
app/agent/orchestrator.py - Agent orchestration → Messenger sender: sends reply
app/agent/orchestrator.py - Agent orchestration → PostgreSQL: loads and records
app/agent/orchestrator.py - Agent tools → Human handoff: requests escalation
app/agent/tools.py - Human handoff → Job queue: queues email
README.md - Human handoff → Event hub: emits changes
app/services/handoff.py - Dashboard user → FastAPI app: uses API
README.md - FastAPI app → Dashboard API: routes requests
app/main.py - FastAPI app → Session authentication: routes sessions
app/main.py - FastAPI app → SSE endpoint: routes SSE
app/main.py - Dashboard API → Session authentication: checks permissions
app/routers/dashboard.py - Dashboard API → Human handoff: performs human actions
app/routers/dashboard.py - Dashboard API → PostgreSQL: reads dashboard data
app/routers/dashboard.py - Session authentication → PostgreSQL: reads sessions
app/auth.py - SSE endpoint → Event hub: subscribes to events
app/routers/events.py - Event hub → PostgreSQL: stores and listens
app/services/events.py - Escalation email → Email transport: sends escalation email
app/services/notifications.py - Escalation email → PostgreSQL: loads recipients
app/services/notifications.py