Baike.dev
All toolsTrendingOpen sourceNewsSubmit
Log in
< 返回工具列表
R

RAG-Anything

> 编程语言
开源

"RAG-Anything: All-in-One RAG Framework"

22.5K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

"RAG-Anything: All-in-One RAG Framework"

🚀 RAG-Anything: All-in-One RAG Framework



🎉 News

  • [2026.06]🎯📢 🎉 LightRAG enables multimodal RAG through native integration of RAG-Anything.
  • [2025.10]🎯📢 🚀 We have released the technical report of RAG-Anything. Access it now to explore our latest research findings.
  • [2025.08]🎯📢 🔍 RAG-Anything now features VLM-Enhanced Query mode! When documents include images, the system seamlessly integrates them into VLM for advanced multimodal analysis, combining visual and textual context for deeper insights.
  • [2025.07]🎯📢 RAG-Anything now features a context configuration module, enabling intelligent integration of relevant contextual information to enhance multimodal content processing.
  • [2025.07]🎯📢 🚀 RAG-Anything now supports multimodal query capabilities, enabling enhanced RAG with seamless processing of text, images, tables, and equations.
  • [2025.07]🎯📢 🎉 RAG-Anything has reached 1k🌟 stars on GitHub! Thank you for your incredible support and valuable contributions to the project.

🌟 System Overview

Next-Generation Multimodal Intelligence

🎯 Key Features


🏗️ Algorithm & Architecture

  </div>
  

  

    

  </div>
  

  

    

  </div>
  

  

    

  </div>
</div>

1. Document Parsing Stage

2. Multi-Modal Content Understanding & Processing

3. Multimodal Analysis Engine

4. Multimodal Knowledge Graph Index

5. Modality-Aware Retrieval


🚀 Quick Start

Initialize Your AI Journey

Installation

Option 1: Install from PyPI (Recommended)

# Basic installation
pip install raganything

# With optional dependencies for extended format support:
pip install 'raganything[all]'              # All optional features
pip install 'raganything[image]'            # Image format conversion (BMP, TIFF, GIF, WebP)
pip install 'raganything[text]'             # Text file processing (TXT, MD)
pip install 'raganything[image,text]'       # Multiple features

Option 2: Install from Source

…

Optional Dependencies

  • [image] - Enables processing of BMP, TIFF, GIF, WebP image formats (requires Pillow)
  • [text] - Enables processing of TXT and MD files (requires ReportLab)
  • [all] - Includes all Python optional dependencies

⚠️ Office Document Processing Requirements:

  • Office documents (.doc, .docx, .ppt, .pptx, .xls, .xlsx) require LibreOffice installation
  • Download from LibreOffice official website
  • Windows: Download installer from official website
  • macOS: brew install --cask libreoffice
  • Ubuntu/Debian: sudo apt-get install libreoffice
  • CentOS/RHEL: sudo yum install libreoffice

Check MinerU installation:

# Verify installation
mineru --version

# Check if properly configured
python -c "from raganything import RAGAnything; rag = RAGAnything(); print('✅ MinerU installed properly' if rag.check_parser_installation() else '❌ MinerU installation issue')"

Models are downloaded automatically on first use. For manual download, refer to MinerU Model Source Configuration.

Usage Examples

1. End-to-End Document Processing

…

2. Direct Multimodal Content Processing

…

3. Batch Processing

# Process multiple documents
await rag.process_folder_complete(
    folder_path="./documents",
    output_dir="./output",
    file_extensions=[".pdf", ".docx", ".pptx"],
    recursive=True,
    max_workers=4
)

4. Custom Modal Processors

from raganything.modalprocessors import GenericModalProcessor

class CustomModalProcessor(GenericModalProcessor):
    async def process_multimodal_content(self, modal_content, content_type, file_path, entity_name):
        # Your custom processing logic
        enhanced_description = await self.analyze_custom_content(modal_content)
        entity_info = self.create_custom_entity(enhanced_description, entity_name)
        return await self._create_entity_and_chunk(enhanced_description, entity_info, file_path)

5. Query Options

RAG-Anything provides three types of query methods:

Pure Text Queries - Direct knowledge base search using LightRAG:

# Different query modes for text queries
text_result_hybrid = await rag.aquery("Your question", mode="hybrid")
text_result_local = await rag.aquery("Your question", mode="local")
text_result_global = await rag.aquery("Your question", mode="global")
text_result_naive = await rag.aquery("Your question", mode="naive")

# Synchronous version
sync_text_result = rag.query("Your question", mode="hybrid")

VLM Enhanced Queries - Automatically analyze images in retrieved context using VLM:

…

Multimodal Queries - Enhanced queries with specific multimodal content analysis:

…

6. Loading Existing LightRAG Instance

…

7. Direct Content List Insertion

For scenarios where you already have a pre-parsed content list (e.g., from external parsers or previous processing), you can directly insert it into RAGAnything without document parsing:

…

Content List Format:

The content_list should follow the standard format with each item being a dictionary containing:

  • Text content: {"type": "text", "text": "content text", "page_idx": 0}
  • Image content: {"type": "image", "img_path": "/absolute/path/to/image.jpg", "image_caption": ["caption"], "image_footnote": ["note"], "page_idx": 1}
  • Table content: {"type": "table", "table_body": "markdown table", "table_caption": ["caption"], "table_footnote": ["note"], "page_idx": 2}
  • Equation content: {"type": "equation", "latex": "LaTeX formula", "text": "description", "page_idx": 3}
  • Generic content: {"type": "custom_type", "content": "any content", "page_idx": 4}
  • Audio content: {"type": "audio", "audio_path": "/absolute/path/to/talk.wav", "audio_caption": ["caption"], "page_idx": 5} — transcribed locally with faster-whisper (timestamped segments); long recordings are windowed into ordered chunks
  • Video content: {"type": "video", "video_path": "/absolute/path/to/demo.mp4", "video_caption": ["caption"], "page_idx": 6} — SceneDetect scene boundaries + keyframe VLM description + audio-track transcription, merged by timestamp

Important Notes:

  • img_path: Must be an absolute path to the image file (e.g., /home/user/images/chart.jpg or C:\Users\user\images\chart.jpg)
  • page_idx: Represents the page number where the content appears in the original document (0-based indexing)
  • Content ordering: Items are processed in the order they appear in the list

This method is particularly useful when:

  • You have content from external parsers (non-MinerU/Docling)
  • You want to process programmatically generated content
  • You need to insert content from multiple sources into a single knowledge base
  • You have cached parsing results that you want to reuse

8. Re-processing Multimodal Content After a Storage Backend Change

By default, process_document_complete and insert_content_list skip multimodal (image/table/equation) processing for a document that is already marked as fully processed, to avoid redundant LLM calls. If you switch to a new graph/vector storage backend (e.g. migrating from the default file-based storage to Neo4j), the new backend will not yet contain the multimodal entities/relations that were written to the old one — see #154.

Pass force_multimodal_reprocess=True to explicitly re-run multimodal processing and re-populate the current storage backend for an already-processed document:

# Re-run multimodal processing so the current storage backend has the
# image/table/equation entities and relations (default is False, i.e. no change
# to existing behavior for documents that have not switched backends)
await rag.process_document_complete(
    file_path="path/to/your/document.pdf",
    doc_id="doc-already-processed-id",
    force_multimodal_reprocess=True,
)

# Same flag is available for direct content list insertion
await rag.insert_content_list(
    content_list=content_list,
    doc_id="doc-already-processed-id",
    force_multimodal_reprocess=True,
)

This flag only affects multimodal content; it is opt-in and defaults to False, so existing behavior is unchanged unless you explicitly set it.


🛠️ Examples

Practical Implementation Demos

The examples/ directory contains comprehensive usage examples:

  • raganything_example.py: End-to-end document processing with MinerU
  • modalprocessors_example.py: Direct multimodal content processing
  • office_document_test.py: Office document parsing test with MinerU (no API key required)
  • image_format_test.py: Image format parsing test with MinerU (no API key required)
  • text_format_test.py: Text format parsing test with MinerU (no API key required)

Run examples:

…

🔧 Configuration

System Optimization Parameters

Environment Variables

Create a .env file (refer to .env.example):

OPENAI_API_KEY=your_openai_api_key
OPENAI_BASE_URL=your_base_url  # Optional
OUTPUT_DIR=./output             # Default output directory for parsed documents
PARSER=mineru                   # Parser selection: mineru, docling, or paddleocr
PARSE_METHOD=auto              # Parse method: auto, ocr, or txt

Note: For backward compatibility, legacy environment variable names are still supported:

  • MINERU_PARSE_METHOD is deprecated, please use PARSE_METHOD

Note: API keys are only required for full RAG processing with LLM integration. The parsing test files (office_document_test.py and image_format_test.py) only test parser functionality and do not require API keys.

Troubleshooting and multimodal checklist

  • See docs/multimodal_rag_failure_modes.md for a short checklist of common pipeline issues (OCR, tables, retrieval bias, debugging tips). Related: #207, #213.

Public media URLs (CDN / object storage)

When ingestion runs on a server but your UI or another service needs HTTPS (or S3-style) links to figures, set:

# Base URL for assets (no trailing slash required)
RAGANYTHING_PUBLIC_ASSET_BASE_URL=https://my-bucket.s3.us-east-1.amazonaws.com/prefix
# Filesystem root that should be stripped from absolute paths under that tree
RAGANYTHING_PUBLIC_ASSET_STRIP_PREFIX=/var/rag/output

After parsing, each non-empty img_path, table_img_path, or equation_img_path may gain a sibling field *_public_url while the original path stays on disk for local processing. See #272.

Scope today: this mapping runs in the MinerU parser path only. Other parsers (e.g. Docling) keep working but will not produce *_public_url fields until the helper is wired into their content_list post-processing as well. If only one of the two env vars is set, RAG-Anything logs a warning and skips URL attachment.

Parser Configuration

RAGAnything now supports multiple parsers, each with specific advantages:

MinerU Parser

  • Supports PDF, images, Office documents, and more formats
  • Powerful OCR and table extraction capabilities
  • GPU acceleration support

Docling Parser

  • Optimized for Office documents and HTML files
  • Better document structure preservat

核心特点

  • •[X] [2026.06]🎯📢 🎉 LightRAG enables multimodal RAG through native integration of RAG-Anything.
  • •[X] [2025.10]🎯📢 🚀 We have released the technical report of RAG-Anything. Access it now to explore our latest research findings.
  • •[X] [2025.07]🎯📢 🚀 RAG-Anything now supports multimodal query capabilities, enabling enhanced RAG with seamless processing of text, images, tables, and equations.
  • •[X] [2025.07]🎯📢 🎉 RAG-Anything has reached 1k🌟 stars on GitHub! Thank you for your incredible support and valuable contributions to the project.
  • •[image] - Enables processing of BMP, TIFF, GIF, WebP image formats (requires Pillow)
  • •[text] - Enables processing of TXT and MD files (requires ReportLab)
  • •[all] - Includes all Python optional dependencies
  • •Text content: {"type": "text", "text": "content text", "page_idx": 0}
  • •Image content: {"type": "image", "img_path": "/absolute/path/to/image.jpg", "image_caption": ["caption"], "image_footnote": ["note"], "page_idx": 1}
  • •Table content: {"type": "table", "table_body": "markdown table", "table_caption": ["caption"], "table_footnote": ["note"], "page_idx": 2}

> 标签

Pythonmulti-modal-ragretrieval-augmented-generation

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月9日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言
Baike.dev

baike.dev helps you discover great languages, frameworks, databases, DevOps and cloud-native tools.

Quick links

  • Home
  • All tools
  • Trending
  • Open source

About

  • About us
  • Community
  • News

Contribute

Found a great developer tool? Share it with the community.

Submit a tool
© 2026 baike.dev Developer EncyclopediaUpdated daily · Discover great developer tools