logo
0
0
Login
Forkfromxjtu-cs/training/final-project, ahead:main2 commits, behind:main2 commits
RAG Web UI Demo

Knowledge Base Management Based on RAG (Retrieval-Augmented Generation)

License Python Node PRs Welcome

FeaturesQuick StartDeploymentArchitectureDevelopmentContributing

English | 简体中文

📖 Introduction

RAG Web UI is an intelligent dialogue system based on RAG (Retrieval-Augmented Generation) technology that helps build intelligent Q&A systems based on your own knowledge base. By combining document retrieval and large language models, it achieves accurate and reliable knowledge-based question answering services.

The system supports multiple LLM deployment options, including cloud services like OpenAI and DeepSeek, as well as local model deployment through Ollama, meeting privacy and cost requirements in different scenarios.

It also provides OpenAPI interfaces for convenient knowledge base access via API calls.

✨ Features

  • 📚 Intelligent Document Management

    • Support for multiple document formats (PDF, DOCX, Markdown, Text)
    • Automatic document chunking and vectorization
    • Support for async document processing and incremental updates
  • 🤖 Advanced Dialogue Engine

    • Precise retrieval and generation based on RAG
    • Support for multi-turn contextual dialogue
    • Support for reference citations in conversations
  • 🎯 Robust Architecture

    • Frontend-backend separation design
    • Distributed file storage
    • High-performance vector database: Support for ChromaDB, Qdrant with easy switching through Factory pattern

🖼️ Screenshots

Knowledge Base Management

Knowledge Base Management Dashboard

Chat Interface

Document Processing Dashboard

Document Processing

Document List

System Settings

Intelligent Chat Interface with References

Analytics Dashboard

API Key Management

Analytics Dashboard

API Reference

Project Flowchart

🚀 Quick Start

Prerequisites

  • Docker & Docker Compose v2.0+
  • Node.js 18+
  • Python 3.9+
  • 8GB+ RAM

Installation

  1. Clone the repository
git clone https://github.com/rag-web-ui/rag-web-ui.git cd rag-web-ui
  1. Configure environment variables

You can check the details in the configuration table below.

cp .env.example .env
  1. Start services(development server)
docker compose up -d --build

Verification

Access the following URLs after service startup:

🏗️ Architecture

Backend Stack

  • 🐍 Python FastAPI: High-performance async web framework
  • 🗄️ MySQL + ChromaDB: Relational + Vector databases
  • 📦 MinIO: Distributed object storage
  • 🔗 Langchain: LLM application framework
  • 🔒 JWT + OAuth2: Authentication

Frontend Stack

  • ⚛️ Next.js 14: React framework
  • 📘 TypeScript: Type safety
  • 🎨 Tailwind CSS: Utility-first CSS
  • 🎯 Shadcn/UI: High-quality components
  • 🤖 Vercel AI SDK: AI integration

📈 Performance Optimization

The system is optimized in the following aspects:

  • ⚡️ Incremental document processing and async chunking
  • 🔄 Streaming responses and real-time feedback
  • 📑 Vector database performance tuning
  • 🎯 Distributed task processing

📖 Development Guide

docker compose -f docker-compose.dev.yml up -d --build

🔧 Configuration

Core Configuration

ParameterDescriptionDefaultRequired
MYSQL_SERVERMySQL Server Addresslocalhost
MYSQL_USERMySQL Usernamepostgres
MYSQL_PASSWORDMySQL Passwordpostgres
MYSQL_DATABASEMySQL Database Nameragwebui
SECRET_KEYJWT Secret Key-
ACCESS_TOKEN_EXPIRE_MINUTESJWT Token Expiry (minutes)30

LLM Configuration

ParameterDescriptionDefaultApplicable
CHAT_PROVIDERLLM Service Provideropenai
OPENAI_API_KEYOpenAI API Key-Required for OpenAI
OPENAI_API_BASEOpenAI API Base URLhttps://api.openai.com/v1Optional for OpenAI
OPENAI_MODELOpenAI Model Namegpt-4Required for OpenAI
DEEPSEEK_API_KEYDeepSeek API Key-Required for DeepSeek
DEEPSEEK_API_BASEDeepSeek API Base URL-Required for DeepSeek
DEEPSEEK_MODELDeepSeek Model Name-Required for DeepSeek
OLLAMA_API_BASEOllama API Base URLhttp://localhost:11434Required for Ollama
OLLAMA_MODELOllama Model Namellama2Required for Ollama

Embedding Configuration

ParameterDescriptionDefaultApplicable
EMBEDDINGS_PROVIDEREmbedding Service Provideropenai
OPENAI_API_KEYOpenAI API Key-Required for OpenAI Embedding
OPENAI_EMBEDDINGS_MODELOpenAI Embedding Modeltext-embedding-ada-002Required for OpenAI Embedding
DASH_SCOPE_API_KEYDashScope API Key-Required for DashScope
DASH_SCOPE_EMBEDDINGS_MODELDashScope Embedding Model-Required for DashScope
OLLAMA_EMBEDDINGS_MODELOllama Embedding Modeldeepseek-r1:7bRequired for Ollama Embedding

Vector Database Configuration

ParameterDescriptionDefaultApplicable
VECTOR_STORE_TYPEVector Store Typechroma
CHROMA_DB_HOSTChromaDB Server AddresslocalhostRequired for ChromaDB
CHROMA_DB_PORTChromaDB Port8000Required for ChromaDB
QDRANT_URLQdrant Vector Store URLhttp://localhost:6333Required for Qdrant
QDRANT_PREFER_GRPCPrefer gRPC Connection for QdranttrueOptional for Qdrant

Object Storage Configuration

ParameterDescriptionDefaultRequired
MINIO_ENDPOINTMinIO Server Addresslocalhost:9000
MINIO_ACCESS_KEYMinIO Access Keyminioadmin
MINIO_SECRET_KEYMinIO Secret Keyminioadmin
MINIO_BUCKET_NAMEMinIO Bucket Namedocuments

Other Configuration

ParameterDescriptionDefaultRequired
TZTimezone SettingAsia/Shanghai

🤝 Contributing

We welcome community contributions!

Contribution Process

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add some AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Create a Pull Request

Development Guidelines

🚧 Roadmap

  • Knowledge Base API Integration
  • Workflow By Natural Language
  • Multi-path Retrieval
  • Support Multiple Models
  • Support Multiple Vector Databases

📄 License

This project is licensed under the Apache-2.0 License

Note

This project is for learning and sharing RAG knowledge only. Please do not use it for commercial purposes. It is not ready for production use and is still under active development.

🙏 Acknowledgments

Thanks to these open source projects:

star history


If this project helps you, please consider giving it a ⭐️

About

No description, topics, or website provided.
63.41 GiB
0 forks0 stars6 branches14 TagREADMEApache-2.0 license
Language
TypeScript47.2%
Python29.4%
Markdown16.6%
License1.8%
Others5%