Agent Editor Workflow Guide
Quick reference for using Agent Editor in Studio Pro 11.12.0+ to define, test, and deploy GenAI agents.
See GLOSSARY for detailed term definitions and technical details.
Document Types
Agent Editor provides four document types (add via Add other menu at module level):
- Model: Links to Mendix Cloud GenAI text generation resource
- Agent: Defines prompts, tools, knowledge bases, and settings
- Knowledge Base: Configures RAG (retrieval-augmented generation)
- Consumed MCP Service: Connects to external MCP tool servers
Configuration Workflow
1. Define Model (Required)
- Create Model document
- Set constant with GenAI resource key
- Click "List Models" to validate
2. Define Agent (Required)
- Create Agent document, select Model
- Write System prompt (use
{{placeholders}} for dynamic values)
- Select Context entity if using placeholders
- Optional: Configure model settings (max tokens, temperature, TopP)
3. Add Tools (Optional)
- Microflow tools: Select microflow returning String, add Name/Description
- MCP tools: Create Consumed MCP Service first, configure endpoint/credentials
- Use Active checkbox to enable/disable during testing
4. Add Knowledge Bases (Optional)
- Create Knowledge Base document
- Link to agent, select collection
- Add Name/Description for LLM to understand when to use it
- Configure Max results and Min similarity threshold
5. Test
- Switch to Playground mode (top right switcher)
- Requires: app running locally, no errors, after-startup configured
- Click Test button, review Console logs
- Iterate: edit in Build mode → restart app → test in Playground
6. Integrate
For Microflows:
- Use "Call Agent without History" for task agents (single call)
- Use "Call Agent with History" for chat agents (multiple messages)
- Pass context object when using placeholders
For Conversational UI:
- Use "New Chat for Agent" to create a ChatContext for the selected Agent
- Pass chat context to conversational UI snippets or pages
- Enables multi-turn conversations with history
7. Deploy
- Agent documents deploy with app model
- Override constants per environment (keys, endpoints)
Prompts and Placeholders
System Prompt (Required)
Defines agent behavior, personality, and capabilities.
User Prompt (Optional)
Template for task-style execution with placeholders.
Placeholders
Use {{attributeName}} syntax - must match Context entity attribute names exactly.
Example:
System: "You are a {{role}} assistant for {{companyName}}."
Context Entity: ServiceContext with attributes: role, companyName
Agent Modes
Switch between modes in top right corner of Agent Editor:
Build Mode: Configure prompts, tools, knowledge bases, settings
Playground Mode: Test interactively
- Requires running app
- Test one shot task agents or multi-turn chat agents
- See real-time tool calls and responses
Common Patterns
Task Agent: System + User prompts, optional multiple tools and KBs
Chat Agent: System prompt only, optional multiple tools and KBs
Troubleshooting Quick Reference
| Issue |
Solution |
| Playground not available |
Start app locally |
| Test button disabled |
Deploy app locally after changes; ensure agent documents synchronized |
| Test results in error |
Check Console pane for details; verify model config and after-startup logic |
| App does not start locally |
Set encryption key; verify all constants have valid values |
| Agent documents not visible in Agent Commons runtime UI |
Verify ASU_AgentEditor is configured as after-startup microflow; restart app |
| MCP tools cannot be listed |
Verify endpoint constant, protocol version, credentials microflow |
| MCP tools fail at runtime |
Check Console pane; verify endpoint reachable; check /agenteditor logs |
| No KB collections listed |
Verify Knowledge base key constant and connectivity |
| Extension not loaded after install |
Restart Studio Pro; check View > Extensions to confirm loaded |
| Consistency check timeout error |
Sync app directory (F4) or make small change to any agent document |
First-Time Setup
After installing Agent Editor from Marketplace:
- Add
/agenteditor to .gitignore (not excluded automatically)
- Set 32-character encryption key (App > Settings > Configuration)
- Set
ASU_AgentEditor as after-startup microflow (App > Settings > Runtime)
- Install all required dependencies
- View compatible versions: Extensions menu > Agent Editor > Compatibility
- Opens module dependency overview showing required modules and compatible versions
- Obtain GenAI resource keys from Mendix Cloud GenAI Portal
- Create constants for keys
Module Usage Rules
CRITICAL: Agent Editor Commons is Read-Only
What You CAN Do
- Reuse logic from the USE_ME folder: Copy patterns, reference examples, and use template agents from the USE_ME folder
- Call the documented toolbox actions: Use "Call Agent without History" and "Call Agent with History" actions in your microflows
- Use the documented domain model entities: Work with
Response, Request, and other GenAI Commons entities
- Create Agent documents: Define your own agents using the Agent Editor extension
What You CANNOT Do
- Modify Agent Editor Commons logic: Do NOT change any microflows, pages, or logic within the Agent Editor Commons module
- Use private folder logic: Do NOT call or reference any microflows, entities, or logic from private folders
- Extend the module directly: Do NOT add custom logic to the Agent Editor Commons module
Extension Pattern
If you need to extend or customize Agent Editor functionality:
- Create a separate module in your app (e.g.,
MyCustomAgents)
- Import or reference only the documented toolbox actions and domain model from Agent Editor Commons
- Implement your custom logic in your own module
- Use agents and microflows from the USE_ME folder as templates, but implement them in your module
This separation ensures:
- Your customizations survive module updates
- Module upgrades don't break your custom logic
- Clear separation between platform code and application code
- Compliance with Mendix module development best practices
Limitations
- Only Mendix Cloud GenAI supported (more providers planned)
- Mac support limited
- MCP whole-server only (no individual tool selection yet)
- Tool Choice "Tool" only for microflows currently
Reference Links
Access helpful resources via Extensions menu > Agent Editor > Onboarding in Studio Pro.
1---2name: agenteditor3description: Guide for all tasks related to GenAI agents in Studio Pro, including creating, configuring, deploying, troubleshooting, and integrating agents. Use whenever a request mentions agents, AI agents, assistants, models, knowledge bases, MCP services, agent workflows, or agent integration.4---56# Agent Editor Workflow Guide78Quick reference for using Agent Editor in Studio Pro 11.12.0+ to define, test, and deploy GenAI agents.910_See [GLOSSARY](references/GLOSSARY.md) for detailed term definitions and technical details._1112## Document Types1314Agent Editor provides four document types (add via Add other menu at module level):1516- **Model**: Links to Mendix Cloud GenAI text generation resource17- **Agent**: Defines prompts, tools, knowledge bases, and settings18- **Knowledge Base**: Configures RAG (retrieval-augmented generation)19- **Consumed MCP Service**: Connects to external MCP tool servers2021## Configuration Workflow2223### 1. Define Model (Required)2425- Create Model document26- Set constant with GenAI resource key27- Click "List Models" to validate2829### 2. Define Agent (Required)3031- Create Agent document, select Model32- Write System prompt (use `{{placeholders}}` for dynamic values)33- Select Context entity if using placeholders34- Optional: Configure model settings (max tokens, temperature, TopP)3536### 3. Add Tools (Optional)3738- **Microflow tools**: Select microflow returning String, add Name/Description39- **MCP tools**: Create Consumed MCP Service first, configure endpoint/credentials40- Use Active checkbox to enable/disable during testing4142### 4. Add Knowledge Bases (Optional)4344- Create Knowledge Base document45- Link to agent, select collection46- Add Name/Description for LLM to understand when to use it47- Configure Max results and Min similarity threshold4849### 5. Test5051- Switch to Playground mode (top right switcher)52- Requires: app running locally, no errors, after-startup configured53- Click Test button, review Console logs54- Iterate: edit in Build mode → restart app → test in Playground5556### 6. Integrate5758**For Microflows:**5960- Use **"Call Agent without History"** for task agents (single call)61- Use **"Call Agent with History"** for chat agents (multiple messages)62- Pass context object when using placeholders6364**For Conversational UI:**6566- Use **"New Chat for Agent"** to create a ChatContext for the selected Agent67- Pass chat context to conversational UI snippets or pages68- Enables multi-turn conversations with history6970### 7. Deploy7172- Agent documents deploy with app model73- Override constants per environment (keys, endpoints)7475## Prompts and Placeholders7677### System Prompt (Required)7879Defines agent behavior, personality, and capabilities.8081### User Prompt (Optional)8283Template for task-style execution with placeholders.8485### Placeholders8687Use `{{attributeName}}` syntax - must match Context entity attribute names exactly.8889**Example:**9091```92System: "You are a {{role}} assistant for {{companyName}}."93Context Entity: ServiceContext with attributes: role, companyName94```9596## Agent Modes9798Switch between modes in top right corner of Agent Editor:99100**Build Mode**: Configure prompts, tools, knowledge bases, settings101102**Playground Mode**: Test interactively103104- Requires running app105- Test one shot task agents or multi-turn chat agents106- See real-time tool calls and responses107108## Common Patterns109110**Task Agent**: System + User prompts, optional multiple tools and KBs111**Chat Agent**: System prompt only, optional multiple tools and KBs112113## Troubleshooting Quick Reference114115| Issue | Solution |116| ------------------------------------------------------- | ---------------------------------------------------------------------------- |117| Playground not available | Start app locally |118| Test button disabled | Deploy app locally after changes; ensure agent documents synchronized |119| Test results in error | Check Console pane for details; verify model config and after-startup logic |120| App does not start locally | Set encryption key; verify all constants have valid values |121| Agent documents not visible in Agent Commons runtime UI | Verify ASU_AgentEditor is configured as after-startup microflow; restart app |122| MCP tools cannot be listed | Verify endpoint constant, protocol version, credentials microflow |123| MCP tools fail at runtime | Check Console pane; verify endpoint reachable; check /agenteditor logs |124| No KB collections listed | Verify Knowledge base key constant and connectivity |125| Extension not loaded after install | Restart Studio Pro; check View > Extensions to confirm loaded |126| Consistency check timeout error | Sync app directory (F4) or make small change to any agent document |127128## First-Time Setup129130After installing Agent Editor from Marketplace:1311321. Add `/agenteditor` to `.gitignore` (not excluded automatically)1332. Set 32-character encryption key (App > Settings > Configuration)1343. Set `ASU_AgentEditor` as after-startup microflow (App > Settings > Runtime)1354. Install all required dependencies136 - View compatible versions: Extensions menu > Agent Editor > Compatibility137 - Opens module dependency overview showing required modules and compatible versions1385. Obtain GenAI resource keys from [Mendix Cloud GenAI Portal](https://genai.home.mendix.com/)1396. Create constants for keys140141## Module Usage Rules142143**CRITICAL: Agent Editor Commons is Read-Only**144145### What You CAN Do146147- **Reuse logic from the USE_ME folder**: Copy patterns, reference examples, and use template agents from the USE_ME folder148- **Call the documented toolbox actions**: Use "Call Agent without History" and "Call Agent with History" actions in your microflows149- **Use the documented domain model entities**: Work with `Response`, `Request`, and other GenAI Commons entities150- **Create Agent documents**: Define your own agents using the Agent Editor extension151152### What You CANNOT Do153154- **Modify Agent Editor Commons logic**: Do NOT change any microflows, pages, or logic within the Agent Editor Commons module155- **Use private folder logic**: Do NOT call or reference any microflows, entities, or logic from private folders156- **Extend the module directly**: Do NOT add custom logic to the Agent Editor Commons module157158### Extension Pattern159160If you need to extend or customize Agent Editor functionality:1611621. Create a separate module in your app (e.g., `MyCustomAgents`)1632. Import or reference only the documented toolbox actions and domain model from Agent Editor Commons1643. Implement your custom logic in your own module1654. Use agents and microflows from the USE_ME folder as templates, but implement them in your module166167This separation ensures:168169- Your customizations survive module updates170- Module upgrades don't break your custom logic171- Clear separation between platform code and application code172- Compliance with Mendix module development best practices173174## Limitations175176- Only Mendix Cloud GenAI supported (more providers planned)177- Mac support limited178- MCP whole-server only (no individual tool selection yet)179- Tool Choice "Tool" only for microflows currently180181## Reference Links182183Access helpful resources via **Extensions menu > Agent Editor > Onboarding** in Studio Pro.184185- [Agent Editor Docs](https://docs.mendix.com/agents/genai-for-mx/agent-editor/)186- [Detailed Glossary](references/GLOSSARY.md)