[Open-source] AI chat application, which implemented RAG (search-enhanced generation) knowledge base question and answer system

Open SourceOpen Source Systems
2026-06-10 12:18 6 次浏览 • 0 次下载 0KB
[Open-source] AI chat application, which implemented RAG (search-enhanced generation) knowledge base question and answer system

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.

Image

Knowledge Base Management

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

Image

Document List

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

Image

Document Content View

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

Image

Platform Settings

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

Image

Model Settings

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

Image

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

Project Structure

src/main/java/com/hzsparrow/ai/
├── config/                 # Configuration Class
│   ├── PromptConfiguration.java   # Prompt Configuration
│   ├── SecurityConfig.java        # Security Configuration
│   ├── DataInitializer.java       # Data Initialization
│   └── FileUploadConfig.java      # File Upload Configuration
├── controller/             # Controller Layer
├── entity/                 # Entity Class
├── service/                # Service Layer
├── mapper/                 # Data Access Layer
├── security/               # Security Authentication
├── util/                   # Utility Class
└── HzsparrowAiApplication.java    # Application Entry
src/main/resources/
├── static/                 # Front-end Static Resources
├── prompts/                # AI Prompt Template
├── sql/                    # Database Script
└── application.yml         # Application Configuration
#1
资源直链https://gitee.com/flvf/hzsparrow-ai
去下载
星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare