Kuzzle IA Agent π #
Kuzzle IA Agent is a conversational orchestrator embedded in the Kuzzle IoT Platform. It lets users interact with the platform in natural language: a user types a sentence in a chat box, and the agent classifies the request, runs the matching action, and returns the result.
Components #
The agent spans three services:
kuzzle-plugin-ag-uiβ a Kuzzle plugin exposing theagent:runaction. It relays front-end requests to the Python service and injects the security context (user identity, soft-tenants).kuzzle-ai-agentβ a Python service (FastAPI + LangGraph) that interprets the message, dispatches it to an intent handler, and renders the response.kuzzle-iot-mcp-serverβ a FastMCP server exposing the tools the agent calls to read and write data in Kuzzle.
ββββββββββββββββ agent:run ββββββββββββββββ POST /agent/run ββββββββββββββββββββ MCP ββββββββββββββββββββββββ
β Front (Vue) β βββββββββββββΊ β kuzzle-api β βββββββββββββββββββΊ β kuzzle-ai-agent β βββββββΊ β kuzzle-iot-mcp-server β
β ChatLauncherβ β (ag-ui plug) β β (FastAPI + LG) β β (FastMCP tools) β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββ ββββββββββββββββββββββββConversation flow #
The agent graph has three core nodes:
understandβ calls the LLM with a system prompt built dynamically from the registered intents, and classifies the message into an intent name with structured fields.actβ looks up the matching handler in the registry and invokes it. If the previous turn left a pending step, the registry resumes that step (multi-turn wizard).respondβ renders the result, including the dynamic help message.
State is persisted between turns by LangGraph's checkpointer, keyed by threadId.
Packs #
The agent boots with no capability. Features are added as packs, and a pack has two complementary halves:
- An agent pack (loaded via
KUZZLE_AGENT_PACKS) declares the intents: how the LLM recognises a request, the handler that runs it, optional multi-turn steps, and help entries. - An MCP pack (loaded via
MCP_PACKS) declares the tools those intents call to interact with Kuzzle.
A pack may ship only one half β an intent that needs no new tool (it returns a static reply or reuses core tools) needs only the agent side; a tool reused by several intents may live in an MCP pack alone.
Both sides fail fast at boot: the agent registry rejects duplicate intent names, and the MCP server rejects duplicate tool names (on_duplicate_tools="error"). MCP tools are namespaced with the pack id (e.g. hello_say_hello) to avoid collisions.
Dynamic help #
When the user asks for help, the agent returns the list of built-in capabilities followed by the help entries declared by every loaded pack. Each pack contributes its own lines through Pack.help_entries, so the help message always reflects the features actually installed β no central list to maintain.