Skip to content

Latest commit

 

History

History
148 lines (109 loc) · 2.71 KB

File metadata and controls

148 lines (109 loc) · 2.71 KB

🚀 Quick Start Guide

5-Minute Setup

1. Install Dependencies

pip install -r requirements.txt

2. Configure API Keys

# Copy template
cp .env.template .env

# Edit .env and add:
# - GOOGLE_API_KEY (from https://makersuite.google.com/app/apikey)
# - PINECONE_API_KEY (from https://pinecone.io/)
# - PINECONE_ENVIRONMENT (e.g., us-east-1)

3. Initialize Database

python main.py init

4. Start Application

streamlit run app.py

5. Use the App

  1. Upload documents (drag & drop or click)
  2. Click "Process Documents"
  3. Ask questions about your documents
  4. Get AI-powered answers with sources

📖 Command Reference

Web Interface

streamlit run app.py

Initialize Pinecone

python main.py init

Process Documents

# Single file
python main.py process document.txt

# Directory
python main.py process documents/

# With namespace
python main.py process docs/ --namespace project-1

🎓 Example Usage

Via Web UI

  1. Open http://localhost:8501
  2. Click "Upload documents"
  3. Select .txt, .pdf, or .docx files
  4. Click "Process Documents"
  5. Type your question in the chat
  6. Get answers with sources

Via Python

from src.rag import RAGChain

chain = RAGChain()
result = chain.query("What is the main topic?")
print(result["answer"])
for doc in result["source_documents"]:
    print(f"Source: {doc.metadata['source']}")

⚙️ Configuration Options

Edit .env to customize:

# Chunking
CHUNK_SIZE=1000              # Larger = more context
CHUNK_OVERLAP=200            # Overlap for continuity

# Retrieval
RETRIEVAL_TOP_K=5            # More results = slower

# Logging
LOG_LEVEL=INFO              # INFO, DEBUG, WARNING, ERROR

# Models
GOOGLE_MODEL_NAME=gemini-2.5-flash
EMBEDDING_MODEL=models/embedding-001

🐛 Troubleshooting

"Missing required configuration"

# Make sure .env exists with API keys
cp .env.template .env
# Edit .env with your keys

"Failed to connect to Pinecone"

  • Check PINECONE_API_KEY is correct
  • Check PINECONE_ENVIRONMENT matches your Pinecone project
  • Verify internet connection

"No embeddings generated"

  • Check GOOGLE_API_KEY is correct
  • Verify API key has Generative AI enabled

📚 Documentation

  • README.md - Complete documentation
  • DOCUMENTATION.md - Technical deep-dive
  • PROJECT_SUMMARY.md - Implementation details

🎯 Next Steps

  1. ✅ Follow the 5-minute setup above
  2. 📤 Upload your documents
  3. 💬 Ask questions in the chat
  4. 📖 Check source documents for citations
  5. 🔧 Customize configuration as needed

Ready to go! Happy document analyzing! 🎉