import { agent } from "@alexkroman1/aai";
import { createRuntime, createServer } from "@alexkroman1/aai/runtime";
const myAgent = agent({ name: "Support", systemPrompt: "…" });
const runtime = createRuntime({
agent: myAgent,
env: { ASSEMBLYAI_API_KEY: process.env.ASSEMBLYAI_API_KEY ?? "" },
});
const server = createServer({ runtime, name: myAgent.name });
await server.listen(3000);
Create an HTTP + WebSocket server for an agent — the self-hosting entry point, and the same server
aai devruns.Serves
GET /health,GET /client-config(name/greeting for the browser client), static client assets whenclientDiris set, and voice sessions onWS /websocket. AgentServer.listen binds loopback by default; pass"0.0.0.0"to expose it deliberately (the server has no request authentication of its own).