Complete Practice: Ticket Triage Agent from Decision Model to Team Collaboration on AgentCore
This article demonstrates building a ticket triage assistant using AgentScope Java and Alibaba's Bailian decision model, deploying via AgentCore code packages, verifying normal and streaming calls, and extending with AgentCore Team for collaborative task assignment and report review.
Scenario and Business Requirements
In enterprise ticket queues, issues like login failures (all users unable to log in, 502 errors) and invoice requests (no service interruption) coexist. Handlers must first classify category, impact scope, and urgency before routing. The ticket assistant prepares this information: the Bailian decision model judges category and priority, then the assistant combines ticket records and runbooks to generate suggestions for human review. Grading rules, result validation, and query tools must follow enterprise policies and integrate with existing ticket systems, so a high-code approach is used to maintain logic in the business project.
The application divides responsibilities: AgentScope Java orchestrates the model and tool calls; Bailian provides decision and generation capabilities; AgentCore handles deployment and runtime. The code package bridges local engineering and cloud services, while Team adds optional collaboration extensions.
Ticket Triage Agent Development
SDK and Framework Adapters
AgentCore SDK offers Python, JavaScript/TypeScript, and Java versions, adapting to popular agent frameworks. Existing projects can keep their stack and selectively access platform-managed models, MCP tools, Skills, memory, and credentials. Adapted frameworks per language:
Java: AgentScope Java, Spring AI, LangChain4j
Python: AgentScope, LangChain/LangGraph, Google ADK, Pydantic AI, CrewAI
JavaScript/TypeScript: LangChain/LangGraph, Google ADK, Mastra, AI SDK
All SDKs are open source (Java: https://github.com/ai-agentcore/agentcore-sdk-java, Python: https://github.com/ai-agentcore/agentcore-sdk-python, JavaScript/TypeScript: https://github.com/ai-agentcore/agentcore-sdk-nodejs). The ticket assistant uses the base SDK and AgentScope adapter module with the following Maven dependencies:
<properties>
<agentcore.version>0.1.3</agentcore.version>
</properties>
<dependencies>
<dependency>
<groupId>io.github.ai-agentcore</groupId>
<artifactId>agentcore-sdk</artifactId>
<version>${agentcore.version}</version>
</dependency>
<dependency>
<groupId>io.github.ai-agentcore</groupId>
<artifactId>agentcore-sdk-agentscope</artifactId>
<version>${agentcore.version}</version>
</dependency>
</dependencies>After adding the SDK, existing ticket query tools continue to work and can be combined with platform-managed models, MCP, or Skills. Model providers are still introduced per business needs; the collaboration module is used later.
Decision Model Integration and Triage Judgment
Classifying a ticket as "technical" is insufficient; "all users cannot log in" and "individual user login slow" are both technical but have different priorities. Therefore, besides category options, the model must receive grading conditions for impact scope.
Decision models suit tasks with clear options and judgment criteria. They handle classification, scoring, and yes/no judgments, returning structured results with probabilities. The application then arranges subsequent queries and processing.
AgentScope Java provides a Jev decision model extension, encapsulating typed requests, result parsing, and validation in JevClient (see https://github.com/agentscope-ai/agentscope-java/blob/main/docs/v2/zh/jev/guides/client.md). Developers can also use TypeSafe Jev, configuring service credentials and models per the extension docs to plug decision capability into existing agent flows.
This example uses the decision-model-preview from Bailian (https://help.aliyun.com/zh/model-studio/decision-model-api), wrapping a DecisionClient that calls its System One interface. The ticket description and classification conditions are submitted together to obtain structured category and priority results.
Here, all-user or core-business outages are classified as P1; general inquiries or non-interruption requests as P3. After receiving the decision, the assistant validates that category and priority belong to preset options before proceeding.
Business Tool Integration and Suggestion Generation
Once priority is determined, the assistant finds handling references. Ticket query and runbook retrieval are wrapped as two AgentScope tools: lookup_ticket provides impact scope, log clues, and recent release records. lookup_runbook provides corresponding handling methods. qwen-plus then combines these materials with the decision result to generate suggestions and list items requiring human confirmation.
The following code chains the two stages:
var decision = decisionClient.classify(input);
String content = input
+ "
Bailian decision model triage result (category is not root cause):" + Main.json(decision);
var agent = ReActAgent.builder().name("triage")
.model(model).toolkit(toolkit)
.sysPrompt(prompt).maxIters(6).build();
String text = agent.call(List.of(new UserMessage(content)), context)
.block(Duration.ofSeconds(150)).getTextContent(); modelaccesses the model connection in the AgentCore workspace via AgentScope native client, calling qwen-plus. Generated suggestions are handed to handlers for review.
The ticket assistant exposes an OpenAI Chat Completions compatible HTTP interface. After local verification, it can be published to AgentCore for ticket system invocation.
AgentCore Code Package Deployment
Publishing the assistant does not require a separate image build pipeline. AgentCore code package deployment provides Python, Node.js, and Java runtimes with platform-maintained base images. Developers reuse existing build methods, packaging the application with runtime dependencies into a code package for platform deployment.
If a mature image pipeline exists or system components need customization, container image deployment is also available (https://help.aliyun.com/zh/agentcore/high-code-agent-deployment-guide). This assistant runs on the platform-provided Java environment, so code package deployment is chosen.
Packaging still uses Maven: business code, AgentScope, SDK, and other runtime dependencies are bundled into app.jar, then the JAR is placed at the ZIP root. This ZIP is the deployable code package.
This practice uploads the local ZIP directly. If code is built via pipeline, artifacts can be stored in OSS and imported from there. Either way, the delivered artifact is the application's build output.
After upload, the application starts with the original command. This assistant selects Java 17 with startup command java -jar app.jar and service port 8080. AgentCore unzips the package, starts the app, and confirms service status via health checks.
Once ready, configuring the service entry in AgentCore allows the ticket system to send requests via the provided access address and authentication. The locally verified triage logic now has a callable service endpoint.
Service Invocation and Triage Effect Verification
After deployment, the two initial tickets (login failure and invoice request) are sent to the assistant to examine actual output. Verification covers two call modes: normal call returns the full report at once for backend processing; streaming call returns content incrementally so users can view suggestions as they generate on the ticket page.
Results below are from actual calls using demo ticket and runbook data.
Login Failure Ticket (P1)
For "all users unable to log in", the assistant returns "Technical, P1" and references ticket records and the failure handling runbook. Excerpt from the generated report:
Ticket category and priority: Technical failure, P1. Known facts: login interface returns 502, affecting all users; log clue is upstream_connect_error , recent application release. Investigation suggestions: check upstream health, connection pool, timeout settings, and recent releases; retain request IDs and relevant logs. Human confirmation items: whether upstream is currently reachable, whether recent changes are related, whether on-call lead authorization is needed for fix or rollback.
Invoice Request Ticket (P3)
For "apply for reissue of last month's invoice, no service interruption", the assistant returns "Billing, P3", referencing the invoice handling runbook. Suggestions focus on billing cycle, order entity, and invoice status. Thus handlers receive not only priority but also matching handling references.
Elastic Runtime and Observability
When login service fails, related tickets may surge briefly; after recovery, volume drops. AgentCore supports on-demand elastic scaling, allowing configuration of strategies based on concurrency needs: scale out during peaks, reclaim idle resources when load falls, reducing pressure of long-term peak reservation (https://www.aliyun.com/product/agentcore).
When a triage request hangs, troubleshooting needs an entry point. AgentCore places instances, sessions, basic monitoring, and runtime logs under the same agent, enabling quick status confirmation then drilling into application logs for specific requests (https://help.aliyun.com/zh/agentcore/high-code-agent-deployment-guide).
Enabling log collection and configuring an SLS Logstore lets the team view runtime logs in the AgentCore console to trace anomalous requests.
The assistant logs request ID, execution latency, decision result, and tool calls. For the login failure example, logs show which ticket was queried, which runbook used, and the final category and priority adopted. If suggestions deviate from expectations, these records guide debugging back in business code.
Triage Rule Iteration and Code Package Updates
To integrate real ticket APIs or adjust login failure grading conditions, developers return to the original project for modification and testing. After verification, rebuild the code package and update the Agent via AgentCore; new logic goes live.
When using OSS source, uploading a new package and updating the Agent are separate actions. AgentCore snapshots the code package at create/update time, so overwriting the OSS source file does not change running code. Only triggering an Agent update reads the new package and deploys, keeping release timing under team control.
Advanced Practice: AgentCore Team Native Collaboration
At this point the assistant independently provides triage service. But a high-priority failure ticket often requires work assignment, information supplementation, and report review. Tracking who owns the task, analysis progress, and whether results pass acceptance also needs records. AgentCore Team can be added to let the existing assistant participate in subsequent collaboration.
Note: High-code agent collaboration capability currently uses a whitelist mechanism. Customers with trial needs can submit a ticket to contact support for access.
Team Task Assignment and Delivery Review
In Team, the Leader assigns work, Workers perform specific analysis, and users can view progress, add requirements, and accept results. Subtasks, execution records, and report files are linked under the same task, so newcomers see prior handling and can comment directly on reports, reducing repeated restatement and status chasing (https://help.aliyun.com/zh/agentcore/using-team-tasks).
This login failure task uses the following division, reusing the already deployed assistant:
Hosted Agent as Leader: Assign login failure analysis task, review Worker-submitted report
Ticket Assistant (high-code Agent) as Worker: Query failure ticket and runbook, complete triage and submit report
User: Supplement task requirements, participate in review, accept final report
Collaboration SDK Integration
The assistant reuses existing triage logic, adding task claim and file delivery tools via the collaboration SDK, and joins the Team under a collaboration-enabled Workspace. New engineering dependency (base SDK and AgentScope adapter remain at 0.1.3):
<dependency>
<groupId>io.github.ai-agentcore</groupId>
<artifactId>agentcore-collaboration</artifactId>
<version>0.1.0</version>
</dependency>The SDK exposes task claim, file delivery, etc. as tools into the existing Agent, and supplements Worker collaboration rules. The toolkit retains business query tools; businessPrompt retains triage and report requirements; collaboration is reused with the application and released on close:
var workspace = Path.of(".");
var collaboration = Collaboration.auto(workspace);
var workerTools = new ArrayList<>(collaboration.tools().block());
Skill.tools(collaboration.skills().block(), workspace).stream()
.filter(tool -> !"execute_command".equals(tool.name()))
.forEach(workerTools::add);
workerTools.forEach(tool ->
toolkit.registerAgentTool(AgentCoreAgentScope.tool(tool)));
var worker = ReActAgent.builder().name("ticket-worker")
.model(model).toolkit(toolkit)
.sysPrompt(collaboration.composePrompt(businessPrompt))
.maxIters(18).build();Task context is passed per invocation so analysis and reports belong to the correct task. trustedHeaders come from trusted platform requests; both normal and streaming calls use the same passing mechanism:
var taskContext = CollaborationContext.fromHeaders(trustedHeaders);
var contextBuilder = RuntimeContext.builder().sessionId(sessionId);
if (taskContext != null) {
contextBuilder.put(CollaborationContext.KEY, taskContext);
}
var context = contextBuilder.build();
var response = worker.call(List.of(new UserMessage(input)), context)
.block(Duration.ofSeconds(150));
// Streaming call uses worker.streamEvents(new UserMessage(input), context)After integration, publishing still works by rebuilding the code package and updating the Agent. Full interface see https://github.com/ai-agentcore/agentcore-sdk-java/blob/main/collaboration/README.md.
The final delivered report includes P1 grading basis, known ticket facts, suggested investigation steps, and items requiring human confirmation. Leader and users can review against the report without piecing conclusions from multi-turn conversations.
Summary
Returning to the two initial tickets, the assistant helps handlers quickly recognize login failure urgency and find proper handling references for invoice requests. Grading rules and business tools will continuously adjust with real usage, and releasing these improvements should become part of daily development.
AgentCore code package deployment lets teams reuse existing projects, delivering verified applications with dependencies to the platform, eliminating per-agent image maintenance. Runtime environment and service management are handled by AgentCore, freeing developers to focus on triage rules, query tools, and actual handling effects; when cross-role follow-up on complex tickets is needed, Team extends collaboration.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Alibaba Cloud Native
We publish cloud-native tech news, curate in-depth content, host regular events and live streams, and share Alibaba product and user case studies. Join us to explore and share the cloud-native insights you need.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
