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. ATYPE 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.
When to use which
- Prompt in, text out — a
TYPE LLMconnector andCALL LLMinside an Action - An assistant that reads or changes the broker —
DEFINE AGENT, thenADD TOOLfor each thing it may touch - People and apps chatting over MQTT —
WITH INTERACTION_TOPICon the agent - Hands-off work —
CALL AGENTfrom an Action on a topic or a timer - Several specialists — one LLM connector, several agents, and
WITH AGENTSfor the peers a supervisor may call
-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
Give every agent its own service user
Give every agent its own service user
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.Keep keys on the LLM connector
Keep keys on the LLM connector
WITH API_KEY GET SECRET "OPENAI_API_KEY". A literal key is copied into every project export.Grant the narrowest topics that do the job
Grant the narrowest topics that do the job
write_mqtt on reports/line/# with WITH LEVEL "write". A grant of # lets the agent publish anywhere its user can.Say LEVEL write on anything the agent must do today
Say LEVEL write on anything the agent must do today
A writing grant without
LEVEL is refused. Approvals are not available yet.Name peers in WITH AGENTS
Name peers in WITH AGENTS
An undeclared peer is not offered to the model.
Watch the stream while you tune grants
Watch the stream while you tune grants
Subscribe to
$SYS/Coreflux/Agents/<agent>/task/+/stream. Every refusal is a tool_result with an outcome.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 omitsLEVELAGENT_MODE "insight"as a default, andTOOL_EXECUTION_MODE "confirm". Per-request"mode": "insight"works todayWITH SKILLS- Shared or long-term memory (
MEMORY "shared:…",WITH LONG_TERM_MEMORY) - Collaboration modes other than
delegate EXTERNAL_ACCESS "true"WITH OUTPUT_MODELADD 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.
