|
| 1 | +# Spring AI Microservices Ecosystem |
| 2 | + |
| 3 | +This repository contains a comprehensive ecosystem of Spring AI-powered microservices that demonstrate how to build modern AI applications using the Spring AI framework. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +The ecosystem consists of three main applications and a shared database infrastructure: |
| 8 | + |
| 9 | +1. **AI Assistant** - The central application that provides a chat interface with AI capabilities |
| 10 | +2. **Travel Service** - A specialized service for travel booking and management |
| 11 | +3. **Backoffice Service** - A specialized service for expense management and currency conversion |
| 12 | +4. **Database Infrastructure** - Shared PostgreSQL database with pgvector extension |
| 13 | + |
| 14 | +These applications work together through the Model Context Protocol (MCP), allowing the AI Assistant to leverage specialized capabilities from the Travel and Backoffice services. |
| 15 | + |
| 16 | +## Architecture |
| 17 | + |
| 18 | +The overall architecture follows a microservices pattern with the AI Assistant as the central component: |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +The AI Assistant connects to the Travel and Backoffice services through the MCP protocol, allowing it to: |
| 23 | +- Search for and book hotels and flights (via Travel service) |
| 24 | +- Create and manage expenses (via Backoffice service) |
| 25 | +- Convert currencies (via Backoffice service) |
| 26 | + |
| 27 | +## Projects |
| 28 | + |
| 29 | +### [AI Assistant](assistant/README.md) |
| 30 | + |
| 31 | +The AI Assistant is the central application in the ecosystem, providing: |
| 32 | + |
| 33 | +- Text-based conversations with persistent memory |
| 34 | +- Document analysis (PDF, JPG, JPEG, PNG) |
| 35 | +- Retrieval-Augmented Generation (RAG) for knowledge base integration |
| 36 | +- Tool integration for enhanced capabilities |
| 37 | +- Model Context Protocol (MCP) client for connecting to external services |
| 38 | + |
| 39 | +**Key Technologies:** |
| 40 | +- Spring AI with Amazon Bedrock (Claude Sonnet 4) |
| 41 | +- PostgreSQL with pgvector for vector embeddings |
| 42 | +- Thymeleaf web interface |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +### [Travel Service](travel/README.md) |
| 47 | + |
| 48 | +The Travel service provides specialized functionality for travel management: |
| 49 | + |
| 50 | +- Hotel search and booking |
| 51 | +- Flight search and booking |
| 52 | +- Airport information |
| 53 | +- Weather forecasts for destinations |
| 54 | +- MCP server for AI integration |
| 55 | + |
| 56 | +**Key Technologies:** |
| 57 | +- Spring Boot with Spring Data JPA |
| 58 | +- PostgreSQL for data storage |
| 59 | +- Spring AI MCP Server for AI integration |
| 60 | + |
| 61 | +### [Backoffice Service](backoffice/README.md) |
| 62 | + |
| 63 | +The Backoffice service provides specialized functionality for business operations: |
| 64 | + |
| 65 | +- Expense management (create, track, update, approve) |
| 66 | +- Currency conversion with real-time exchange rates |
| 67 | +- MCP server for AI integration |
| 68 | + |
| 69 | +**Key Technologies:** |
| 70 | +- Spring Boot with Spring Data JPA |
| 71 | +- PostgreSQL for data storage |
| 72 | +- Spring AI MCP Server for AI integration |
| 73 | + |
| 74 | +### [Database Infrastructure](database/README.md) |
| 75 | + |
| 76 | +The shared database infrastructure provides: |
| 77 | + |
| 78 | +- PostgreSQL 16 with pgvector extension for vector embeddings |
| 79 | +- Multiple databases for different application domains |
| 80 | +- pgAdmin web interface for database management |
| 81 | + |
| 82 | +## Getting Started |
| 83 | + |
| 84 | +1. Start the database infrastructure: |
| 85 | + ```bash |
| 86 | + cd database/ |
| 87 | + ./start-postgres.sh |
| 88 | + ``` |
| 89 | + |
| 90 | +2. Start the Travel service: |
| 91 | + ```bash |
| 92 | + cd travel/ |
| 93 | + mvn spring-boot:run |
| 94 | + ``` |
| 95 | + |
| 96 | +3. Start the Backoffice service: |
| 97 | + ```bash |
| 98 | + cd backoffice/ |
| 99 | + mvn spring-boot:run |
| 100 | + ``` |
| 101 | + |
| 102 | +4. Start the AI Assistant: |
| 103 | + ```bash |
| 104 | + cd assistant/ |
| 105 | + mvn spring-boot:run |
| 106 | + ``` |
| 107 | + |
| 108 | +5. Access the AI Assistant web interface: |
| 109 | + ``` |
| 110 | + http://localhost:8080 |
| 111 | + ``` |
| 112 | + |
| 113 | +## Key Spring AI Features |
| 114 | + |
| 115 | +This ecosystem demonstrates several key features of the [Spring AI framework](https://docs.spring.io/spring-ai/reference/index.html): |
| 116 | + |
| 117 | +1. **AI Integration** - Using Spring AI to integrate with AI models (Amazon Bedrock) |
| 118 | +2. **System Prompts** - Configuring AI behavior with system prompts |
| 119 | +3. **Chat Memory** - Implementing persistent conversation memory |
| 120 | +4. **RAG** - Implementing Retrieval-Augmented Generation for knowledge base integration |
| 121 | +5. **Tool Integration** - Extending AI capabilities with custom tools |
| 122 | +6. **MCP** - Using the Model Context Protocol for microservices integration |
| 123 | + |
| 124 | +For more details on each feature, refer to the [AI Assistant documentation](assistant/README.md). |
| 125 | + |
| 126 | +## Prerequisites |
| 127 | + |
| 128 | +- Java 21 or higher |
| 129 | +- Maven 3.8 or higher |
| 130 | +- Docker and Docker Compose |
| 131 | +- AWS account with Amazon Bedrock access |
| 132 | + |
| 133 | +## License |
| 134 | + |
| 135 | +This project is licensed under the MIT License - see the LICENSE file for details. |
0 commit comments