# spring-ai-sample **Repository Path**: ai-sample/spring-ai-sample ## Basic Information - **Project Name**: spring-ai-sample - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-10-28 - **Last Updated**: 2026-03-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Spring AI Sample Project This project is a sample implementation based on Spring AI, demonstrating how to perform various tasks using Spring AI. ## Features - Implements client-server communication using the Model Context Protocol (MCP) - Supports multiple AI models, including Ollama and OpenAI - Provides vector storage capabilities with support for Elasticsearch, Milvus, Neo4j, and Redis - Implements text-to-SQL conversion functionality - Includes a simple 12306 system example ## Project Structure ``` spring-ai-sample/ ├── spring-ai-mcp # MCP-related implementation ├── spring-ai-model # AI model-related functionality ├── spring-ai-other # Other feature modules └── spring-ai-vectorstore # Vector store implementation ``` ## Installation and Execution 1. Ensure Java 17 or higher is installed 2. Clone the project: `git clone https://gitee.com/ai-sample/spring-ai-sample` 3. Navigate to the project directory: `cd spring-ai-sample` 4. Build the project: `mvn clean install` 5. Run a specific module, e.g., run the Ollama example: `cd spring-ai-model/ollama && mvn spring-boot:run` ## Usage Examples - Run the Ollama sample application: ```java cd spring-ai-model/ollama mvn spring-boot:run ``` Access `http://localhost:8080/chat/generate?message=你好` to retrieve an AI-generated response. - Run the text-to-SQL example: ```java cd spring-ai-other/spring-ai-text2sql mvn spring-boot:run ``` Send a POST request to `http://localhost:8080/query` with the request body: `{\"question\": \"查询所有用户\"}` ## Contribution Guidelines Contributions are welcome! Please follow these steps: 1. Fork this repository 2. Create a new branch (`git checkout -b feature/your-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin feature/your-feature`) 5. Create a Pull Request ## License This project is licensed under the Apache-2.0 License. See the LICENSE file for details.