Skip to content

A powerful Retrieval Augmented Generation (RAG) application built with NVIDIA AI endpoints and Streamlit. This solution enables intelligent document analysis and question-answering using state-of-the-art language models, featuring multi-PDF processing, FAISS vector store integration, and advanced prompt engineering.

License

Notifications You must be signed in to change notification settings

arsath-eng/RAG1-NVIDIA-GENAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š RAG Applications with NVIDIA NeMo and Streamlit

Python Streamlit NVIDIA License

Project Banner

🌟 Overview

A sophisticated implementation of Retrieval Augmented Generation (RAG) leveraging NVIDIA's AI endpoints and Streamlit. This application transforms document analysis and question-answering through state-of-the-art language models and efficient vector search capabilities.

🎯 Core Features

  • πŸ“„ Multi-PDF Document Processing
  • πŸ” Advanced Text Chunking System
  • πŸ’Ύ FAISS Vector Store Integration
  • ⚑ NVIDIA NIM Endpoints
  • πŸ€– Llama 3.1 405B Model Support
  • ⏱️ Real-time Performance Metrics
  • πŸ“Š Similarity Search Visualization

πŸ› οΈ Technical Architecture

Component Stack

graph TD
    A[PDF Documents] --> B[Document Processor]
    B --> C[Text Chunker]
    C --> D[NVIDIA Embeddings]
    D --> E[FAISS Vector Store]
    F[User Query] --> G[Query Processor]
    G --> E
    E --> H[NVIDIA LLM]
    H --> I[Response Generator]
Loading

System Requirements

  • Python 3.8+
  • 8GB RAM minimum
  • NVIDIA API access
  • Internet connectivity
  • PDF processing capabilities

πŸ“¦ Installation & Setup

1. Clone Repository

git clone https://github.com/arsath-eng/RAG1-NVIDIA-GENAI.git
cd RAG1-NVIDIA-GENAI

2. Environment Setup

# Create virtual environment
python -m venv venv

# Activate environment
# For Windows
.\venv\Scripts\activate
# For Unix/Mac
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

3. Configuration

# Create environment file
touch .env

# Add required credentials
NVIDIA_API_KEY=your_api_key_here

πŸ’» Usage Guide

Application Launch

streamlit run app.py

Document Processing Workflow

  1. Document Upload

    • Support for multiple PDF files
    • Automatic text extraction
    • Progress tracking
  2. Embedding Creation

    • Click "Create Document Embeddings"
    • Automatic chunking and processing
    • Vector store initialization
  3. Query Processing

    • Enter questions about documents
    • Real-time response generation
    • View similarity search results

    Project Banner

Project Banner

Project Banner

Project Banner

Project Banner

Project Banner

## βš™οΈ Configuration Options

Text Splitting Parameters

text_splitter = RecursiveCharacterTextSplitter(
    chunk_size=700,  # Adjust for document length
    chunk_overlap=50  # Modify for context preservation
)

Model Configuration

llm = ChatNVIDIA(
    model="meta/llama-3.1-405b-instruct",
    temperature=0.7,  # Adjust for response creativity
    max_tokens=512    # Modify for response length
)

πŸ“ˆ Performance Optimization

Vector Store Tuning

  • Optimal chunk size selection
  • Embedding dimension management
  • Index optimization techniques

Response Time Improvements

  • Query preprocessing
  • Cache implementation
  • Batch processing capabilities

πŸ” Advanced Features

1. Intelligent Chunking

  • Content-aware text splitting
  • Semantic boundary preservation
  • Overlap optimization

2. Vector Search Enhancement

  • Nearest neighbor search
  • Similarity threshold tuning
  • Result ranking optimization

3. Response Generation

  • Context-aware answers
  • Source attribution
  • Confidence scoring

πŸš€ Best Practices

Document Preparation

  • Use clear, well-formatted PDFs
  • Ensure text is extractable
  • Optimize document size

Query Formulation

  • Be specific and clear
  • Include relevant context
  • Use natural language

System Optimization

  • Monitor memory usage
  • Regular cache clearing
  • Performance tracking

πŸ› οΈ Troubleshooting

Common Issues

  1. PDF Processing Errors

    • Solution: Check PDF format compatibility
    • Verify text extraction capabilities
  2. Memory Issues

    • Solution: Adjust chunk size
    • Implement batch processing
  3. API Connection

    • Solution: Verify credentials
    • Check network connectivity

🀝 Contributing

Development Workflow

  1. Fork repository
  2. Create feature branch
git checkout -b feature/YourFeature
  1. Commit changes
git commit -m 'Add YourFeature'
  1. Push to branch
git push origin feature/YourFeature
  1. Submit Pull Request

πŸ“ License

This project is licensed under the MIT License. See LICENSE for details.

πŸ™ Acknowledgments

  • NVIDIA AI Team
  • Streamlit Community
  • LangChain Contributors
  • Meta AI Research

πŸ“ž Support & Contact

  • Create an Issue
  • Join Discussions
  • Review Documentation

Stars

Made with ❀️ by @arsath-eng

About

A powerful Retrieval Augmented Generation (RAG) application built with NVIDIA AI endpoints and Streamlit. This solution enables intelligent document analysis and question-answering using state-of-the-art language models, featuring multi-PDF processing, FAISS vector store integration, and advanced prompt engineering.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published