LanternDOCS

Surfaces

Surfaces are the communication channels through which users interact with agents. Lantern supports 7 built-in surfaces, all two-way — agents reply in the same channel you messaged from.

In plain termsA surface is where people talk to your agent. Rather than making everyone visit a dashboard, you put the agent where the conversation already happens — WhatsApp, Slack, a phone call, a chat widget on your site. Same agent, same memory, same guardrails on every channel; the surface only changes the doorway.

Available surfaces

WhatsApp

Lantern supports two modes for WhatsApp:

  • Personal (via bridge) -- connects to your personal WhatsApp account using the multi-device bridge. Messages to your agent appear as regular WhatsApp conversations. No WhatsApp Business account required.
  • Business API -- for teams and companies that need a dedicated phone number and the official WhatsApp Business Cloud API. Supports templates, rich messages, and higher throughput.

To set up personal WhatsApp:

  1. Navigate to Settings > Surfaces > WhatsApp
  2. Select Personal (bridge)
  3. Scan the QR code with your WhatsApp app
  4. The bridge connects and your agent is now reachable via WhatsApp
Note: The WhatsApp bridge service runs as a sidecar and maintains a persistent connection. Start it locally with make run-whatsapp-bridge.

Bridge tenant env var

Set LANTERN_TENANT_ID to the tenant UUID the bridge should operate under. The fallback LANTERN_DEFAULT_TENANT_ID is still accepted for backwards compatibility, but LANTERN_TENANT_ID is the canonical name going forward. Both the iMessage bridge and the bridge-core shared library read the same variable in this order.

Slack

Create a Slack app and connect it to Lantern:

  1. Navigate to Settings > Surfaces > Slack
  2. Click Connect to Slack and authorize the Lantern bot in your workspace
  3. Choose which channels the agent should listen to, or enable DM mode

Agents respond in threads by default. Mention @lantern in a channel or send a direct message to trigger a run.

Discord

Similar to Slack, add the Lantern bot to your Discord server:

  1. Navigate to Settings > Surfaces > Discord
  2. Click the invite link to add the bot to your server
  3. Configure which channels the agent monitors

Telegram

Connect a Telegram bot to an agent:

  1. Create a bot via @BotFather on Telegram
  2. Copy the bot token to Settings > Surfaces > Telegram
  3. Assign the surface to an agent

Voice (Twilio + LiveKit)

Phone numbers route inbound calls to a Lantern agent. Two providers are supported:

  • Twilio -- TwiML webhooks for inbound PSTN calls. The control-plane verifies Twilio's webhook signature and replies with TwiML. SMS is also available on the same Twilio connector.
  • LiveKit -- realtime audio; the control-plane mints a short-lived join token and the audio loop runs in a separately-deployed LiveKit Agents worker (media last-mile).

Budget gating

Voice spend counts against the same agent_budgets as runs. A Twilio inbound call over a hard-fail budget is declined with <Reject> (no carrier cost). A LiveKit join token is refused with HTTP 402 (no token means no media). A flat cost estimate is recorded on connect; the provider's status callback at POST /v1/voice/calls/status/{provider} reconciles to actual duration cost when the call ends.

Voice API

MethodPathDescription
POST/v1/voice/numbersLink a phone number to an agent (provider + config)
GET/v1/voice/numbersList linked numbers
DELETE/v1/voice/numbers/{id}Unlink a number
GET/v1/voice/callsRecent calls with duration and cost
POST/v1/voice/tokenMint a short-lived LiveKit join token
POST/v1/voice/webhook/{provider}Inbound call webhook (Twilio TwiML or LiveKit JWT)
POST/v1/voice/calls/status/{provider}Call-end status callback — reconciles actual cost into budget rollup. Point Twilio's “call status changes” webhook here.

Env vars

VariablePurpose
LANTERN_VOICE_CALLER_IDE.164 caller-ID shown on outbound calls. Must be a Twilio verified number.
LANTERN_VOICE_SMS_HEADSUPon (default) — sends an SMS heads-up before the call so recipients recognize the number.
LANTERN_VOICE_CLONEOptional — 1 speaks outbound calls in the owner's cloned voice via ElevenLabs. Requires LANTERN_ELEVENLABS_API_KEY and LANTERN_ELEVENLABS_VOICE_ID.

Email

Agents can receive and send emails. Configure an email surface with:

  1. A dedicated email address (e.g., agent@yourdomain.com)
  2. IMAP/SMTP credentials or a connected Gmail connector

Incoming emails trigger the agent; the response is sent as a reply to the same thread.

Web Chat

Embed a chat widget on any website:

<!-- widget.js is served from the same origin as the control-plane -->
<script src="http://localhost:8080/widget.js"
  data-agent="your-agent-name"
  data-tenant="your-tenant-id">
</script>

The widget renders a chat interface that streams agent responses in real time.

CLI

Interact with agents directly from your terminal:

lantern chat my-agent

This opens an interactive session with streaming output.

REST API

Every agent is accessible via the REST API. See the API Reference for full details.

curl -X POST http://localhost:8080/v1/runs \
  -H "Authorization: Bearer $LANTERN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"agentName": "my-agent", "input": {"topic": "quantum computing"}}'

Assigning surfaces to agents

Surfaces are configured at the account level and then assigned per agent, similar to connectors:

  1. Set up the surface in Settings > Surfaces
  2. On the agent's Configuration tab, enable the surfaces this agent should be reachable on
Warning: An agent can only respond on surfaces that are explicitly assigned to it. If a user messages via WhatsApp but the agent does not have WhatsApp enabled, the message will be silently dropped.

Two-way communication

All surfaces are two-way. When a user sends a message:

  1. The surface gateway receives the message
  2. It routes to the correct agent based on the surface configuration
  3. The agent runs with the message as input
  4. The response streams back through the same surface, in the same conversation or thread
Tip: Agents can also proactively send messages on surfaces -- for example, posting a daily summary to a Slack channel on a schedule.