Skip to main content

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.

  • Uses credits
  • Admins build, everyone can view

Two ways to have an agent​

Both are the same step, AI agent (chat-agent). They differ in where the settings live.

Saved agentAI agent step in a flow
WhereAgents in the console, or a Step resourceOn the flow's canvas, or in the flow's YAML
ReuseAny number of flows use itThat one node
ChangesEach save is a numbered revision. A flow pins a revision and keeps running it until you move itChange the flow, change the agent
MemoryLong-term notes belong to the saved agent, shared by every flow that uses itNotes belong to that node of that flow
DeleteRefused while a flow pins itDelete 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​

SettingWhat it does
InstructionsWhat 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.
FieldsThe details it answers in. Each becomes an output of the step. See Find details in documents.
FilesHow it reads the document's files: attach (the default), text, none or ifNoText, with limits on files, pages and bytes.
ToolsCatalog steps it may call, up to 16, plus tools of connected MCP servers. See Tools and MCP servers.
ModelThe model it runs on. Left empty, it uses your workspace default. See Models and cost.
MemoryHow many earlier turns of a conversation it reads (memory.window, 1 to 50). Separate from long-term notes: see Memory.
Long-term memoryWhether it keeps notes across runs, how many it recalls at the start (autoRecall, 0 to 10, default 3) and when notes expire (retentionDays).
KnowledgeLighthouse 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.
GuardrailsRules it must follow, limits on what its tools may do, and kinds of text masked in its answer.
LimitsSafety 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​

LimitMeaning
maxTurnsThe most model turns in one run of the step, 1 to 100. The AI agent step ships with 8.
maxTokensThe most tokens, input and output, the agent may use. 1 to 100,000,000.
maxMinutesThe most time the agent works, 1 to 1,440.
maxCostUSDThe most model spend in one run, set by the step definition (0.50 for the AI agent step).
maxToolCreditsThe 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.windowEarlier 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​

  1. 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.
  2. Click Create an agent. Only workspace admins see the button. Everyone else sees View instead of the edit icon.
The Agents page. A table with the columns Agent, Built on, Revision, Cost, Used by and an actions column. The first row is Invoice reader, built on AI agent, Revision 3, costing 3 credits plus AI usage, used by 1 flow. The second row is an agent with a Hebrew name, Revision 1. A Create an agent button sits above the table.The Agents page. A table with the columns Agent, Built on, Revision, Cost, Used by and an actions column. The first row is Invoice reader, built on AI agent, Revision 3, costing 3 credits plus AI usage, used by 1 flow. The second row is an agent with a Hebrew name, Revision 1. A Create an agent button sits above the table.
Agents lists reusable AI workers, the revision in force and the flows that use each.

Choose the loadout​

  1. Give the agent a Name and a Description. The description is shown to anyone choosing the agent for a flow.
  2. 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.
  3. 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.
The agent wheel for Invoice reader, revision 3. The center shows the name, Try it and Save buttons and an Advanced link. The ring has Instructions (set by each flow), Tools (4 tools), Memory (4 memories), Model (not set), Output (not set), Limits (not set), Examples (coming soon, locked) and Guardrails (not offered).The agent wheel for Invoice reader, revision 3. The center shows the name, Try it and Save buttons and an Advanced link. The ring has Instructions (set by each flow), Tools (4 tools), Memory (4 memories), Model (not set), Output (not set), Limits (not set), Examples (coming soon, locked) and Guardrails (not offered).
The wheel. Check marks show what is set; dashed segments are empty or not available.
  • 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).
The Tools panel of the agent. A multi-select titled Steps it may call holds four chips: Read the text with a credit cost of 1, Rename the file with 0.5, Recall what I remember and Remember something. Below it the hint reads: The agent decides when to use them. Only catalog steps can be tools.The Tools panel of the agent. A multi-select titled Steps it may call holds four chips: Read the text with a credit cost of 1, Rename the file with 0.5, Recall what I remember and Remember something. Below it the hint reads: The agent decides when to use them. Only catalog steps can be tools.
Tools. Each chip shows what a call of that step costs.

Try it, then save​

  1. 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.
  2. 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​

  1. In a flow, click +, choose Action and pick the agent from the step picker.
  2. 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.
  3. 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.

invoice-reader.yaml
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:

excerpt of a flow
nodes:
- id: details
stepRef: {kind: Step, name: invoice-reader, revision: 1}
next: [rename]

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.

agents-support-chat.yaml
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.

Agents that need an installation capability

Browser and code tools exist but are off until an installation enables them. See Tools and MCP servers.

Next steps​