AI Agents
Overview
Connect AI agents to respond to WhatsApp conversations.
wakit supports connecting AI agents that automatically respond to incoming WhatsApp messages. Create lightweight built-in agents or connect external agents via standard protocols.
Architecture
- An incoming message arrives via the WhatsApp webhook
- A database trigger fires the
agent-clientEdge Function - The agent-client builds conversation context and calls the agent API
- The agent responds and the response is saved as a new message
- An outgoing trigger sends the response via the WhatsApp Cloud API
Agent types
Built-in agents
Configure directly in the dashboard with:
- Provider (OpenAI, Anthropic, Google, Groq)
- Model
- Instructions (system prompt)
- Tools (MCP, SQL, HTTP, Calculator)
External agents
Deploy your own agent as a service and connect via:
- Chat Completions — OpenAI-compatible API
- A2A — Google's Agent-to-Agent protocol
Configuration
type AgentExtra = {
mode?: "active" | "draft" | "inactive";
api_url?: "openai" | "anthropic" | "google" | "groq" | string;
api_key?: string; // default: provider env var
model?: string; // default: gpt-5-mini
protocol?: "chat_completions" | "a2a";
instructions?: string; // system prompt
tools?: ToolConfig[];
max_messages?: number;
temperature?: number;
max_tokens?: number;
};Set mode to "active" to enable the agent. Messages will only be routed to the agent when it's active.