Overview
Chat with X applications use Retrieval Augmented Generation (RAG) to enable conversations with various data sources. These tutorials show you how to build interactive chat interfaces for documents, codebases, emails, and multimedia content.Chat with PDF
Extract and query PDF documents
Chat with GitHub
Search and analyze codebases
Chat with Gmail
Query your email inbox
Chat with YouTube
Analyze video transcripts
Chat with Research
Search academic papers
Chat with Substack
Query newsletter archives
Core RAG Architecture
All “Chat with X” applications follow a common pattern:1
Data Ingestion
Load and preprocess content from the target source (PDF, GitHub, Gmail, etc.)
2
Chunking & Embedding
Split content into chunks and generate vector embeddings
3
Vector Storage
Store embeddings in a vector database (Chroma, Qdrant, etc.)
4
Retrieval
Find relevant chunks using semantic similarity search
5
Generation
Pass retrieved context to LLM for answer generation
Chat with PDF
Implementation
Key Features
PDF Processing
PDF Processing
- Extracts text from multi-page PDFs
- Handles embedded images and tables
- Preserves document structure
- Supports scanned PDFs with OCR (optional)
Chunking Strategy
Chunking Strategy
Advanced Queries
Advanced Queries
Effective prompt patterns:
- “Summarize the key findings in section 3”
- “What methodology was used in the research?”
- “Compare the results from pages 5 and 10”
- “Extract all statistics about X”
Setup
- Installation
- Run
- Source
Chat with GitHub Repos
Implementation
Example Queries
Architecture
“How is the authentication system structured?”
Implementation
“Show me how error handling is implemented”
Dependencies
“What external libraries does this project use?”
Best Practices
“How does the codebase handle configuration?”
GitHub Access Configuration
1
Generate Personal Access Token
Go to GitHub Settings → Developer settings → Personal access tokens
2
Set Permissions
Enable
repo scope for accessing repository contents3
Configure Loader
Chat with Gmail
Implementation
Gmail API Setup
Complete OAuth Configuration
Complete OAuth Configuration
1
Create Google Cloud Project
Go to Google Cloud Console and create a new project
2
Enable Gmail API
Navigate to APIs & Services → Library → Search for “Gmail API” → Enable
3
Configure OAuth Consent
- Go to APIs & Services → OAuth consent screen
- Select “External” user type
- Fill in app information
- Add test users (your email)
- Publish the consent screen
4
Create OAuth Credentials
- APIs & Services → Credentials → Create Credentials
- Select “OAuth client ID”
- Application type: “Desktop app”
- Download credentials as
credentials.json
5
Place Credentials
Save
credentials.json in your project directoryGmail Query Filters
string
Gmail search operators for filtering emails
Example Queries
Chat with YouTube Videos
Implementation
Transcript Processing
How It Works
How It Works
- Extract Transcript: Uses
youtube-transcript-apito fetch captions - Chunk Text: Splits transcript into semantic chunks with timestamps
- Generate Embeddings: Creates vector representations
- Query: Retrieves relevant segments based on question
- Context: Includes timestamp information in responses
Use Cases
Tutorial Videos
“What tools were used in this tutorial?”
Lectures
“Summarize the key concepts explained”
Podcasts
“What did they say about AI regulation?”
Product Reviews
“List all pros and cons mentioned”
Chat with Research Papers
Implementation
Research Queries
Methodology Questions
Methodology Questions
- “What datasets were used in these papers?”
- “How do the approaches differ?”
- “What evaluation metrics are common?”
Comparative Analysis
Comparative Analysis
- “Compare the results across different papers”
- “Which method achieved the best performance?”
- “What are the main limitations discussed?”
Implementation Details
Implementation Details
- “What architectures are used?”
- “List the hyperparameters mentioned”
- “What preprocessing steps are described?”
Chat with Substack
Implementation
Common Patterns & Best Practices
Embedchain Configuration
object
Complete configuration object for Embedchain
Optimization Tips
Chunking Strategy
Chunking Strategy
Cost Management
Cost Management
- Use GPT-4o-mini for embeddings (cheaper)
- Cache vector databases between sessions
- Limit retrieval to top 3-5 chunks
- Implement query optimization
Response Quality
Response Quality
Multi-Source Chat
Combine Multiple Data Sources
Combine Multiple Data Sources
Resources
Embedchain Docs
Complete framework documentation
Example Repository
All Chat with X implementations
RAG Tutorial
Step-by-step RAG guide
Gmail Tutorial
Complete Gmail RAG tutorial
