This is the Spring Boot backend for the Event Recommendation Chatbot application.
This backend provides the API and AI intelligence for the event recommendation chatbot. It integrates with:
- Ticketmaster MCP server for event data
- API Ninjas Cities API for city information
- LangGraph4j for agent orchestration
- Spring AI for MCP client support
- Java 17
- Spring Boot 3.2
- Spring AI
- LangGraph4j
- Model Context Protocol (MCP)
- Spring WebFlux for reactive APIs
- Java 17 or higher
- Maven 3.8 or higher
- Ticketmaster API key
- API Ninjas API key
- (Optional) OpenAI API key (for direct LLM integration)
Set the following environment variables before running:
TICKETMASTER_API_KEY=your-ticketmaster-api-key
CITIES_API_KEY=your-api-ninjas-key
OPENAI_API_KEY=your-openai-api-key (optional)
mvn spring-boot:runThe application will be available at http://localhost:8080
mvn clean packageThis will create a JAR file in the target directory that includes both the backend and frontend.
POST /api/chat/sessions- Create a new chat sessionGET /api/chat/sessions/{sessionId}- Get an existing chat session
POST /api/chat/messages- Send a message to the chatbot
The chatbot uses LangGraph4j to orchestrate a stateful conversation flow:
understand_user_intent- Analyzes user messages to determine intent and extract city namescheck_for_city- Looks up city information using the Cities APIsearch_events- Searches for events in the specified city using the Ticketmaster MCP servergenerate_response- Generates a natural language response based on the conversation context
The application uses Spring AI's MCP client to communicate with the Ticketmaster MCP server. This integration allows the chatbot to query for events based on location, date, type, and other criteria.
Refer to the main README and the deployment script in the scripts directory for instructions on deploying to Tanzu Platform for Cloud Foundry.