Content
# Tool List
<p align="center">
<a href="#-project-overview">Project Overview</a> •
<a href="#-core-features">Core Features</a> •
<a href="#-technical-architecture">Technical Architecture</a> •
<a href="#-quick-start">Quick Start</a> •
<a href="#-project-structure">Project Structure</a> •
<a href="#-documentation">Documentation</a>
</p>
---
## Project Overview
**RAGWorker** (RAG Comprehensive Intelligent Agent) is an enterprise-level intelligent document processing and retrieval question-answering system built with **Spring Boot 3** + **React 18**. The system deeply integrates RAG (Retrieval-Augmented Generation) technology, supporting multi-channel retrieval, intent recognition, conversational memory, deep thinking, and other advanced features, providing accurate and traceable knowledge question-answering services for enterprises.
### Main Capabilities
- **Intelligent Q&A**: Based on vector retrieval + LLM generation, providing accurate knowledge Q&A
- **Knowledge Base Management**: Supports multi-knowledge base, multi-document ingestion, and chunk management
- **Intent Recognition**: Achieves problem classification and directional retrieval through intent tree
- **Conversational Memory**: Supports multi-turn dialogue, conversational summary, and historical message backtracking
- **Multi-Channel Retrieval**: Vector global retrieval + intent directional retrieval + post-processor chain (deduplication, Rerank)
- **MCP Integration**: Supports Model Context Protocol, expanding external tool capabilities
- **RAG Link Tracking**: Complete retrieval-generation link visual tracking
---
## Core Features
### RAG Core Capabilities
| Feature | Description |
|------|------|
| **Multi-Channel Retrieval** | Vector global retrieval + intent directional retrieval, conditional trigger bottom line mechanism |
| **Post-Processor Chain** | Deduplication, Rerank reordering, improving retrieval quality |
| **Problem Rewriting** | Based on LLM's multi-problem rewriting, optimizing retrieval effect |
| **Intent Recognition** | Tree-like intent classification, supporting directional retrieval and guided prompts |
| **Conversational Memory** | Automatic summary + historical round retention, supporting long conversation context |
| **Deep Thinking** | Supports reasoning process display (thinking content) |
### Engineering Features
| Feature | Description |
|------|------|
| **Vector Database Dual Support** | Milvus / PostgreSQL pgvector switchable |
| **Document Parsing** | Supports PDF, DOC, DOCX, Markdown, and other formats (Apache Tika) |
| **Object Storage** | S3 compatible storage (AWS S3 / MinIO / RustFS) |
| **Message Queue** | RocketMQ asynchronous processing document ingestion tasks |
| **Current Limiting Control** | Distributed semaphore current limiting based on Redis |
| **Link Tracking** | Complete RAG retrieval-generation link record and visualization |
---
## Technical Architecture
### System Architecture Diagram
```
┌─────────────────────────────────────────────────────────────┐
│ Frontend Layer (Frontend) │
│ React 18 + TypeScript + Tailwind CSS + Vite │
│ ├─ User Chat Interface │
│ ├─ Management Background (Knowledge Base / Document / Intent Tree / Settings / Tracking) │
│ └─ Visualization Charts and Data Panel │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ API Gateway Layer (Bootstrap) │
│ Spring Boot 3.5 + Java 17 │
│ ├─ RESTful API (Chat / Knowledge Base / Management / Tracking) │
│ ├─ SSE Streaming Response │
│ └─ MCP Server Interface │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ RAG Core Engine │
│ ├─ Intent Recognition (Intent Tree) │
│ ├─ Multi-Channel Retrieval Engine (VectorGlobal / IntentDirected) │
│ ├─ Post-Processor Chain (Deduplication / Rerank) │
│ ├─ Conversational Memory and Summary Management │
│ └─ Prompt Template and Context Formatting │
└─────────────────────────────────────────────────────────────┘
│
┌───────────────┼───────────────┐
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Vector Storage │ │ Relational Database │ │ Message Queue │
│ Milvus / │ │ PostgreSQL │ │ RocketMQ │
│ pgvector │ │ (Business Data) │ │ (Asynchronous Task) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
```
### Multi-Channel Retrieval Architecture
```
User Question
↓
【Problem Rewriting】
↓
【Multi-Channel Parallel Retrieval】
├─→ IntentDirectedSearchChannel(Intent-Directed Retrieval, Always Executed)
└─→ VectorGlobalSearchChannel(Vector Global Retrieval, Conditional Trigger)
↓
【Post-Processor Chain】
├─→ DeduplicationPostProcessor(Deduplication)
└─→ RerankPostProcessor(Reordering)
↓
【Context Formatting】→ LLM Generates Answer
```
---
## Technology Stack
### Backend
| Technology | Version | Purpose |
|------|------|------|
| Spring Boot | 3.5.7 | Core Framework |
| Java | 17 | Programming Language |
| MyBatis-Plus | 3.5.14 | ORM Framework |
| PostgreSQL | - | Relational Database |
| pgvector | 0.1.6 | PostgreSQL Vector Extension |
| Milvus SDK | 2.6.6 | Vector Database (Optional) |
| Redis | - | Cache / Current Limiting / Conversational Memory |
| RocketMQ | 5.2.0 | Message Queue |
| Apache Tika | 3.2.3 | Document Parsing |
| AWS S3 SDK | 2.40.2 | Object Storage |
| SA-Token | 1.43.0 | Authentication and Authorization |
| Redisson | 4.0.0 | Redis Client |
| MCP SDK | 1.1.2 | Model Context Protocol |
### Frontend
| Technology | Version | Purpose |
|------|------|------|
| React | 18.3 | UI Framework |
| TypeScript | 5.5 | Type System |
| Vite | 5.4 | Build Tool |
| Tailwind CSS | 3.4 | CSS Framework |
| Radix UI | - | Headless UI Components |
| Zustand | 4.5 | State Management |
| React Router | 6.26 | Routing Management |
| Axios | 1.7 | HTTP Client |
| Recharts | 3.7 | Chart Library |
---
## Quick Start
### Environmental Requirements
- JDK 17+
- Maven 3.8+
- Node.js 18+
- PostgreSQL 14+ (pgvector extension required)
- Redis 6+
- RocketMQ 5.2+
- Milvus 2.6+ (optional, pgvector can be used instead)
### 1. Clone Project
```bash
git clone <repository-url>
cd ragent-ai
```
### 2. Start Infrastructure
Use Docker Compose to start dependent services:
```bash
# Start Milvus + RustFS (Object Storage)
docker compose -f resources/docker/milvus-stack-2.6.6.compose.yaml up -d
# Start RocketMQ
docker compose -f resources/docker/rocketmq-stack-5.2.0.compose.yaml up -d
# Start PostgreSQL and Redis (prepare or use existing instances)
```
### 3. Initialize Database
```bash
# Connect PostgreSQL and execute initialization script
psql -U postgres -d ragent -f resources/database/schema_pg.sql
psql -U postgres -d ragent -f resources/database/init_data_pg.sql
```
### 4. Configure Application
Edit `bootstrap/src/main/resources/application.yaml`:
```yaml
spring:
datasource:
url: jdbc:postgresql://127.0.0.1:5432/ragent
username: postgres
password: your_password
data:
redis:
host: 127.0.0.1
port: 6379
password: your_password
rocketmq:
name-server: 127.0.0.1:9876
milvus:
uri: http://localhost:19530
rag:
vector:
type: pg # Optional: milvus / pg
```
### 5. Start Backend
```bash
# Compile and start main service
./mvnw clean install -DskipTests
./mvnw spring-boot:run -pl bootstrap
# Start MCP Server (optional)
./mvnw spring-boot:run -pl mcp-server
```
Backend service runs at `http://localhost:9090/api/ragent` by default.
### 6. Start Frontend
```bash
cd frontend
npm install
npm run dev
```
Frontend development server runs at `http://localhost:5173`.
### 7. Access System
- **User End**: http://localhost:5173
- **Management Background**: http://localhost:5173 (login and automatically jump according to role)
- **Default Account**: `admin / admin`
---
## Project Structure
```
ragent-ai/
├── bootstrap/ # Main Application Module (Spring Boot)
│ ├── src/main/java/
│ │ └── com/nageoffer/ai/ragent/
│ │ ├── RagentApplication.java
│ │ ├── admin/ # Management Background Service
│ │ ├── ingestion/ # Document Ingestion Pipeline
│ │ ├── knowledge/ # Knowledge Base Management
│ │ ├── rag/ # RAG Core Engine
│ │ │ ├── controller/ # API Interface
│ │ │ ├── core/ # Core Logic
│ │ │ │ ├── intent/ # Intent Recognition
│ │ │ │ ├── retrieve/ # Retrieval Engine
│ │ │ │ ├── memory/ # Conversational Memory
│ │ │ │ ├── prompt/ # Prompt Template
│ │ │ │ └── mcp/ # MCP Integration
│ │ │ └── service/ # Business Service
│ │ └── user/ # User Authentication
│ └── src/main/resources/
│ ├── application.yaml
│ ├── prompt/ # Prompt Template Files
│ └── lua/ # Redis Lua Scripts
│
├── framework/ # Public Framework Module
│ └── src/main/resources/lua/ # Snowflake Algorithm Lua Scripts
│
├── infra-ai/ # AI Infrastructure Module
│
├── mcp-server/ # MCP Service Module
│ └── src/main/java/
│ └── McpServerApplication.java
│
├── frontend/ # Frontend Application (React + Vite)
│ ├── src/
│ │ ├── components/ # UI Components
│ │ ├── pages/ # Pages
│ │ │ ├── admin/ # Management Background Pages
│ │ │ ├── ChatPage.tsx # Chat Page
│ │ │ └── LoginPage.tsx # Login Page
│ │ ├── services/ # API Services
│ │ ├── stores/ # State Management
│ │ └── hooks/ # Custom Hooks
│ ├── package.json
│ └── vite.config.ts
│
├── resources/ # Project Resources
│ ├── database/ # Database Scripts
│ │ ├── schema_pg.sql # PostgreSQL Table Creation Script
│ │ └── init_data_pg.sql # Initialization Data
│ ├── docker/ # Docker Compose Configuration
│ │ ├── milvus-stack-2.6.6.compose.yaml
│ │ └── rocketmq-stack-5.2.0.compose.yaml
│ └── docs/ # Example Knowledge Base Documents
│
├── docs/ # Project Documentation
│ ├── quick-start.md # Quick Start
│ ├── multi-channel-retrieval.md # Multi-Channel Retrieval Architecture
│ └── refactoring-summary.md # Refactoring Summary
│
├── assets/ # Document Image Resources
├── pom.xml # Maven Parent POM
└── README.md # This File
```
---
## Core Module Description
### RAG Engine (`rag/core`)
| Module | Description |
|------|------|
| `intent` | Intent Classifier, Intent Parser, Intent Tree Management |
| `retrieve` | Multi-Channel Retrieval Engine, Milvus/Pg Retrieval Service |
| `memory` | Conversational Memory Storage, Automatic Summary Generation |
| `prompt` | Prompt Template Loading, Context Formatting |
| `rewrite` | Query Rewriting, Terminology Mapping |
| `mcp` | MCP Parameter Extraction, Tool Invocation |
### Management Background (`admin`)
| Function | Description |
|------|------|
| Dashboard | System Overview, Statistical Charts |
| Knowledge Base | Knowledge Base CRUD, Chunk Management, Document Management |
| Intent Tree | Intent Classification Tree Editing, Example Problem Management |
| Ingestion Pipeline | Document Upload, Parsing Task Monitoring |
| Link Tracking | RAG Retrieval-Generation Link Visualization |
| System Settings | Model Configuration, Theme Settings, Query Terminology Mapping |
---
## Documentation
- [Quick Start Guide](docs/quick-start.md)
- [Multi-Channel Retrieval Architecture](docs/multi-channel-retrieval.md)
- [Refactoring Summary](docs/refactoring-summary.md)
- [PDF Ingestion Example](docs/examples/pdf-ingestion-example.md)
---
## License
This project is open-sourced under the [Apache License 2.0](LICENSE).
---
<p align="center">
Made with ❤️ by Nageoffer AI Team
</p>
MCP Config
Below is the configuration for this MCP Server. You can copy it directly to Cursor or other MCP clients.
mcp.json
Connection Info
You Might Also Like
No recommendations available