Kotaemon - Open Source RAG Document Intelligent Question Answering Tool
Project Overview
Kotaemon is an open-source RAG (Retrieval-Augmented Generation) tool specifically designed for conversational interaction with documents. The project aims to provide both end-users and developers with a fully functional RAG user interface, meeting users' needs for document question answering and assisting developers in building their own RAG pipelines.
Core Features
End-User Features
- Clean and Beautiful UI: Provides a user-friendly RAG question answering interface.
- Multiple LLM Support: Compatible with various LLM API providers (OpenAI, AzureOpenAI, Cohere, etc.) and local LLMs (via ollama and llama-cpp-python).
- Easy Installation: Offers simple scripts for quick startup.
- Multi-User Support: Supports multi-user login, allowing the creation of private/public document collections, supporting collaboration and sharing.
Developer Features
- RAG Pipeline Framework: Provides tools for building RAG document question answering pipelines.
- Customizable UI: Built on Gradio, allowing visualization of the actual effects of the RAG pipeline.
- Hybrid RAG Pipeline: Employs hybrid (full-text and vector) retrievers and re-ranking to ensure optimal retrieval quality.
- Extensibility: Supports custom UI elements and various document indexing and retrieval strategies.
Advanced Features
- Multi-Modal Question Answering Support: Supports multi-document question answering involving charts and tables, and supports multi-modal document parsing.
- Advanced Citation Functionality: Provides detailed citation information to ensure the correctness of LLM answers, with direct viewing of highlighted citations in the browser's PDF viewer.
- Complex Reasoning Methods: Supports question decomposition to answer complex/multi-hop questions, and supports Agent-based reasoning such as ReAct, ReWOO, etc.
- Configurable Settings Interface: Allows adjustment of key aspects of the retrieval and generation process (including prompts) on the UI.
Technical Architecture
Supported Document Formats
- PDF, HTML, MHTML, XLSX
- Supports more formats (.doc, .docx, etc.) through the Unstructured library.
Data Storage Options
- Document Storage: Elasticsearch, LanceDB, SimpleFileDocumentStore
- Vector Storage: ChromaDB, LanceDB, InMemory, Milvus, Qdrant
LLM Model Support
- API Providers: OpenAI, Azure OpenAI, Cohere, Groq, etc.
- Local Models: Supports GGUF format models via Ollama and llama-cpp-python.
GraphRAG Integration
The project supports two GraphRAG implementations:
NanoGraphRAG (Recommended)
- More direct Kotaemon integration.
- Automatically identifies default LLM and embedding models.
MS GraphRAG
- Official Microsoft GraphRAG implementation.
- Only supports OpenAI or Ollama API.
- Supports local models and custom settings.
Installation and Deployment
Docker Deployment (Recommended)
Provides slim and full Docker images:
- Slim Version: Supports basic file types, smaller image size.
- Full Version: Includes the unstructured package, supports more file types.
Local Installation
- Download the latest version of the release file.
- Configure the .env file.
- Run
python app.pyto start the service. - The default username and password are
admin.
Customization and Extension
Custom Reasoning Pipeline
- New .py implementations can be added in
libs/ktem/ktem/reasoning/. - Enable new reasoning pipelines through flowsettings.
Custom Indexing Pipeline
- Refer to the example implementation in
libs/ktem/ktem/index/file/graph. - Supports GraphRAG indexing pipelines.
Configuration Files
- flowsettings.py: Application configuration.
- .env: Model and credential configuration.
Application Scenarios
- Enterprise Knowledge Management: Building internal document question answering systems.
- Academic Research: Intelligent question answering on research literature.
- Legal Document Analysis: Quickly retrieving and analyzing legal documents.
- Technical Documentation Support: Providing intelligent query for technical documentation.
- Personal Knowledge Base: Managing and querying personal document collections.
Project Advantages
- Open Source and Free: Completely open source, free to use and modify.
- Fully Functional: Comprehensive functionality, from simple question answering to complex reasoning.
- Easy to Use: Intuitive web interface, usable without technical background.
- Highly Customizable: Supports multiple configuration and extension options.
- Active Community: Continuous updates and community support.
Technical Features
- Developed based on Python.
- Uses Gradio to build the web interface.
- Supports Docker containerized deployment.
- Modular architecture design.
- Supports GPU acceleration (local models).
Summary
Kotaemon is a powerful RAG UI tool that allows users to interact with documents conversationally. It not only provides end-users with a simple and easy-to-use document question answering interface but also provides developers with a complete framework for building custom RAG systems. With features such as hybrid retrieval, multi-modal support, and advanced citation, Kotaemon provides a comprehensive and professional solution in the field of document intelligent question answering.