Real-Time Multi-Agent Voice Dashboard with Smallest AI and Next.js

In this guide, I will walk you through building a Multi-Agent Voice Dashboard. We will create an application featuring three distinct AI personalities: a Weather Assistant, a Tech News Curator, and a fully interactive Tic-Tac-Toe opponent.
GitHub Repository: https://github.com/smallest-inc/cookbook/tree/main/voice-agents/atoms\_sdk\_web\_agent
The goal was to push the boundaries of a standard voice bot by implementing Function Calling (Tools) in a real-time environment.
We are building a Next.js application where users can switch between three agents:
-
Weather Agent: Fetches live external data.
-
Hacker News Agent: Summarizes top stories using the Hacker News API.
-
Tic-Tac-Toe Agent: A complex agent that maintains game state, executes logic, and plays a visual game against the user via voice commands.

Configuration Reference: You can find the exact System Prompts and Tool Definitions used for this project in the [agents-config](https://github.com/smallest-inc/cookbook/tree/main/voice-agents/atoms_sdk_web_agent/agents-config) directory. Specifically, look at [tic-tac-toe-agent.md](https://github.com/smallest-inc/cookbook/blob/main/voice-agents/atoms_sdk_web_agent/agents-config/tic-tac-toe-agent.md) for the complex game instructions and [hackernews-agent.md](https://github.com/smallest-inc/cookbook/blob/main/voice-agents/atoms_sdk_web_agent/agents-config/hackernews-agent.md) for the news curator setup.
-
Frontend: Next.js (App Router), Tailwind CSS, Framer Motion.
-
Voice Orchestration: Smallest.ai Atoms SDK.
-
Backend Logic: Next.js API Routes (acting as tools for the AI).
Before writing code, we need to configure the "brains" of the operation on the Smallest.ai platform. We need three separate agents, each with unique system prompts and tool definitions.
The Tic-Tac-Toe Agent
This is the most complex agent. It requires the AI to understand a 3x3 grid and remember a specific gameId.
System Prompt Strategy We instruct the AI to play as 'O' and treat the board as a grid numbered 0-8. Crucially, we tell it to save the gameId returned from the start command and pass it to subsequent move commands.

Tool Definitions We define three tools in the Smallest.ai dashboard that map to our local API routes:
-
new_game: POST request to initiate a session.
-
make_move: POST request taking
gameIdandposition(0-8). -
get_state: GET request to check the board status.
The Hacker News & Weather Agents
These use simpler GET requests. The Hacker News agent hits a proxy endpoint we will build to fetch and summarize top stories, while the Weather agent interacts with OpenWeatherMap.
We start by initializing a Next.js project and installing the specific SDKs required for voice handling and state management.
Installation
npx create-next-app@latest agent-smallest-ai
cd agent-smallest-ai
npm install atoms-client-sdk @vercel/kv uuid framer-motion lucide-react
Environment Variables Create a .env.local file. You need your Smallest.ai API key and the unique Agent IDs generated in Step 1.
SMALLESTAI_API_KEY=your_key
TICTACTOE_AGENT_ID=your_id
WEATHER_AGENT_ID=your_id
HACKERNEWS_AGENT_ID=your_id
The AI needs APIs to interact with. For Tic-Tac-Toe, we cannot rely on the LLM to manage the game logic (it might hallucinate moves). We build a deterministic game engine in our backend.
Code Reference: The serverless game logic is split between the API routes in [app/api/tictactoe](https://github.com/smallest-inc/cookbook/tree/main/voice-agents/atoms_sdk_web_agent/app/api/tictactoe) and the core rules engine located in [app/lib/tictactoe-engine.ts](https://github.com/smallest-inc/cookbook/blob/main/voice-agents/atoms_sdk_web_agent/app/lib/tictactoe-engine.ts). This separation ensures the API handles the request/response cycle while the engine handles the win/loss calculations and Redis storage.
// app/api/tictactoe/make-move/route.ts
import { NextResponse } from 'next/server';
import { getGame, saveGame, checkWinner, makeComputerMove } from '@/app/lib/tictactoe-engine';
<p>export async function POST(req: Request) {<br> const body = await req.json();<br> let { gameId, position } = body;</p>
<p> // Validate and fetch current state<br> const gameState = await getGame(gameId);<br> <br> // 1. Apply Player Move (X)<br> gameState.board[position] = 'X';</p>
<p> // 2. Check for Win/Draw<br> // ... logic omitted for brevity ...</p>
<p> // 3. Calculate Computer Move (O) via Minimax or Heuristics<br> const computerMove = makeComputerMove(gameState.board);<br> if (computerMove !== -1) {<br> gameState.board[computerMove] = 'O';<br> }</p>
This route ensures that when the user says "Top Left", the board updates, the CPU counters, and the new state is saved—all within the latency window of the voice response.
Now we connect the frontend to the Smallest.ai voice stream. We use the AtomsClient to handle the WebRTC connection.
Client Initialization In app/page.tsx, we initialize the client. We need a mechanism to fetch a temporary session token from our backend to keep our API keys secure.
Implementation Note: The main connection logic, event listeners, and state management for the voice client are all contained within the main page file at [app/page.tsx](https://github.com/smallest-inc/cookbook/blob/main/voice-agents/atoms_sdk_web_agent/app/page.tsx). This includes the setupEventListeners function which handles the real-time transcription and function call results.
// app/page.tsx<br>const connect = async (agent) => {<br> // Get a secure token from our own API route<br> const response = await fetch(<code>/api/invite-agent?mode=webcall</code>, {<br> method: "POST",<br> body: JSON.stringify({ agentId: agent.id }),<br> });<br> const data = await response.json();<p></p>
Handling Events We set up listeners to handle transcription and, crucially, function call results. This allows the UI to update immediately when the AI performs an action.
client.on("function_call_result", (data) => {<br> // If the AI played a move, update the local board state immediately<br> if (data.function_name === 'make_move') {<br> const result = JSON.parse(data.result);<br> setGameState({<br> board: result.board,<br> status: result.status,<br> // ...<br> });<br> }<br>});
A voice AI needs a face. I created a WaveAvatar component that reacts to audio levels to provide visual feedback when the agent is speaking.
Component Reference: The visual components are located in [app/components](https://github.com/smallest-inc/cookbook/tree/main/voice-agents/atoms_sdk_web_agent/app/components). Check [WaveAvatar.tsx](https://github.com/sosumit001/agent-smallest-ai/blob/main/app/components/WaveAvatar.tsx) to see how the audio levels drive the CSS transforms, and [TicTacToeBoard.tsx](https://github.com/smallest-inc/cookbook/blob/main/voice-agents/atoms_sdk_web_agent/app/components/TicTacToeBoard.tsx) for the Framer Motion implementation of the game grid.
// app/components/WaveAvatar.tsx<br>// Simplified logic<br>const waveIntensity = isSpeaking ? audioLevel * 100 : 0;<p></p>
You can find the full source code and setup instructions in the GitHub repository linked at the start of this article. Try cloning it and creating your own agents to see what else you can build.
Frequently asked questions
A multi-agent voice dashboard is an application that lets users interact with multiple AI voice agents from one interface. In this project, the dashboard includes a Weather Agent, a Hacker News Agent, and a Tic-Tac-Toe Agent, each with its own system prompt, tools, and behavior.
To build a real-time voice AI dashboard with Next.js, you typically create a frontend UI for agent switching, connect it to a voice orchestration layer such as Smallest AI Atoms SDK, and expose backend API routes as tools for your agents. In this guide, Next.js handles both the dashboard UI and the server-side APIs for weather, news, and game logic.
Smallest AI Atoms SDK is used to build and run real-time voice agents with features like speech input/output, live conversations, agent orchestration, and tool calling. It helps developers connect voice interfaces to AI agents that can fetch external data, manage state, and perform actions during a conversation.
Yes, you can configure multiple Smallest AI voice agents in one app, each with a different system prompt, tool set, and role. This allows one dashboard to support multiple personalities or use cases, such as customer support, live data assistants, news summarizers, or interactive game agents.
Keep reading

Speaker Diarization Benchmark: Who Spoke When, in One Speech-to-Text Call
Speaker diarization, measured: 19.70% mean DER on six public datasets vs ElevenLabs and Deepgram, roughly 320x real time, in one speech-to-text call.

5 Best Hume AI Alternatives & Migration Guide
Explore the best Hume AI alternatives after the EVI and Octave TTS shutdown. Compare voice APIs and follow a practical migration checklist for 2026.

FCC’s New TCPA Opt-Out Rules: What AI Voice Agents Must Change for Outbound Calls
Learn what the FCC’s November 2026 TCPA opt-out rules mean for AI voice agents, consent revocation, outbound calls and suppression workflows.