Local_Pdf_Chat_RAG  by weiwill88

RAG system for local PDF Q&A, aiding RAG beginners

created 6 months ago
602 stars

Top 55.1% on sourcepulse

GitHubView on GitHub
Project Summary

A local RAG system designed for beginners to understand core components and workflows, enabling hands-on practice with PDF processing, intelligent Q&A, and hybrid retrieval. It supports local Ollama models and optional web search, offering a user-friendly Gradio interface for an accessible learning experience.

How It Works

The system processes uploaded PDFs by extracting text, splitting it into chunks, and generating embeddings using sentence-transformers. These embeddings are stored in a FAISS index for semantic search, while BM25 is used for keyword retrieval. A hybrid search combines both, followed by re-ranking using a cross-encoder or LLM to refine results. The LLM (Ollama or SiliconFlow) then generates answers based on the retrieved context, with optional web search (SerpAPI) and recursive querying for deeper information retrieval.

Quick Start & Requirements

  • Install dependencies: pip install -r requirements.txt
  • Run the demo: python rag_demo_pro.py
  • Prerequisites: Python 3.9+, Ollama (for local LLMs), optional API keys for SerpAPI and SiliconFlow.
  • Documentation: README

Highlighted Details

  • Hybrid retrieval combining FAISS semantic search and BM25 keyword search.
  • Re-ranking of retrieved results using cross-encoders or LLMs.
  • Supports local Ollama models (e.g., DeepSeek-R1) and optional web search via SerpAPI.
  • Gradio interface for easy interaction, including PDF upload and chunk visualization.
  • Recursive retrieval capability for iterative, in-depth information gathering.

Maintenance & Community

  • Project maintained by weiwill88.
  • Community engagement encouraged via knowledge sharing platforms (WeChat Official Account, Xiaohongshu, Knowledge Planet).

Licensing & Compatibility

  • MIT License. Permissive for commercial use and integration into closed-source projects.

Limitations & Caveats

The project is positioned as an entry-level RAG implementation, suggesting potential for further development in areas like advanced text splitting, FAISS index management, and context compression for more complex scenarios.

Health Check
Last commit

1 month ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
3
Star History
300 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems) and Simon Willison Simon Willison(Author of Django).

semantra by freedmand

0.0%
3k
CLI tool for semantic document search
created 2 years ago
updated 11 months ago
Feedback? Help us improve.