Merlin Agent Builder
The Merlin agent builder helps you design, configure, and run AI agents directly inside Tray. Agents combine AI models with your data and workflows, so they can act with context from your business systems.
If you're interested in using this feature, please reach out to your Customer Success Manager or Account Executive.
What is an AI Agent? Copy
An AI (Artificial Intelligence) agent is an autonomous system that can understand its environment's context, make decisions, and take actions to achieve specific goals. Unlike simple chatbots that only respond to questions, AI agents can:
Understand context from multiple data sources
Reason about problems using available information
Take concrete actions through connected systems
Learn and adapt their responses based on outcomes
Think of it this way: While a chatbot might tell you "Your order status is unknown," an AI agent can check your order system, payment processor, and shipping provider, then either give you a complete status update or automatically resolve any issues it finds.
Components of an Agent on TrayCopy
If you're familiar with building on the Tray platform, you can build an agent project that consists of:
Agent scope - what you want your agent to do
Defines your agent's goals and behavior. This is critical for guiding the agent to successfully complete tasks. You provide relevant information to outline the agent's goals, specific instructions, and the style in which you want the agent to respond.
Data sources - what information it can access
Connect your existing systems (Google Drive, Confluence, databases, etc.) to create a searchable knowledge base that your agent references when it needs context to make informed decisions.
Workflows as tools - what actions it can take
Let your agent perform tasks by running chosen workflows, everything from running data queries to creating tickets to sending notifications. We provide prebuilt tools to help you get started, but you can also build your own bespoke tools using Tray's visual workflow builder.
AI model - the brain that makes decisions
The LLM (Large Language Model) that powers decision-making. Your choice of model depends on your specific needs:
Task complexity - simple queries vs. complex reasoning
Response speed - fast responses vs. thorough analysis
Cost considerations - usage-based pricing varies by model
Context requirements - how much information the model needs to remember
Agent workflow - how it all works together
This specialized Tray workflow acts as the orchestrator, using agent connectors to coordinate everything. It follows your scope guidelines, leverages your chosen AI model to understand requests and make decisions, searches your knowledge base for relevant information, and executes the appropriate tools to complete tasks.
Each Tray agent is a Tray project where these components work together to deliver intelligent automation that understands your business context and takes real actions across your tech stack.
PrerequisitesCopy
Workspace permissions required:
Agent Builder feature enabled on your workspace (contact your workspace admin if you don't see the Agent Builder option)
Project Editor role with the workspace
Billing considerations:
Tray native AI model is included with your plan
Data sources and tools consume standard workflow tasks from your plan allocation
Bring Your Own (BYO) AI models (OpenAI, Anthropic, etc.) require separate billing with those providers
Getting startedCopy
Create your agent project On the Projects page, click "Add project" and select "Merlin Agent Builder". Choose from these options:
Knowledge agent
- Pre-configured for information retrieval and Q&A
ITSM agent
- Set up for IT service management tasks
Support ticket agent
- Designed for customer support workflows
Blank agent
- Start from scratch with full customization
We recommend starting with one of the pre-configured agents ("agent accelerators") to understand how agents work before building custom ones. After selecting your agent type, enter a project name to create your agent.
Configure your agent Your agent dashboard contains everything you need to set up:
Agent scope
- If using an accelerator, the default prompt is ready for testing. You can customize it later based on your specific needs.
Data sources
- Connect a test data source - e.g. add a test folder from Google Drive with sample documents so your agent has knowledge to reference when answering questions. More information on Adding a data source
Tools
- All agents include Knowledge Search Tool by default. Add more tools from templates or create custom ones as your use case requires More information on Tools
Test your agent Navigate to the "Test" tab to interact with your agent like your end users would. Ask questions about its capabilities or request information from your connected documents. Make sure any data sources have finished syncing before testing - you'll see the sync status in your data sources list.
Deploy your agent Your agent is automatically available via API. Find the deployment URL in "Interaction Channels" - it follows the format
https://<id>-api.trayapp.io/ai-agent
. Use this endpoint to integrate your agent into applications. For more details, see Interaction channelsYou can continue adding tools, data sources, and refining your agent scope as you expand functionality.
Configuring your agentCopy
When you open an agent project, you'll see the agent dashboard.
This is your control center for:
Agent scope Copy
Agent scope defines what your agent knows and how it behaves. Think of it as the agent's job description and personality guide.
If you're using one of the pre-configured agents accelerators (Knowledge agent, ITSM agent, or Support ticket agent), they come with predefined scope tailored for their specific use cases. This gives you a working starting point that you can customize based on your needs.
Be specific about the role:
1You are a customer support agent for [Company Name], specializing in billing and subscription questions.
Define capabilities and limitations:
1You can help with:2- Billing questions and payment issues3- Subscription upgrades/downgrades4- Account access problems56You should escalate to human agents:7- Technical product issues8- Refund requests over $1009- Angry or frustrated customers
Set the tone:
1Always be professional, helpful, and empathetic. Use clear, non-technical language.
Best practices for agent scopeCopy
Key prompting tips:
Set behavioral expectations - Professional tone, structured responses, etc.
Define limitations clearly - What the agent can't do helps users set appropriate expectations
Use examples - Include sample interactions showing desired behavior: "When asked about pricing, respond with: 'I'll look up our current pricing information for you...'"
Prioritize tasks - Tell the agent what to do first: "Always search the knowledge base before providing any factual information"
Handle uncertainty - Specify what to do when information is unclear: "If you're unsure, ask clarifying questions rather than guessing"
Set error handling - Define fallback behaviors: "If a tool fails, explain the issue and suggest alternative approaches"
Include persona details - Describe the agent's personality: "Be friendly but professional, patient with technical questions, and proactive in offering help"
Specify output format - Request structured responses: "For troubleshooting, use numbered steps. For explanations, use clear headings and bullet points"
Keep it focused - While comprehensive, avoid overly complex instructions that might confuse the AI model. Aim for clear, actionable guidance that helps the agent serve your specific use case effectively.
AI model Copy
Tray native model (default)Copy
Included with your plan
Max context window: up to 1 million tokens
Rate limited
Best for: Getting started, testing
Bring Your Own Model optionsCopy
You can connect your own API keys from third-party AI providers like OpenAI or AWS Bedrock to use their models instead of Tray's default model. Currently supported:
AWS Bedrock
OpenAI
Azure AI
Google Gemini
Setup steps for BYO models
Click "Change Model" in the AI Model section
Select your provider (OpenAI, Anthropic, etc.)
Click "Create New Authentication" or select existing
Enter your API key from the provider
Choose the specific model version
Click "Save"
Advanced settings
Context window (token limit): Default is 32k tokens
Smaller windows (8k-16k) may be faster but limit conversation memory
Standard windows (64k-128k) handle typical conversations and documents well
Large windows (256k-500k) support extensive analysis and long conversations
Maximum supported: up to 1 million tokens for processing entire books, codebases, or complex multi-document workflows
Temperature: Controls response creativity (0.0 = focused, 1.0 = creative). It controls how predictable versus varied the responses will be - lower values (0.0) make responses more consistent and factual, while higher values (1.0) make responses more varied and creative but potentially less reliable.
Recommended defaults
For customer support: Tray native or GPT-4, temperature 0.3
For content creation: Claude-3-Sonnet, temperature 0.7
For data analysis: GPT-4-turbo, temperature 0.1
Data sourcesCopy
Early Access Feature This functionality is currently available to a limited set of users and may change before general release. Contact your Customer Success Manager or sales representative if you're interested in accessing this feature.
Data sources provide knowledge to your agent without making live API calls for every query. This creates a searchable knowledge base that your agent can reference instantly.
OverviewCopy
Connect to a system (Google Drive, Confluence, etc.)
Tray syncs and processes your documents
Content is stored in a vector table (searchable Knowledge Base Core)
Agent searches this Knowledge Base to answer questions
Behind the scenes: adding a data source creates a sub-project with sync workflows. Data is stored in a vector table that enables semantic search, this is also handled by a specialized sub-project. All synced data goes into a single vector table per agent.
Supported data sourcesCopy
Google Drive - Documents, spreadsheets, presentations
Gmail - Email threads and attachments
Confluence - Wiki pages and documentation
Sharepoint - Documents and sites
Custom integrations - Via API connectors
Adding a data sourceCopy
Step 1: Add and configure your source
In the Data sources tab, click "Add Data Source"
Select from available data source types
Authenticate with the selected service
Configure sync settings. Depending on the chosen Data source type, you will have to configure additional settings, e.g.:
Folder / Confluence space selection: Choose what to sync (start narrow)
Gmail Labels / Gmail Search Query / Jira JQL Query: Select appropriate search for items
Include/exclude patterns
Step 2: Initial sync
First sync may take several minutes for large datasets
Check the sync status in the Data sources list for progress updates
Embedded data will be saved in the vector table once processed
Best practices for data sourcesCopy
Start small: Sync one folder or space first to test
Organize source content: Well-structured documents work better
Use descriptive filenames: Helps the agent find relevant content
Update regularly: Enable automatic sync for changing content
Troubleshooting sync issuesCopy
Check the data syncing sub-project workflows by navigating to Data source assets. You can access them by right clicking the three dot menu in the data sources list
Once in the data source sub-project, review execution logs for error messages
Verify permissions on source system
Test with a single document first
Configuration changes: Modifying sync settings may require re-processing all documents.
ToolsCopy
Tools are workflows that your agent can use to take actions. They're the "hands" of your agent - turning conversation into real business impact.
Future note: Tools architecture is evolving. Tools may eventually live in separate projects for better reusability and management.
Tools from templateCopy
Tray offers pre-built tools for common actions:
Send Email - Compose and send emails
Create Jira Ticket - Log issues or requests
Update Salesforce Record - Modify CRM data
Slack Message - Send team notifications
Google Calendar Event - Schedule meetings
For the full list, please check out our template library.
To add a tool from template:
In the Tools tab, click "Add tool" and choose "From Template"
Browse available tools by category
Click "Use template" on your choice
Configure required authentications (if applicable)
Important! The newly added tool will be automatically enabled and visible to the agent. If you need to do more configuration before enabling the tool, you can disable it.
Custom ToolsCopy
To add a custom tool:
In the Tools tab, click "Add tool" and choose "Custom Tool"
Enter a descriptive name for your tool
Write a comprehensive tool description
This step is critical - without a clear description, your agent will never select this tool when deciding how to respond to requests. Your description should include:
when the agent should use this tool
what inputs the tool requires
what the expected outcome will be
why limitations or constraints
Click on the newly created tool to customize the underlying workflow
Important! The newly added tool will be automatically enabled and visible to the agent. If you need to do more configuration before enabling the tool, you can disable it.
Good descriptions
1"Use this tool to send email notifications to customers about order status updates. Required: customer email, order number, status message."23"Create a Jira ticket for technical issues that need developer attention. Include problem description, affected systems, and priority level."45"Send a Slack message to the #alerts channel when urgent issues need immediate team attention."
Bad descriptions
1"Sends emails" (too vague)23"Use when needed" (no clear trigger)45"Handles tickets" (unclear purpose)
Disabling toolsCopy
If you have tools in your agent project that you don't want to delete - perhaps they're still in development or temporarily not needed - you can disable them instead. When a tool is disabled, the agent won't see it or consider it when selecting tools to complete a task.
To disable a tool:
Go to your Tools list
Click the three-dot menu next to the tool you want to disable
Click "Disable tool"
Best practices for toolsCopy
Start with templates before building custom tools
Test extensively in different scenarios
Use comprehensive descriptions that explain the action
Handle errors gracefully with fallback options
Limit tool count - too many options confuse the agent
Interaction channelsCopy
Interaction channels are how users connect with your agent. Currently supported:
API endpoint
Coming soon:
Slack app integration - Deploy agents directly into Slack channels
Teams integration - Microsoft Teams bot deployment
API endpointCopy
Go to "Interaction Channels" tab
Copy the endpoint URL
Use standard
HTTP POST
requests
The response format is determined by your tool's workflow response schema. To preview the expected format, navigate to the tool's workflow and examine the response schema in the "Trigger Event Reply" step.
Integration examples:
Embed in your helpdesk system
Connect to chatbots or voice systems
Integrate with mobile apps
Power internal tools and dashboards
TestingCopy
The built-in test environment lets you interact with your agent safely before deployment.
Using the test chatCopy
Click the "Testing" tab
Type messages as if you were a real user
Watch how your agent responds
Check if tools are being used correctly
Example test scenariosCopy
Basic conversation - e.g. "Hello, what can you help with?"
Knowledge questions - ask about content from your data sources
Tool activation - request actions your tools can perform
Edge cases - unclear requests, requests outside scope
Error handling - what happens when tools fail?
Test agent responses show:
The actual reply your users will see
Whether knowledge base was searched
Which tools were considered or used
Processing time and token usage
Use logs to get additional insights into agent responses.
Test limitationsCopy
No persistent history, each test session is independent
Test conversations aren't saved
LogsCopy
Early Access Feature This functionality is currently available to a limited set of users and may change before general release. Contact your Customer Success Manager or sales representative if you're interested in accessing this feature.
Agent interactions and executions are logged to help you monitor performance and debug issues. Unlike standard workflow logs that show input/output for each step, agent logs provide detailed insight into the AI decision-making process.
Log structureCopy
Each agent request generates a detailed log containing:
Prompt - The exact user prompt or query sent to the agent
Reasoning - Detailed breakdown of how the agent processed the request:
Select tool - Shows the tool selection process, including:
What data was analyzed to make the decision
Which tool was selected and why
Parameters passed to the selected tool
Execute tool - The complete output returned by the executed tool
Response - The final human-readable response sent back to the user