Local_Pdf_Chat_RAG  by weiwill88

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

Created 7 months ago
655 stars

Top 51.0% 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

2 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
33 stars in the last 30 days

Explore Similar Projects

Starred by John Resig John Resig(Author of jQuery; Chief Software Architect at Khan Academy), Chenlin Meng Chenlin Meng(Cofounder of Pika), and
9 more.

clip-retrieval by rom1504

0.2%
3k
CLIP retrieval system for semantic search
Created 4 years ago
Updated 1 month ago
Feedback? Help us improve.