Skip to content

Feature/pdf chat rag 298#301

Merged
Avdhesh-Varshney merged 11 commits intocode-a2z:mainfrom
satyajit-patel:feature/pdf-chat-rag-298
Jun 19, 2025
Merged

Feature/pdf chat rag 298#301
Avdhesh-Varshney merged 11 commits intocode-a2z:mainfrom
satyajit-patel:feature/pdf-chat-rag-298

Conversation

@satyajit-patel
Copy link
Contributor

Closes: #298

RAG-based PDF Chat Feature Implementation
I have implemented a comprehensive RAG (Retrieval-Augmented Generation) based PDF chat system that allows users to upload PDF documents and interact with their content through natural language queries. Here are the key additions and changes:

Working Video 📷

Demo Video: RAG PDF Chat Feature Demo

🚀 New Features Added:

  • PDF Upload Interface: Streamlit-based file uploader supporting PDF documents
  • Document Processing Pipeline:
    • PDF text extraction using PyPDFLoader
    • Intelligent text chunking with RecursiveCharacterTextSplitter (1000 chars with 100 overlap)
    • Document embedding generation using Google Generative AI embeddings
  • Vector Database Integration: FAISS vector store for efficient similarity search
  • AI-Powered Chat Interface:
    • Integration with Groq's Llama-3.1-8b-instant model
    • Context-aware responses using retrieved document chunks
    • MMR (Maximal Marginal Relevance) search for diverse results
  • Session Management: Streamlit session state for maintaining chat context
  • Error Handling: Comprehensive error handling for API keys, file processing, and chat responses

📁 Files Added/Modified:

  • chatWithYourPDF.py - Main application file
  • .env.example - Environment variable template
  • requirements.txt - Updated dependencies
  • Bug fix
  • New feature
  • Code style update (formatting, local variables)
  • Documentation update
  • Database update

Note to reviewers 📄

Future Enhancements Ready:

  • Multi-document chat support
  • Chat history persistence
  • Advanced filtering options
  • Export conversation functionality

@github-actions
Copy link

Thank you for submitting your pull request! We'll review it as soon as possible. For further communication, join our discord server https://discord.gg/tSqtvHUJzE.

Copy link
Collaborator

@Avdhesh-Varshney Avdhesh-Varshney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Collaborator

@Avdhesh-Varshney Avdhesh-Varshney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RAG-based PDF Chat -where users can upload a PDF and chat with its content interactively.

3 participants