View this page in the latest version of Appian. Tutorial: Build a Triage Agent Share Share via LinkedIn Reddit Email Copy Link Print On This Page Overview This tutorial shows you how to build an AI agent that automatically assesses and routes incoming cases or requests to the right team. By completing this tutorial, you will: Create a case triage AI agent that reads case details and determines priority and routing Configure tools including record types, expression rules, and process models Define inputs and outputs for seamless integration with your application Test the AI agent to ensure it performs triage decisions correctly Integrate the AI agent into your workflow using the Execute AI Agent smart service Monitor AI agent performance and iterate based on real-world usage When finished, you'll have a working triage AI agent that can automatically categorize cases, assign priorities, route to appropriate teams, and provide reasoning for its decisions. Step 1. Set up supporting objects Before you create the AI agent, you'll need the following supporting objects in your application. Define the triage process: Decide what "triage" means for your application. For example, a triage process might set a priority, assign a category, route to an assignee group, and write a note to the case. Create a Case record type: You'll need a record type for your cases or requests. This record type should include fields for a description, status, priority, and assignee. Create a triage process model: The AI agent needs a process model to perform actions like updating data or sending notifications. Name the process model something descriptive, like PM_UpdateCaseAndAssign. Inside the process model, use the Write Records smart service to update the case record with the AI agent's decisions. You can also include additional nodes to send alerts or trigger related workflows. Use a record type input parameter for your Case record type. This allows an AI agent to automatically populate key fields on the record for you. Note: Using a record type input parameter keeps your process simpler, reduces the chance of field-mapping errors, and ensures consistency across process executions. This tutorial demonstrates how to build your triage agent using a record type. (Optional) Create supporting expression rules: If you have complex logic, create expression rules or decisions that the AI agent can call. For example, you could create calcPriority(case) or routeGroup(category, urgency). Or, instead of configuring an expression rule, you can provide the AI agent with a triage procedure document to guide case triage. (Optional) Identify documents: If the AI agent needs to read information from documents, like a request form or its attachments, make sure they are available. Grouping them in a folder can be helpful. Step 2. Create the AI agent First, create the AI agent and provide its core instructions. In the Build view, click NEW > AI Agent. In the Create AI Agent dialog: For Name, enter Case Triage AI Agent. For Description, add a brief explanation of the AI agent's purpose. For Agent Type, select Process Agent. Click CREATE. In the Instructions section, paste a concise, procedural prompt. You can adapt this example: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 You triage new cases. Given a Case record, do the following: 1. Read the case details and description. 2. Infer the category and urgency from the text and any provided documents. 3. Call the calcPriority() expression rule to get a priority score and map it to Low, Medium, or High. 4. Choose an assignee group using the routeGroup() rule. 5. Summarize your reasoning in a one to two-sentence note. 6. Start the PM_UpdateCaseAndAssign process with the Case record, including the updated priority, category, assignee group, and triage notes. Example triage decision: - Priority: High - Category: Technical Support - Assignee group: Tier 2 Support - Triage notes: "The user reported a critical system error. Routing to Tier 2 for immediate assistance." Constraints: Follow all organizational policies, avoid including personally identifiable information (PII) in notes, and never modify cases that are already closed. Step 3. Add tools Next, provide the AI agent with the tools it needs to perform its tasks. AI agents use different Appian design objects, like record types, expressions, and process models, as tools to accomplish the goals defined in your prompt. Click ADD TOOL. Add the following tools: Record Type: Add your Case or Request record type to give the AI agent read access to case data. Expression Rule: Add any rules or decisions the AI agent needs to call, like calcPriority or routeGroup. Process Model: Add the PM_UpdateCaseAndAssign process model so the AI agent can start it to write updates and send notifications. (Optional) Document or Folder: If the AI agent needs to read specific documents or attachments, add the relevant document or folder tool. Tip: Avoid providing overlapping or redundant tools, as this can confuse the AI agent. Use clear, descriptive names for your tools, for example, "Read Case Data (Record)" or "Update and Assign Case (Process)". Tool selection best practices Start minimal: Begin with three to five tools (a record type, one or two rules, a process model, and an optional document tool). Only add more tools if you identify a clear, repeatable need. Security considerations: The user or account that initiates the AI agent must have permission to access every tool the AI agent may call. If permissions are insufficient, the AI agent will fail to run. Document handling: If the AI agent must read documents, provide it with a Document or Folder tool. The AI agent will determine the best way to interact with the document, like searching, reading the full text, or querying details. AI agents prefer the semantic search document tool for cost efficiency. To include the full document in context, instruct the AI agent to do so. This triggers the read full document tool. Step 4. Define inputs and outputs Configure the AI agent's inputs and outputs so that it can receive data from and pass data to other parts of your application. Inputs caseRecord (Case record type): This is required. The Case record provides all details the AI agent needs to perform triage. attachmentsFolder or requestDoc (Folder/Document): This is optional. Use this if the agent needs to read supporting documents. Tip: Use descriptive names for your inputs so their purpose is clear to other developers. Outputs Define outputs so the process model can receive updated case values from the AI agent. caseRecord (Case record type): Contains the updated priority, category, assignee group, and triage notes after the AI agent finishes triage. Note: The AI agent updates the Case record with new values and passes it to the process model. This avoids manual field mapping and ensures consistency with your data model. Step 5. Save and test the AI agent After configuring the AI agent, test it to ensure it behaves as expected. Go to the Build tab and use the right-hand Test panel. Provide sample values for the inputs: For simple data types like text or numbers, enter values directly in the input fields. For complex inputs like record types, click the expression mode icon next to the input field and enter a SAIL expression. For example: 1 2 3 4 5 6 7 { recordType!Case.fields.id: 12345, recordType!Case.fields.description: "Customer reports login issues and cannot access their account. Issue started this morning.", recordType!Case.fields.status: "New", recordType!Case.fields.priority: null(), recordType!Case.fields.assignee: null() } Click TEST and review the AI agent's response and step history. Consider the following: Did the AI agent read the case data correctly? Did it call your expression rules? Did it start the update process model? Are the outputs populated as you expected? If the AI agent's behavior is not correct, refine the prompt, tool names, or inputs until its performance is consistent. Save your test values as a test case so you can run it again quickly after making changes. Tip: Use expression mode to construct realistic test data that matches your record type structure. This ensures your AI agent is tested with data that closely resembles production scenarios. Step 6. Integrate the AI agent into a process Once the AI agent is working correctly, you can integrate it into your application's workflow. Process-driven: On case creation or update, start a process that uses the Execute AI Agent smart service. Pass the caseRecord to the AI agent. The agent will return the updated record, which you can write directly using the Write Records smart service. On-demand: Add a "Triage Now" button to an interface that starts the same process for a selected case. The process retrieves the case record, executes the AI agent, and writes the updated record back to the database. For detailed guidance on process integration, see Use AI Agents in a Process. Step 7. Monitor and iterate After deploying your AI agent, monitor its performance to identify areas for improvement. Use the AI agent's Monitor tab to track requests, tool calls, processing durations, and any errors. Review a few detailed runs each day after initial deployment. If the AI agent struggles with certain cases, create test cases to improve your prompts and tools and confirm the results. Best practices and considerations Keep the following guidelines in mind when building and maintaining your AI agent. For comprehensive best practices, see Best Practices for Designing AI Agents. Versioning: Save new versions of your AI agent frequently. If the AI agent's behavior changes unexpectedly, you can compare versions to identify what changed. For deployment guidance, see Deploy AI Agents Between Environments. Handling edge cases: Update your prompt to handle unexpected situations. For a missing or ambiguous category, instruct the AI agent to set the decision to HOLD and write a clear note in triageNotes. For cases that are already closed or restricted, instruct the AI agent to skip updates and output a safe, neutral decision. For troubleshooting common issues, see Troubleshooting AI Agents. Feedback Was this page helpful? SHARE FEEDBACK Loading...