Skip to main content

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

Build a RAG application to query PDF documents in just 30 lines of Python

Implementation

Key Features

  • Extracts text from multi-page PDFs
  • Handles embedded images and tables
  • Preserves document structure
  • Supports scanned PDFs with OCR (optional)
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


Chat with GitHub Repos

Query codebases, understand architecture, and find implementations using natural language

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 contents
3

Configure Loader

Never commit GitHub tokens to version control. Use environment variables or secrets management.

Chat with Gmail

Search and analyze your email inbox using natural language queries

Implementation

Gmail API Setup

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 directory

Gmail Query Filters

string
Gmail search operators for filtering emails

Example Queries


Chat with YouTube Videos

Analyze video content through transcripts without watching the entire video

Implementation

Transcript Processing

  1. Extract Transcript: Uses youtube-transcript-api to fetch captions
  2. Chunk Text: Splits transcript into semantic chunks with timestamps
  3. Generate Embeddings: Creates vector representations
  4. Query: Retrieves relevant segments based on question
  5. 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

Search and query arXiv papers using conversational AI

Implementation

Research Queries

  • “What datasets were used in these papers?”
  • “How do the approaches differ?”
  • “What evaluation metrics are common?”
  • “Compare the results across different papers”
  • “Which method achieved the best performance?”
  • “What are the main limitations discussed?”
  • “What architectures are used?”
  • “List the hyperparameters mentioned”
  • “What preprocessing steps are described?”

Chat with Substack

Query newsletter archives and extract insights from blog posts

Implementation


Common Patterns & Best Practices

Embedchain Configuration

object
Complete configuration object for Embedchain

Optimization Tips

  • Use GPT-4o-mini for embeddings (cheaper)
  • Cache vector databases between sessions
  • Limit retrieval to top 3-5 chunks
  • Implement query optimization

Multi-Source Chat

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