Robot Cell Simulator – AI Agent window
« Robustness test | Contents | Anonymised study for AI »
AI Agent window | Usage | Messages while it works | Direct commands | Anonymous mode | Configuration | Knowledge files | Costs | Log | Problems

AI Agent window API / CLI

Full collision study with one prompt – AI agent. In the AI Agent window (tab next to the Message Window, license API / CLI) the whole study of the station open in the scene runs by itself. Type for example:
Find all possible collisions of the open station: baseline run, work zones, check interlocks, then write and run a robustness test plan with Live 3D. Give me the report.
This replaces the manual steps:
  1. send all robots to HOME (Folge 125),
  2. baseline run of the Folge (times, waiting, request races),
  3. calculate the work zones,
  4. Check interlocks,
  5. export the anonymized study, give it to an AI assistant and copy its answer,
  6. write or import the robustness test plan,
  7. run the robustness test with Live 3D and wait,
  8. open the report and sort out the collision cases.
The agent writes the test plan from the results of the baseline run – the same method as AI agent plan in the comparison of the test kinds – and gives the same results: all known collision places A–E, about 10 min at 400 %. The answer comes in the chat (cycle times, collision cases, races) and as the report of the robustness test.
Data: with the anonymous mode (/anonymous on) the chat sends identifiers (R1, R2 …, <file N>, <name>) instead of the real names to the model – like the anonymized study – and the whole study still runs by itself. Without it the chat asks before the first real data are sent.

The second tab next to the Message Window (bottom, AI icon) is a chat with an AI agent. You write what the agent should do, e.g. "Run the simulation of the station and find all possible collisions"; a language model plans the steps and uses the commands of the simulator like the buttons, without dialogs. The chat shows your messages, the answers of the agent and every command with its result.

ControlWhat it does
State linein the title bar of the window (instead of the title AI Agent): provider and model; while the agent works the current step and the progress of the simulation (simulation running: cycle x / y, about n min left); the usage (see Usage in the state line); red text when the license or the API key is missing
New chatcolumn on the right of the conversation, at the top: forgets the conversation and starts a new one
Settings buttononly the icon, below New chat: opens Tools > Settings... > AI Agent (connection to the model, knowledge files, see below)
Conversationyour messages, the answers and the commands of the agent. Links open in the web browser. Context menu: Copy, Select All, Larger font (Ctrl + wheel), Smaller font, Copy the whole conversation (to the clipboard, e.g. for a report or the support), Clear (new chat) (like New chat)
Message fieldthe message to the agent; Enter sends it, Shift+Enter starts a new line. The hint in the empty field shows the commands /help and /reload. A message starting with / and a letter is a direct command of the simulator: it does not use any tokens – it does not go to the model; the simulator runs it at once and shows the answer (JSON) in the conversation. Context menu: the standard commands (Undo, Redo, Cut, Copy, Paste, Delete, Select All), Larger font (Ctrl + wheel), Smaller font and Clear (empties the field)
Sendnext to the message field: sends the message; while the agent works see Messages while the agent works
Stopbelow Send: stops the agent: the request to the model and the waiting for the end of the simulation. A simulation started by the agent goes on – stop it on the Simulation tab

The buttons New chat, settings, Send and Stop have one width, so the right edge of the conversation and of the message field is the same.

The agent works: the state line shows the step and the progress of the simulation (Claude Code is working... (step 4) - simulation running: cycle 1 / 1); every command of the agent with its result

Answer live: with all three ways of connection (A, B, C, see Configuration) the answer appears word by word while the model writes it. When a block of text is complete, it is shown formatted (bold, lists, code). Reasoning blocks of the model (thinking) are supported: they are kept in the conversation and sent back to the model, but not shown.

Tables in the answers of the agent (Markdown tables, e.g. the cycle times of the robots) are shown with aligned columns in a fixed-width font, so the numbers stand one below the other.

A full answer: cycle time of the station, table of the cycle times of the robots (aligned columns), waits, a request race on zone 1, contacts and the programs that were not simulated; state line context 40 % (green) and the tokens of the chat

Usage in the state line: after the first answer the state line shows context NN % – how full the context window of the model was with the last request (setting Context window [tokens]) – and the tokens of this chat (in, out), optionally with (NN % of the limit) of the setting Token limit per chat. The colors are like in the window of Anthropic: green below 60 %, orange below 85 %, red from 85 %. When it is red, start a New chat – a full context makes the agent slower and less exact. The limit is only a warning, the agent does not stop.

Change of the provider or the model: a new provider or model (in the settings) always starts a new chat – the token counters start from zero. When the change is made while the agent works, the current task is finished first and the new chat starts as soon as the agent has finished.

Messages while the agent works: a message sent while the agent works waits in a queue ((queued - sent when the agent has finished; …)) and is sent when the agent has finished; Stop ends the waiting. Exception in the ways A and C (API): when the agent waits for the end of the simulation, your message ends this waiting and goes to the agent at once ((sent to the agent while it waits for the simulation)). The agent handles it – e.g. hiding the paths works during the simulation – and then waits again. The simulation goes on. In the way B (Claude Code) the message always waits in the queue. The commands in the chat (/help, /reload and the direct commands of the simulator) never wait – they run at once.

Question before the first real data: when the anonymous mode is off, the first message of a DReS session that would go to the model is held, and the chat asks (orange Question) whether the real data of the cell may be sent. Answer in the chat: YES (also JA / TAK) – send the real data (asked only once per session); ANON – switch on the anonymous mode and send the data anonymized; NO (NEIN / NIE) – cancel, nothing is sent. Another text gives Please answer YES, ANON or NO. The local commands (/help, /status …) work also while the question waits. The question can be switched off in the settings: check box Ask before the first sending of real data (YES / ANON / NO) (in the simulator on by default, see Settings).

Font size of the conversation and of the message field: Ctrl + mouse wheel, Ctrl+Plus / Ctrl+Minus or the context menu (Larger font, Smaller font), 7 … 32 pt. The size is remembered (setting RCS_Group/AiChat_FontSize).

The tabs of the bottom area (Message Window / AI Agent) have their titles at the top; the tab of the agent carries the AI icon.

Welcome: every time the plugin is opened and after New chat the chat shows a short line with a link to this documentation and the hint type /help.

The AI Agent tab after New chat: welcome line with the link to this documentation

Commands in the chat (they work locally – no request to the model, no license and no API key needed):

/help: what the agent does, examples, the commands, the connection and the log
Direct command /set: the simulator answers at once (JSON) – without the model, no tokens
No tokens: an API command sent in the AI Agent window (starting with /) does not use any tokens – it does not go to the model; the simulator runs the command at once and shows the answer (JSON) in the conversation.

Tools of the agent: rcs_command – any command of the command API, run inside the simulator (no pipe, no windows); wait_until_idle – waits until loading, preparation, simulation and robustness test are over; read_doc – reads the pages doc\rcs_*.html of this documentation (e.g. rcs_api before it uses a command it does not know). Steps per message in the settings limits the number of commands for one message. A file the user names ("load my example", "the last simulation") the agent finds in the list of the recent simulations (command recent_files) – it does not search the disk.

Instructions of the agent: <installation>\template\RCS\AIAgent\rcs_agent_instructions.md (the default knowledge file; can be adapted or extended by your own files). The standard procedure find all possible collisions:

  1. state of the simulator (load the station if needed),
  2. tool models on the robots (only when the user asks: tool_model, check with robot goto in a weld point, see Tools on the robots),
  3. HOME first: before every simulation of a program / Folge all robots go to HOME with Folge 125 (run folge=125 loops=1 sps=false, wait for the end); only then the real run – otherwise the cycle times start from random positions,
  4. learning run: 1 normal cycle, cycle time and order of the robots,
  5. request races and the Interlock priority blocks added to the SPS program,
  6. work zones and Check interlocks (MISSING, LATE, EARLY, ...),
  7. robustness test with Live 3D and a plan made by the agent for the risky places,
  8. round 2 when places are still not checked,
  9. report: cycle time, races, every collision place with its cause, what could not be tested.
The agent never changes robot programs – it simulates, analyses and reports; fixes are only proposals. Changes of the SPS program of the simulator (Interlock priority blocks) are reported in the chat.

The agent always answers every message – also when something cannot be done: then it says why (e.g. the work zones are not calculated yet). The instructions contain a dictionary of the display, so the agent uses the same words as the 3D view: green zones = area of one robot only, yellow = common area with an interlock, red = common area without an interlock; paths in the colors of the interlocks, labels. The zones must be calculated first (command zones) – not while the simulation runs.

License: the window needs the additional license API / CLI (L_248_API). Without it the messages are rejected and the group of the connection in the settings is locked (/help and /reload still work; the direct commands follow the rules of the command API).

Anonymous mode

In the anonymous mode the model does not see the names of the cell: the simulator replaces them by identifiers before a text goes to the model and puts the real names back in what comes from the model. The study runs as usual – the agent simulates, checks and reports with R1, R2 … instead of the robot names.

SwitchHow
Chat/anonymous on | off (also /anon on | off); /mode shows the mode and the key R1 = 0001R01, R2 = 0001R02, …
SettingsTools > Settings... > AI Agent: check box Anonymous mode - the model sees R1, R2 ..., <file N> and <name> instead of the robot names, file paths and plant identifiers
APIcommand ai_chat, parameter "anonymous": true | false; the answer has the fields anonymous and consentPending (see the command API)

Switching the mode starts a new chat. While the mode is on, the state line shows anonymous in green.

DataWhat the model sees
robot names, in all forms (e.g. 0001R01, also short forms in comments: number of the station + R01)R1 … Rn – in the alphabetical order of the robots of the scene
file paths<file N>
identifiers of the plant, line and part (words with digits and underscores; 2–4 letters + 3 digits) <name>
Folge / UP numbers, points, signals, times, robot model (e.g. KR 210 R3100-2)unchanged

Both directions: the answers of the commands and your messages go to the model with the identifiers; the commands of the model (e.g. {"cmd":"robot","robot":"R2","goto":"UP42/P5"} or {"cmd":"load","file":"<file 1>"}) come back to the simulator with the real names; the answer of the agent is shown to you with the real names. The lines of the tools in the chat show what the model saw.

All connections: Anthropic API (A), Claude Code (B) and VW LLMaaS / OpenAI-compatible API (C). With Claude Code the MCP server VeRa gets the environment variable DRES_AI_ANON=1 and adds "anon": true to every command of the simulator; in this mode Claude Code may not read files (no Read, Grep, Glob – the files contain the real names).

Speed: the simulation itself is not changed and not slower – only the text of the commands and answers is translated (fractions of a millisecond). The key (real name ↔ identifier) stays only in the memory of the simulator.

When the mode is off, the chat asks before the first real data are sent (YES / ANON / NO, see Question before the first real data).

Limits: names that do not look like the patterns above (e.g. free words in comments) can still reach the model. For data of a customer (VW: Confidential) prefer a model in the company network (VW LLMaaS) or the anonymized study.

Configuration step by step

Your own access to the AI model: the agent uses your account or API key (Anthropic, an OpenAI-compatible service such as VW LLMaaS / Azure OpenAI, your own claude.ai account) or a local model. The usage of the model is paid directly to your AI provider under your own contract – DReS adds no AI fees and no usage limits of its own.

Choose one of the three ways to connect the agent to a language model. For all of them the license API / CLI is needed.

WayAccount / costsSpeed and how it works
A. Anthropic API – API keyconsole.anthropic.com; you pay for the tokens, separate from a Claude Pro / Max planthe fastest: DReS talks with the model directly, the commands of the simulator run in the program itself; the answer comes live (SSE stream)
B. Claude Code – your claude.ai account (Pro / Max)no API key; tokens from the limit of your plan; only for your own useslower: every message goes through the local Claude Code, the local MCP server AIAgent\vera_mcp.py (Python) and the pipe of the command API of the simulator; Claude Code adds its own large instructions. The first message of a chat starts the process (a few seconds), the next ones go to the running session. A message sent while the agent waits for the simulation waits in the queue (it does not end the waiting)
C. VW LLMaaS / OpenAI-compatible APItoken of the LLMaaS portal (or of another provider)like A: directly from DReS, answer live (SSE stream)

A. Anthropic API (Claude) – with an API key

  1. Open console.anthropic.com and create an account. In Settings > Billing buy credit: you pay for what you use. The API is not part of a Claude Pro / Max plan.
  2. Settings > API Keys > Create Key. Copy the key (sk-ant-...) – it is shown only once.
  3. In the simulator: Tools > Settings... > AI Agent. Provider: Anthropic API (Claude), paste the key in API key / token. Model: empty = claude-sonnet-5-5; claude-opus-5-5 is more exact and costs more. OK.
  4. Tab AI Agent: type /help, then your message, e.g. "Run the simulation of the station and find all possible collisions".

B. Claude Code – your own claude.ai account (Pro / Max), no API key – only for your own use

  1. Install Claude Code (claude.com/claude-code).
  2. Log in – before the first use and when the session has expired: the program claude.exe started by the simulator has its own login, independent of the Claude desktop application. Open a terminal (e.g. cmd or PowerShell), run claude, log in with /login (your claude.ai account) and close it with /exit. When the login is missing or has expired, the chat shows Failed to authenticate… and a red hint with these steps – log in and send the message again.
  3. Python 3 must be installed – it runs the MCP server AIAgent\vera_mcp.py (found automatically, see Python below).
  4. In the simulator: Tools > Settings... > AI Agent:
    • switch on Command API of the Robot Cell Simulator for the AI agent and scripts (pipe DReS_RCS_API) – Claude Code controls the simulator through the MCP server VeRa;
    • Provider: Claude Code - your claude.ai account (own use only);
    • Claude Code program and Python: filled in automatically the first time the settings are opened; check them or choose the file with the button next to the field;
    • Model: empty = the default of Claude Code (e.g. sonnet or opus); OK.
  5. Tab AI Agent: write your message.

How it works: the first message of a chat starts claude -p --input-format stream-json --output-format stream-json --include-partial-messages ... with the MCP server VeRa (tools rcs and status); the next messages go to this running process. The knowledge files go in as additional instructions (--append-system-prompt-file), the documentation doc\ can be read (tool Read). The conversation goes on (--resume); New chat starts a new process and a new session. The tokens come from the limit of your plan; the state line shows the tokens used.

Limits of the way B: only for yourself – every user needs his own Claude Code and his own account. For a product for customers use an API key (A) or LLMaaS (C). Long studies can reach the limits of the plan.

C. VW LLMaaS or another OpenAI-compatible API

  1. Tools > Settings... > AI Agent, Provider: OpenAI-compatible API.
  2. Address: the address from the LLMaaS portal (.../chat/completions); API key / token: your token.
  3. Key header: Authorization (Bearer token, default) or api-key (Azure OpenAI).
  4. Model: a model from the LLMaaS list, e.g. claude-sonnet-4.6 or gpt-5.1; OK.
  5. Data: only Confidential or lower (see Data protection below).
Tools > Settings... > AI Agent: provider Claude Code, Claude Code program and Python with the buttons to choose the file, address, key, header, model, steps, context window, token limit, knowledge files (Add..., Remove, Default, Refresh knowledge), Documentation in the lower left corner

Settings (Tools > Settings... > AI Agent, group AI agent window (tab next to the messages) – connection to the model):

Shared connection: the connection (provider, address, API key, model, steps, context window, token limit, anonymous mode) is common with the AI Agent window of the editor – the key is entered once for both. Separate per program: the knowledge files and the check box Ask before the first sending of real data (YES / ANON / NO).
FieldMeaning
ProviderAnthropic API (Claude), OpenAI-compatible API (VW LLMaaS, Azure OpenAI, OpenAI, local Ollama) or Claude Code - your claude.ai account (own use only) (see Configuration step by step, way B)
Claude Code programonly for Claude Code: the program claude.exe (or claude.cmd). The button next to the field selects the file. When the field is empty, it is filled in the first time the settings are opened (saved with OK); search order: PATH, %USERPROFILE%\.local\bin\claude.exe, npm (%APPDATA%\npm\claude.cmd), WinGet (%LOCALAPPDATA%\Microsoft\WinGet\Links\claude.exe)
Pythononly for Claude Code: Python 3 that runs the MCP server AIAgent\vera_mcp.py. The button next to the field selects python.exe. Instead of the default python the field is filled in the first time the settings are opened (saved with OK): the newest Python 3.x from the registry (Software\Python\PythonCore, first the user, then the computer), otherwise python from the PATH without the alias of WindowsApps (Microsoft Store)
Addressaddress of the API; filled with the default address of the provider (https://api.anthropic.com/v1/messages for Anthropic, https://api.openai.com/v1/chat/completions for the OpenAI-compatible API) – it changes with the Provider; your own address stays. VW LLMaaS: the address from the LLMaaS portal (.../chat/completions). Empty and locked for Claude Code
API key / tokenstored obfuscated in the settings of this user
Key headeronly for the OpenAI-compatible API: Authorization (Bearer token, default) or e.g. api-key (Azure OpenAI)
Modelname of the model; empty = claude-sonnet-5-5 (Anthropic), gpt-4.1 (OpenAI-compatible) or the default of Claude Code (e.g. sonnet, opus); VW LLMaaS e.g. claude-sonnet-4.6, gpt-5.1
Steps per message5 … 500 (default 60): most commands of the agent for one message – protects against loops and costs
Context window [tokens]8000 … 2000000 (default 200000): context window of the model (Claude: 200000, some models 1000000). The state line shows in color how full it is (Usage). Setting RCS_Group/AiChat_Context
Token limit per chat0 = no limit (default): tokens of one chat (in + out) for the colored percentage (NN % of the limit) in the state line. Only a warning – the agent does not stop. Setting RCS_Group/AiChat_Budget
Anonymous mode - the model sees R1, R2 ..., <file N> and <name> instead of the robot names, file paths and plant identifierscheck box (default off): the anonymous mode, the same as /anonymous on | off in the chat and ai_chat anonymous in the API; a change starts a new chat. Setting RCS_Group/AiChat_Anonymous
Ask before the first sending of real data (YES / ANON / NO)check box (in the simulator default on, in the editor off): when the anonymous mode is off, the first message of a DReS session with real data waits for the answer YES / ANON / NO (see Question before the first real data); off = the messages are sent without the question. Separate for the simulator and the editor
Knowledge fileslist of Markdown / text files (.md, .txt) sent to the model as the instructions of the agent, in the order of the list: the procedure, rules of the cell, your own notes. Buttons: Add... (select one or more files), Remove (the selected files), Default (only template\RCS\AIAgent\rcs_agent_instructions.md), Refresh knowledge (saves the list and loads the files again into the AI Agent window – after you changed a file; the conversation stays). Below the list: summary n file(s), x characters (about y tokens) and the files that were not found. Setting RCS_Group/AiChat_Knowledge
Documentationbutton at the left of the OK / Cancel row of the settings window (shown while the tab AI Agent is open): opens this description (Configuration step by step) in the web browser

Credit and costs (way A): the remaining credit is shown only in console.anthropic.com > Billing; the usage and the costs in Console > Usage / Cost. Through the API they can be read only with an administration key of the organization (sk-ant-admin...), not with the normal API key – the simulator does not read them. In the window: the tokens of the chat in the state line and every request in the log of the agent.

The knowledge is read once – with the first message, with Refresh knowledge, /reload or OK in the settings – and stays the same between the requests. The provider can then use its prompt cache, so long instructions cost less. A changed file is used only after /reload or Refresh knowledge.

Fixed system instructions: the instructions sent to the model contain only the knowledge files – no changing data of the scene (number of robots, state). The agent reads the current state itself with the command status. So the instructions stay the same during the whole chat and the prompt cache works. After /reload or a change of the knowledge the reasoning blocks of the model (thinking) of the earlier answers are removed from the history (they are signed for the old instructions – the API would answer HTTP 400 Invalid signature in thinking block); the conversation itself stays.

Log of the agent: %TEMP%\dres_rcs_agent\ai_agent_YYYYMMDD.log (one file per day). It holds every entry of the conversation, the commands and the full results of the tools (the window shows only a short form), HTTP errors with the text of the answer, and for Claude Code the final result, its error output (stderr) and the exit code. /help shows the path. The folder %TEMP%\dres_rcs_agent also holds the working files of the provider Claude Code (mcp_vera.json – the MCP server VeRa, rcs_agent_prompt.md – the instructions of the agent); they are written again for every message.

Problems (the details are in the log of the agent):

SymptomCauseWhat to do
Failed to authenticate…, Not logged in, OAuth token has expired + red hint Claude Code is not logged in…Claude Code (way B) was never logged in or the session has expired; its login is independent of the Claude desktop applicationopen a terminal (e.g. cmd or PowerShell), run claude, log in with /login (claude.ai account), close it with /exit, send the message again
Claude Code not found…claude.exe is not installed or not in the searched places (PATH, %USERPROFILE%\.local\bin, npm, WinGet), or the path in the field does not existinstall Claude Code or choose the file in the field Claude Code program (button next to the field)
Claude Code reaches the simulator through its command API – switch it on…the command API of the simulator is offTools > Settings... > AI Agent: switch on Command API of the Robot Cell Simulator for the AI agent and scripts
MCP server not found: …, or the agent has no tools rcs / statusthe file <installation>\AIAgent\vera_mcp.py is missing, or Python was not found / is the alias of WindowsAppsrepair the installation; install Python 3 (python.org) or choose python.exe in the field Python (button next to the field)
No API key – Tools > Settings... > AI AgentAnthropic API or OpenAI-compatible API without a keypaste the key in API key / token (way A or C)
Request to the model failed (HTTP …)Anthropic / LLMaaS: wrong address, key or model name, no credit, or the networkcheck Address, API key / token, Key header and Model; the answer of the server is in the log
Limit of n steps reached – the agent stopsthe agent needed more commands than Steps per messagesend go on, or raise Steps per message in the settings
context NN % red in the state line, the agent gets slow or forgets thingsthe context window of the model is almost full (long chat, many results of commands)start a New chat; check Context window [tokens] in the settings
(NN % of the limit) orange / redthe chat used most of the Token limit per chatonly a warning; start a New chat or raise the limit
Claude Code (way B): the first answer comes only after some seconds, a message during the simulation waits the first message starts the process of Claude Code; in the way B a message during the waiting goes to the queuenormal; for faster answers use the way A or C (see comparison)
HTTP 400 about a thinking blockan older version sent an empty reasoning block backfixed: reasoning blocks are put together from the stream; if it still appears, start a New chat and send the log to the support
HTTP 400 … Invalid signature in thinking blockan older version changed the instructions of the agent during the chat (data of the scene, /reload) – the signed reasoning blocks in the history did not fit any morefixed: the instructions stay the same and after /reload the reasoning blocks are removed from the history; if it still appears, start a New chat
a /… message gives an error instead of an answer of the agenta message starting with / and a letter is a direct command of the simulator (unknown command, wrong parameter, missing license)see the command API; for a question to the agent do not start the message with /
orange Question: send the real data? YES / ANON / NO; the message is not sent the anonymous mode is off and this is the first message of the DReS session that goes to the modelanswer in the chat: YES (real data, asked once per session), ANON (anonymous mode on, data anonymized) or NO (nothing is sent), see Question before the first real data; through the API: ai_chat answer consentPending true, answer with message "yes" | "anon" | "no"
Data protection: the agent sends your messages, the answers of the simulator commands (names of robots, programs and points, times, collision cases) and its instructions to the model of the provider. Check that this is allowed for your data (VW: data Confidential or lower). The anonymous mode replaces the names of robots, files and the plant by identifiers. For data that must not leave the company use an anonymized study or a model in the company network.

Script / API: command ai_chat (message, newChat, stop, last, anonymous – answer busy, transcript, anonymous, consentPending), see the command API. Other ways to use AI: anonymized study for an AI assistant, the AI Agent window of the editor (same connection) and VeRa (voice control, AI assistant over MCP).



« Robustness test | Contents | Anonymised study for AI »