A chatbot application that recommends events based on user preferences and location, using Spring Boot, LangGraph, Model Context Protocol (MCP), and Angular.
This application demonstrates the use of the Tanzu Platform for Cloud Foundry's GenAI capabilities to create an intelligent event recommendation chatbot. It leverages the following technologies:
- Backend: Java 17, Spring Boot 3.2, Spring AI
- Agent Orchestration: LangGraph4j
- External Integration: Model Context Protocol (MCP), API Ninjas Cities API
- Frontend: Angular 17
- Deployment: Tanzu Platform for Cloud Foundry
- Conversational Interface: Natural language chat interface for users to inquire about events
- City Information: Integration with Cities API to provide information about cities
- Event Recommendations: Integration with Ticketmaster API via MCP to provide relevant event recommendations
- Intelligent Agent: LangGraph-powered agent that maintains conversation context and provides coherent responses
java-spring-langgraph-mcp-angular/
├── backend/ # Spring Boot backend application
│ ├── src/ # Source code
│ │ ├── main/
│ │ │ ├── java/... # Java code
│ │ │ └── resources/ # Configuration files
│ │ └── test/ # Test code
│ └── README.md # Backend documentation
├── frontend/ # Angular frontend application
│ ├── src/ # Source code
│ │ ├── app/ # Angular components, services, etc.
│ │ ├── assets/ # Static assets
│ │ └── environments/ # Environment configurations
│ └── README.md # Frontend documentation
├── scripts/ # Utility scripts
│ └── deploy-to-tanzu.sh # Deployment script
├── IMPLEMENTATION.md # Implementation details
├── manifest.yml # Cloud Foundry manifest
└── pom.xml # Maven project configuration
- Java 17 or later
- Node.js 20 or later and npm
- Maven 3.8 or later
- Cloud Foundry CLI for deployment
- Ticketmaster API key
- API Ninjas API key
- Clone the repository:
git clone <repository-url>
cd java-spring-langgraph-mcp-angular- Set up environment variables:
export TICKETMASTER_API_KEY=your-api-key
export CITIES_API_KEY=your-api-key- Build and run the application:
mvn clean install
cd backend
mvn spring-boot:run- Access the application:
Open your browser and navigate to http://localhost:8080
- Log in to your Tanzu Platform for Cloud Foundry environment:
cf login -a <api-endpoint> --sso- Run the deployment script:
./scripts/deploy-to-tanzu.shThe application is built using Spring Boot for the backend and Angular for the frontend. It integrates with the Ticketmaster API using the Model Context Protocol (MCP) and the API Ninjas Cities API to provide event recommendations and city information.
The chatbot agent is built using LangGraph4j, which provides a framework for creating stateful, multi-step conversation flows. The agent understands user intent, fetches city information, searches for events, and generates natural language responses.
For more details, see the IMPLEMENTATION.md file.
Backend configuration is managed through application.properties and environment-specific properties files. Key configuration properties include:
spring.ai.mcp.client.stdio.connections.ticketmaster: Ticketmaster MCP configurationcities.api.url,cities.api.key: Cities API configurationspring.ai.openai: OpenAI configuration for direct LLM usage (optional)
See the backend README for more details.
Frontend configuration is managed through Angular environment files. Key configuration includes:
apiUrl: Backend API URL
See the frontend README for more details.
- Backend: Extend the relevant Spring components and update the LangGraph agent as needed.
- Frontend: Add new Angular components and update the services to interact with the backend.
Run backend tests with Maven:
mvn testRun frontend tests with Angular CLI:
cd frontend
npm testThis project is licensed under the MIT License.
- Spring AI for the Spring AI integration
- LangGraph4j for the LangGraph Java implementation
- Ticketmaster API for the event data
- API Ninjas for the city data
- Tanzu Platform for Cloud Foundry for the deployment platform