Skip to main content
Preview
DEFINE AGENT is a preview feature. It ships in broker 2.22. The syntax and behaviour may still change.

What an agent is

Your broker already moves sensor data, drives equipment, and stores history. Two LoT pieces add a language model to that world. A TYPE LLM connector sends one prompt and returns text. Actions use it for a classification, a summary, or a short conversation. A DEFINE AGENT is a named assistant that runs on that connector. It can read topics, publish, run connector events, and hand work to other agents — only where you grant it. The connector holds the provider, the model, the key, and the price. Every agent that names it with USES LLM CONNECTOR picks up a change to that connector. An agent is its own LoT entity. It is deployed with -addAgent, and it does not appear in the connector list.
Like a phone line and the people who answer it. The TYPE LLM connector is the line to the model. Each DEFINE AGENT is a person you hire, with a job description and a set of keys. CALL LLM dials the line directly. CALL AGENT asks a specific person to do the job.

When to use which

  • Prompt in, text out — a TYPE LLM connector and CALL LLM inside an Action
  • An assistant that reads or changes the broker — DEFINE AGENT, then ADD TOOL for each thing it may touch
  • People and apps chatting over MQTT — WITH INTERACTION_TOPIC on the agent
  • Hands-off work — CALL AGENT from an Action on a topic or a timer
  • Several specialists — one LLM connector, several agents, and WITH AGENTS for the peers a supervisor may call
Both need a Growth or Enterprise license, the same row as LLM / Agent on Licensing. On Community, -addAgent is refused. An agent does not consume a connector slot.

Agents and the LLM connector

An agent never talks to a provider directly. USES LLM CONNECTOR names a TYPE LLM connector, and that connector holds the provider (ollama, openai, anthropic, or compatible), the model, the key, and prices. The connector itself never calls tools. The agent adds the job description, the grants, the budgets, and the topics people and Actions use to reach it. Agents and connectors share one namespace, so an agent can’t take the name of a connector. Deploy order doesn’t matter: an agent whose connector is missing waits in error and comes online when the connector starts.

Agent syntax

DEFINE AGENT, its properties, ADD TOOL, delegation, topics, and CALL AGENT.

Agent examples

A chat agent, a reporting agent, and a supervisor with specialists.

Best practices

DEFAULT_USER "root" turns every grant into whatever root can do. Create a user that can do the job and nothing wider, and name that user.
WITH API_KEY GET SECRET "OPENAI_API_KEY". A literal key is copied into every project export.
write_mqtt on reports/line/# with WITH LEVEL "write". A grant of # lets the agent publish anywhere its user can.
A writing grant without LEVEL is refused. Approvals are not available yet.
An undeclared peer is not offered to the model.
Subscribe to $SYS/Coreflux/Agents/<agent>/task/+/stream. Every refusal is a tool_result with an outcome.
Guardrail text steers the model. ADD TOOL and RBAC are the limit. Anything the agent must never do stays outside its grants.

Limits

Task work runs on the agent’s own pool, so a slow model does not stall other connectors.

Coming from TYPE AGENT

DEFINE ROUTE … WITH TYPE AGENT and ADD AGENT_CONFIG are gone. -addConnector refuses the block. A connector file that still holds one is skipped at load and the log names the replacement. Nothing is migrated for you. Rewrite each one by hand. Clients that published to {InteractionTopic}/{agent}/{session}/input and read artifacts or stream move to {INTERACTION_TOPIC}/{session}/ask, …/response, and $SYS/Coreflux/Agents/<agent>/task/<session>/stream. CALL AGENT "<name>.execute" keeps its call shape. The old $SYS/Coreflux/Agents/<name>/Capabilities and …/Metrics topics are not published. Read the card, the status topic, and the task stream.

Not available yet

-addAgent refuses these, with a message that names what is missing, so a setting is never silently ignored.
  • WITH LEVEL "write_confirm" and any writing grant that omits LEVEL
  • AGENT_MODE "insight" as a default, and TOOL_EXECUTION_MODE "confirm". Per-request "mode": "insight" works today
  • WITH SKILLS
  • Shared or long-term memory (MEMORY "shared:…", WITH LONG_TERM_MEMORY)
  • Collaboration modes other than delegate
  • EXTERNAL_ACCESS "true"
  • WITH OUTPUT_MODEL
  • ADD TOOL "run_lot_once"

Next steps

Creating Agents in Coreflux

Paste a site guide, a scheduled report, alert triage, or a shift handover and try them over MQTT.

AI Connectors

Providers, LLM_CONFIG, and CALL LLM.
Last modified on October 21, 2026