This is an Agentic AI application built on the Spring Boot framework that automates animal adoption and care processes.
This prototype validates the core architecture for a conversational assistant that can understand user intent, retrieve contextual information, and perform real-world actions
- Intelligent Routing: A router-agent architecture that dynamically delegates user queries to specialized AI agents based on intent.
- Retrieval Augmented Generation (RAG): Integrates with a PostgreSQL Vector database to provide accurate, data-driven responses using contextual information.
- Automated Tool Calling: Enables the AI to perform business logic (e.g., booking appointments) by calling a custom tool.
- Conversational Memory: Maintains per-user chat history to support coherent, multi-turn interactions.
- Modular & Scalable: Designed with a clean, loosely coupled architecture to easily integrate new features and tools.
- Backend Framework: Spring Boot 3.x
- AI Framework: Spring AI
- Database: PostgreSQL with the PGVector extension
- LLM Provider: OpenAI
- Build Tool: Maven
This guide will help you get a local copy of the project up and running for development and testing.
1. Prerequisites
- Java Development Kit (JDK) 17 or higher
- Maven 3.6.3 or higher
- Docker (for running the PostgreSQL database with PGVector)
2. Setup
- Clone the repo
git clone https://github.com/wizzy-abhishek/MCP
- Configure Environment Variables:
Create anapplication.propertiesfile insrc/main/resourcesand add your configurations.# Your Database connection spring.datasource.url=jdbc:postgresql://localhost:5432/your_db_name spring.datasource.username=your_username spring.datasource.password=your_password # Your LLM API key spring.ai.openai.api-key=your_openai_api_key # RAG Vector Store configuration spring.ai.vectorstore.pgvector.embedding-dimension=1536
3. Run the Database:
- You can use Docker to run a
PostgreSQLinstance with thePGVectorextension.Then, create the your_db_name database.docker run --name pgvector -e POSTGRES_PASSWORD=your_password -p 5432:5432 -d ankane/pgvector
4. Running the Application
- You can run the application directly from your IDE or using Maven:
The application will start on port
./mvnw spring-boot:run
8080.
Once the application is running, you can test the AI assistant by making a GET request to the following endpoint:
GET http://localhost:8080/inquire?user=john_doe&question=Do you have a golden retriever?
Example Queries:
GET http://localhost:8080/inquire?user=john_doe&question=Tell me about a dog that is good with kids.
GET http://localhost:8080/inquire?user=john_doe&question=Book an appointment for my dog Max on August 20, 2025.