A Multi-Agent LLM-Powered Customer Support Engine Built with Spring Boot, LangGraph Architecture & React
Sentiment Support AI is a full-stack, enterprise-grade AI-driven customer support engine that:
- Classifies user sentiment
- Generates empathetic responses
- Creates & tracks support tickets
- Answers ticket queries
- Routes messages across multiple LLM providers
- Uses a meta-agent to judge routing correctness
- Monitors everything via Prometheus + Grafana
- Stores workflow audits & execution traces in a database
It uses a LangGraph-inspired multi-agent architecture running on Spring Boot, Java 25 virtual threads, and React 19 for the frontend.
This project serves as a real blueprint for building enterprise AI orchestration systems.
Most AI projects stop at proof-of-concept. This platform is intentionally designed to explore how LLM-driven workflows behave under enterprise constraints such as observability, failure handling, auditability, and long-running service stability using a JVM-first stack commonly found in production systems.
Agents implemented as independent nodes:
- Classifier Agent β Detects sentiment
- Feedback Agent β Handles complaints, generates tickets
- Query Agent β Resolves ticket status
- Meta Agent (Judge) β Evaluates correctness & quality
Supports multiple model providers:
- OpenAI
- Anthropic (Claude)
- DeepSeek
- Google Gemini
- Ollama (local LLMs)
Routing strategies:
- Single provider
- Weighted routing
- Majority vote (parallel virtual threads)
- Fallback routing
- Provider health monitoring
Per message scoring metrics:
- Empathy
- Clarity
- Accuracy
- Relevance
- Routing correctness (meta-agent heuristic + LLM judge)
Each agent node gets:
- Automatic retries
- Circuit breaking
- Timeout mechanisms
- Fallback execution paths
Prometheus metrics visualized in Grafana:
- Routing success/failure
- Provider performance
- Model latency
- Workflow execution timeline
- Circuit breaker states
- Response quality (LLM judge scores)
Every workflow run is stored:
- Workflow-level entry (
workflow_execution) - Node-by-node execution (
workflow_step) - Timestamps, sentiment snapshots, agent responses
React 19 (Vite) web UI for interacting with the /api/chat endpoint.
ββββββββββββββββββββββββββ
β ChatController β
β POST /api/chat β
βββββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββ
β WorkflowGraph β
β (Orchestrator) β
ββββββββ¬βββββββββββ
β
ββββββββββββββββββββββββββΌβββββββββββββββββββββββββ
βΌ βΌ βΌ
ββββββββββββββ βββββββββββββββββ ββββββββββββββββββ
βClassifier β βFeedbackHandlerβ βQueryHandler β
βNode β βNode β βNode β
ββββββ¬ββββββββ ββββββββ¬βββββββββ ββββββββ¬ββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββ βββββββββββββββββββββββ ββββββββββββββββββββ
βClassifierSvcβ βFeedbackService β βQueryService β
ββββββ¬βββββββββ ββββββββββββ¬βββββββββββ ββββββββββ¬ββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββ ββββββββββββββββ ββββββββββββββββββββ
βLLM Router ββββββββββΆβModelProvider*βββββββββΆβDB Repositories β
βββββββββββββ ββββββββββββββββ ββββββββββββββββββββ
β²
β
ββββββββββββββββ
βMeta Agent β
βLLM-as-a-Judge β
ββββββββββββββββ
sentiment-support-ai/
βββ langgraph/
β βββ WorkflowGraph.java
β βββ nodes/
β β βββ ClassifierNode.java
β β βββ FeedbackHandlerNode.java
β β βββ QueryHandlerNode.java
β β βββ Node.java
β βββ model/
β βββ WorkflowState.java
β βββ SentimentType.java
β
βββ modules/
β βββ classifier/ClassifierService.java
β βββ feedback/FeedbackService.java
β βββ query/QueryService.java
β βββ scoring/ScoringService.java
β βββ providers/
β β βββ ModelProvider.java
β β βββ LlmModelFactory.java
β β βββ LlmProviderRouter.java
β
βββ infrastructure/
β βββ aop/
β β βββ ExecutionTraceAspect.java
β β βββ AgentRoutingAspect.java
β βββ metrics/
β β βββ WorkflowAuditService.java
β β βββ RoutingMetricsRecorder.java
β βββ config/
β β βββ SpringAIConfig.java
β β βββ OpenApiConfig.java
β β βββ WebConfig.java (CORS)
β βββ persistence/
β βββ TicketJpaRepository.java
β βββ WorkflowExecutionRepository.java
β βββ WorkflowStepRepository.java
β
βββ api/
β βββ ChatController.java
β βββ dto/
β βββ ChatRequest.java
β βββ ChatResponse.java
β
βββ domain/
β βββ Ticket.java
β βββ WorkflowExecution.java
β βββ WorkflowStep.java
β
βββ frontend/ (React 19 application)
git clone https://github.com/<your-name>/sentiment-support-ai.git
cd sentiment-support-aiexport OPENAI_API_KEY="your-key"
export ANTHROPIC_API_KEY="your-key"
export DEEPSEEK_API_KEY="your-key"
export GOOGLE_GENAI_API_KEY="your-key"Create PostgreSQL DB:
CREATE DATABASE sentimentdb;
CREATE USER sentiment_user WITH PASSWORD 'sentiment_pass';
GRANT ALL PRIVILEGES ON DATABASE sentimentdb TO sentiment_user;schema.sql initializes tables automatically.
mvn spring-boot:runcd frontend
npm install
npm run dev
Run JUnit tests:
mvn testTests include:
- Provider routing
- Majority voting logic
- Node execution
- WorkflowGraph route correctness
- Scoring JSON parsing
- Meta-agent correctness evaluation
Request:
{
"message": "I want to know the status of ticket 1234"
}Response:
{
"userMessage": "I want to know the status of ticket 1234",
"sentiment": "QUERY",
"response": "Your ticket 1234 is currently open.",
"ticketId": "1234"
}/actuator/prometheus
- Routing success/failure
- Latency per node
- Response quality (empathy, clarity, accuracy)
- Provider performance
- Sentiment distribution
- Circuit breaker status
- Workflow timeline
A ready-to-import Grafana JSON dashboard is included.
- Multi-turn conversational memory
- Escalation Agent (Supervisor node)
- Cost-aware provider routing
- RAG support (retrieval augmented generation)
- Knowledge graph integration (Neo4j)
- Functional multi-step workflows (LangChain-style chaining)
- Auto-fine-tuning on collected audit logs
PRs, discussions, and feature suggestions are welcome!
This project is licensed under the MIT License.