Agents
An agent is the one AI step in Lumen. You tell it what to do, which steps it may call as tools and what to hand back, and it decides how to get there. Build one in the Agents area to reuse it in many flows, or set one up directly on a flow's canvas.
Two ways to have an agent
Both are the same step, AI agent (chat-agent). They differ in where the settings live.
| Saved agent | AI agent step in a flow | |
|---|---|---|
| Where | Agents in the console, or a Step resource | On the flow's canvas, or in the flow's YAML |
| Reuse | Any number of flows use it | That one node |
| Changes | Each save is a numbered revision. A flow pins a revision and keeps running it until you move it | Change the flow, change the agent |
| Memory | Long-term notes belong to the saved agent, shared by every flow that uses it | Notes belong to that node of that flow |
| Delete | Refused while a flow pins it | Delete the node |
Pick a saved agent when several flows need the same worker, or when you want a review step for changes. Pick a node when the agent belongs to one flow. For the common case of pulling details out of a document, the node is enough: see Find details in documents.
What an agent is set up with
| Setting | What it does |
|---|---|
| Instructions | What the agent is for and how it answers, up to 8,000 characters. Placeholders such as {message} or {details.supplier} are filled from the document. |
| Fields | The details it answers in. Each becomes an output of the step. See Find details in documents. |
| Files | How it reads the document's files: attach (the default), text, none or ifNoText, with limits on files, pages and bytes. |
| Tools | Catalog steps it may call, up to 16, plus tools of connected MCP servers. See Tools and MCP servers. |
| Model | The model it runs on. Left empty, it uses your workspace default. See Models and cost. |
| Memory | How many earlier turns of a conversation it reads (memory.window, 1 to 50). Separate from long-term notes: see Memory. |
| Long-term memory | Whether it keeps notes across runs, how many it recalls at the start (autoRecall, 0 to 10, default 3) and when notes expire (retentionDays). |
| Knowledge | Lighthouse collections it may read, and whether it follows the workspace rules (rules: false turns them off, for an agent that talks to customers). See Lighthouse knowledge and Keep the rules away from an agent. |
| Guardrails | Rules it must follow, limits on what its tools may do, and kinds of text masked in its answer. |
| Limits | Safety caps per run, below. |
The plain AI agent step has these defaults: it answers helpfully and briefly in the language the person wrote in, remembers the last 10 turns, and stops after 8 model turns or when it has spent $0.50 of model usage in the run.
Limits
| Limit | Meaning |
|---|---|
maxTurns | The most model turns in one run of the step, 1 to 100. The AI agent step ships with 8. |
maxTokens | The most tokens, input and output, the agent may use. 1 to 100,000,000. |
maxMinutes | The most time the agent works, 1 to 1,440. |
maxCostUSD | The most model spend in one run, set by the step definition (0.50 for the AI agent step). |
maxToolCredits | The most its tool calls may be charged in one run, in credits. The call that would pass it is not made and the agent stops. Unset, tool calls are bounded by maxTurns only. Set by the step definition. |
memory.window | Earlier turns read back, 1 to 50. Not a safety cap, but listed under Limits in the console. |
A cap that is reached stops the agent and fails the step with the reason, so a flow's failure handling takes over.
Build a saved agent in the console
Open the Agents area
- In the console, open Agents. The list shows each agent, what it is Built on, its Revision, its Cost in credits plus AI usage, and which flows use it.
- Click Create an agent. Only workspace admins see the button. Everyone else sees View instead of the edit icon.
Choose the loadout
- Give the agent a Name and a Description. The description is shown to anyone choosing the agent for a flow.
- The editor shows the agent as a wheel with eight segments, clockwise from the top: Instructions, Tools, Memory, Model, Output, Limits, Examples and Guardrails. Each segment says what is set. Click one to open it, and Back returns to the wheel.
- A segment reads Not set when empty and Not offered when this kind of agent has no such setting. Examples is marked Coming soon and does not open.
- Instructions: what the agent does. Turn on the per-flow option to let every flow write its own instructions, and the instructions here are not saved.
- Tools: the steps it may call. The agent decides when. Only catalog steps can be tools, not other saved steps.
- Model: pick one. Left empty, the agent uses your default.
- Output: the fields it hands back to the flow, each with a name, a type and a hint.
- Limits: the earlier turns it remembers and its safety caps.
- Memory: see Memory.
- Guardrails: rules in sentences, limits per tool (for example, send only to
*@acme.example), and kinds of text to mask in the answer (card number, Israeli ID, email address, phone number).
Try it, then save
- Click Try it, choose This form, unsaved or A saved revision, add a sample text or file, and run it. A try is charged like a normal run. It shows the result, the tools it called and the tokens it used. Try it never changes the agent's memory.
- Add a Note for the history if you like, and click Save as revision N. Saving creates a new revision. Flows on older revisions keep running them until you update them.
Use it in a flow
- In a flow, click +, choose Action and pick the agent from the step picker.
- The node pins the agent's current revision and says Saved agent, revision N. Its settings are locked to that revision, except the parts the agent leaves open.
- When a newer revision exists the node offers Update to revision N, with a comparison of the settings. The agent's list shows each flow and the revision it pins; one that is behind is marked older revision.
To go the other way, open an AI agent step that is not saved and choose Save as agent: the setup becomes a saved agent and this node uses it from then on.
The same agent as YAML
A saved agent is a Step that configures the chat-agent catalog step. with holds its settings, which a flow cannot change. open lists settings a flow may set for itself.
- YAML
- Console
apiVersion: lumen.ai/v1alpha1
kind: Step
metadata:
name: invoice-reader
namespace: tenant-acme
spec:
displayName: Invoice reader
description: Reads an invoice and names the supplier, the date and the total.
from:
clusterStep: chat-agent
with:
instructions: Find these details in the invoice.
fields:
- {name: supplier}
- {name: date, type: date}
- {name: total, hint: "Amount due", type: money}
files: {mode: ifNoText}
limits: {maxTurns: 4, maxMinutes: 5}
open: []
A flow node then pins a revision:
nodes:
- id: details
stepRef: {kind: Step, name: invoice-reader, revision: 1}
next: [rename]
Follow Build a saved agent in the console. Revision numbers are the same in both places.
An agent in a flow, and chatting with it
A flow that starts with the A chat message arrives trigger (chat-message) is a chat: the person's message is the run's input, and the agent's reply is what they read back. The trigger hands the first step two fields, sessionId and message. Messages with the same sessionId are one conversation, and the agent reads the last memory.window turns of it before it answers.
In the console, a flow with this trigger has a Chat tab and a Chat with this flow button. Every message starts a run and uses credits, and the flow must be switched on.
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: agents-support-chat
namespace: tenant-acme
spec:
displayName: Support chat
triggers:
- id: chat
ref: {name: chat-message}
config: {greeting: "Hi! Ask me about your order."}
next: [bot]
nodes:
- id: bot
stepRef: {name: chat-agent}
config:
instructions: >-
You answer customers of a small shop. Be brief and polite, and answer
in the language the customer wrote in.
memory: {window: 10}
tools: [recall, remember]
limits: {maxTurns: 6, maxMinutes: 2}
What an agent is charged
An AI agent step weighs 3 credits when it succeeds (1 when it only fills fields and has no tools). On top, model tokens are charged at the model's rate, and each successful tool call costs the weight of that tool. Tokens on a model with your own key cost no credits. See Models and cost and Credits and budgets.
Browser and code tools exist but are off until an installation enables them. See Tools and MCP servers.


