This document provides a detailed overview of the implementation of the Event Recommendation Chatbot using Java Spring Boot, LangGraph, MCP, and Angular.
The application follows a client-server architecture:
- Frontend: Angular application that provides the user interface for the chatbot
- Backend: Spring Boot application that handles the AI logic, API calls, and serves the Angular frontend
- External Services:
- Ticketmaster MCP server for event data
- API Ninjas Cities API for city information
-
MCP Client Integration
- Spring AI MCP client for connecting to the Ticketmaster MCP server
- MCP tool callbacks for handling responses from the MCP server
-
LangGraph Agent
- Stateful conversation graph using LangGraph4j
- Nodes for understanding user intent, fetching city information, searching events, and generating responses
-
REST API
- Chat session management
- Message processing
-
Chat Interface
- Real-time message display
- Input area for user messages
-
Event Display
- Card layout for event recommendations
- Details about each event
-
City Information
- Display of city information when a city is mentioned
The application uses the Model Context Protocol (MCP) to integrate with the Ticketmaster API. This allows the application to leverage the standardized MCP interface for tool calling, which simplifies integration and provides a consistent pattern for AI model interactions.
Key files:
backend/src/main/java/com/example/tanzu/genai/eventrecommendation/config/McpConfig.java
The chatbot agent is implemented using LangGraph4j, which provides a framework for creating stateful, multi-step conversation flows. This enables the chatbot to maintain context, understand user intent, and break down complex tasks into manageable steps.
Key files:
backend/src/main/java/com/example/tanzu/genai/eventrecommendation/graph/ChatbotGraph.javabackend/src/main/java/com/example/tanzu/genai/eventrecommendation/graph/ChatbotState.java
The frontend is built using Angular 17 with standalone components, providing a modern, modular architecture. This approach simplifies the component structure and reduces bundle size.
Key files:
frontend/src/app/components/chat/chat.component.tsfrontend/src/app/components/event-card/event-card.component.tsfrontend/src/app/components/city-info/city-info.component.ts
The project uses Maven to build both the backend and frontend, with the frontend-maven-plugin handling the Node.js and npm setup. This ensures that the frontend is built and included in the Spring Boot JAR file, simplifying deployment.
Key files:
pom.xmlbackend/pom.xml
The application is designed to be deployed to Tanzu Platform for Cloud Foundry. The deployment script handles:
- Building the application
- Creating necessary services
- Deploying the application
- Binding the application to services
Key files:
scripts/deploy-to-tanzu.shmanifest.yml
- Improved Error Handling: Add more robust error handling and retry logic for external API calls
- User Authentication: Add user authentication to persist chat sessions
- Event Filtering: Allow users to filter events by date, type, price, etc.
- Multiple LLM Support: Add support for different LLM providers through the GenAI tile
- Enhanced UI: Add animations, images, and more interactive elements to the frontend
