This is a Spring AI and Spring Integration application that intelligently routes customer support tickets to the appropriate specialized agent based on content analysis. It demonstrates how to combine Spring Integration’s powerful messaging capabilities with Spring AI’s language model integration to create an intelligent workflow for customer support ticket routing.
The application is based on the Router Example in the Spring AI Agentic Samples, but implements the workflow using Spring Integration’s flow configuration.
When a customer submits a support ticket, the application:
-
Analyzes the ticket content using a Large Language Model (LLM)
-
Determines the most appropriate support team (billing, account, product, or technical)
-
Routes the ticket to the specialized support channel
-
Generates an AI-assisted response tailored to the specific support domain
-
LLM Router: Analyzes ticket content and determines the appropriate routing using Spring AI’s ChatClient
-
Integration Flow: Configures the message channels and routing logic using Spring Integration
-
Specialized Response Handlers: Generate domain-specific responses for each support category
-
Sample Ticket Generator: Provides example tickets to demonstrate the routing capabilities
-
Java 17 or above
-
OpenAI API key (or another supported LLM provider)
-
Maven for building the project
When you run the application, it will process three sample support tickets:
-
An account access issue
-
A billing/charge issue
-
A product usage question (data export)
For each ticket, you’ll see: * The original ticket content * The routing analysis and selected support team * A specialized response from the appropriate support agent
The application uses Spring AI with OpenAI by default, but you can modify the pom.xml
to use other LLM providers:
-
Anthropic (Claude): Uncomment the
spring-ai-starter-model-anthropic
dependency -
Ollama (local models): Uncomment the
spring-ai-starter-model-ollama
dependency
You can also customize the support routes and response prompts in LLMRouterFlowConfiguration.java
.
To extend this application for your own use case:
-
Modify the support routes in
LLMRouterFlowConfiguration.java
-
Customize the response prompts for each support domain
-
Integrate with your actual support ticket system by replacing the sample ticket generator