[Open-source] AI chat application, which implemented RAG (search-enhanced generation) knowledge base question and answer system
![[Open-source] AI chat application, which implemented RAG (search-enhanced generation) knowledge base question and answer system](https://yy123.ink/api/img/1781065122923-3v479v.jpg)
1. Project Overview
Smart Knowledge Base Q&A System
HzsparrowAI is an AI Software Built on Spring AI. This project was originally intended for learning and testing AI functions, and subsequent business landing projects will be developed based on this project. All requirements and functions will be guaranteed to be basically available and can be used as a development base for enterprise-level projects.
2. Open Source License
Licensed under Apache-2.0
3. Screenshots
System Screenshot
The following is a screenshot of the main functional interface of the system:
Smart Dialogue Interface
Through the smart dialogue interface, users can interact with AI in natural language and select different knowledge bases for questioning.

Knowledge Base Management
Knowledge Base Management Interface allows users to create, view, and manage their own knowledge bases.

Document List
Each knowledge base document list, users can view, add and delete documents.

Document Content View
View the detailed content of documents in the knowledge base, supports Markdown format display.

Platform Settings
Set the system information of the platform, mainly used to set the default model.

Model Settings
Can pre-set multiple models in the platform, solve the need for flexible and varied models.

4. Feature Overview
Smart Knowledge Base Q&A System
This is an AI chat application based on Spring Boot, integrated with Spring AI and Ollama, implementing the RAG (search-enhanced generation) function of the knowledge base question and answer system. Users can create and manage knowledge bases, add documents, and retrieve knowledge base information through intelligent question and answer functions.
Core Function
Smart Dialogue
-
Based on Ollama's natural language interaction -
Supports real-time display of AI answers, supports streaming responses -
Supports multiple models, can flexibly switch between different AI models
Knowledge Base Management
-
Create, view and manage multiple knowledge bases -
Support knowledge base CRUD operations -
Knowledge base permission management
Document Management
-
Support uploading multiple document formats (PDF, Word, TXT, Markdown, etc.) -
Automatic document content parsing and vector storage -
Document preview and content management -
Batch document processing
Dialogue Management
-
Create, view and manage multiple dialogue sessions -
Support customizing dialogue titles -
Dialogue history records and search -
Dialogue context preservation
RAG Search Enhancement
-
Based on ElasticSearch's vector storage -
Smart document search and relevance matching -
Organic combination of search results and generated content -
Adjustable similarity threshold
User System
-
JWT authentication and authorization -
Role-based access control -
User registration and login management -
User data isolation
User Experience
-
Modernized responsive Web interface -
Supports Markdown format rendering -
Mobile device-friendly design -
Intuitive operation interaction
5. Tech Stack
Technical Architecture
Backend Technology Stack
- Spring Boot 3.4.2
- Application Framework - Spring AI 1.0.0
- AI Integration Framework - Spring Security + JWT
- Security Authentication - MyBatis-Plus 3.5.11
- Data Persistence - ElasticSearch
- Vector Storage and Retrieval - WebSocket
- Real-time Communication - Spring AI Tika
- Document Parsing - FlexMark
- Markdown Processing
Frontend Technology Stack
- HTML/CSS/JavaScript
- Basic Frontend Technology - Marked.js
- Markdown Parsing and Rendering - Responsive Design
- Adapt to multiple devices
AI Service Support
- Ollama
- Local Large Language Model Service - OpenAI compatible API
- Supports multiple AI service providers
Environment Requirements
- Java 17+
- MySQL 5.7+
- Maven 3.6+
- ElasticSearch 8.x
- Ollama service
or other compatible AI services
Quick Start
See the README.md documentation for details