Skip to content
Β 
Β 

Latest commit

Β 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ™οΈ LennyHub RAG

A production-ready RAG (Retrieval-Augmented Generation) system built on transcripts from Lenny's Podcast, featuring conversations with top product leaders and growth experts.

🌟 Key Features

  • πŸš€ One-Command Setup: Automated installation and indexing with setup_rag.py
  • 🎨 Visual Web Interface: Beautiful Streamlit app for querying and exploration
  • πŸ•ΈοΈ Interactive Graph Viewer: Explore 544 people and their connections with clickable network visualization
  • πŸ—„οΈ Qdrant Vector Database: Production-grade local vector storage (no Docker needed)
  • πŸ“Š Knowledge Graph RAG: Advanced retrieval with LightRAG entity and relationship extraction
  • πŸ” Multiple Search Modes: Hybrid, local, global, and naive search strategies
  • πŸ“š 297 Podcast Transcripts: Comprehensive knowledge base from industry leaders
  • πŸ’‘ Interactive Queries: Both CLI and web-based query interfaces
  • ⚑ Fast & Efficient: Caching, parallel processing, and optimized embeddings

πŸ“Š Dataset

297 Podcast Transcripts Available

Featuring conversations with:

  • Product Leaders: Julie Zhuo, Shreyas Doshi, Adam Fishman
  • Growth Experts: Brian Balfour, Elena Verna, Kevin Kwok
  • Founders: Patrick Collison, Amjad Masad, Andrew Wilkinson
  • Executives: Ada Chen Rekhi, Claire Hughes Johnson, Gokul Rajaram
  • And many more!

Topics covered: Product management, growth strategy, career development, startup advice, leadership, decision-making frameworks, and more.

πŸš€ Quick Start (4 Steps)

1. Clone the Repository

git clone https://github.com/traversaal-ai/lennyhub-rag.git
cd lennyhub-rag

2. Install Dependencies

pip install -r requirements.txt

3. Configure API Key

# Copy example environment file
cp .env.example .env

# Edit .env and add your OpenAI API key
# OPENAI_API_KEY=your-key-here

4. Run Automated Setup

Sequential Mode (Reliable)

# Process first 10 transcripts (quick test - 5 min)
python setup_rag.py --quick

# Process first 50 transcripts (30-40 min)
python setup_rag.py --max 50

# Process all 297 transcripts (2-3 hours)
python setup_rag.py

Parallel Mode (5-10x Faster!) ⚑

# Process 50 transcripts in parallel (6-8 min)
python setup_rag.py --max 50 --parallel

# All 297 transcripts in parallel (25-35 min)
python setup_rag.py --parallel

# Custom workers (default: 5, max: 10)
python setup_rag.py --parallel --workers 8

What this does:

  • βœ… Installs Qdrant locally (if needed)
  • βœ… Starts Qdrant server
  • βœ… Builds embeddings and knowledge graph (sequential or parallel)
  • βœ… Automatically resumes from where you left off
  • βœ… Tests the system automatically

🎨 Visual Interface (Streamlit App)

Launch the beautiful web UI:

Windows:

# First time: Install Qdrant
.\install_qdrant_windows.ps1

# Run the app (Qdrant starts automatically!)
.venv\Scripts\Activate.ps1
streamlit run streamlit_app.py

macOS/Linux:

./run_streamlit.sh

Features:

  • πŸ” Query Tab: Ask questions with AI-powered search
  • πŸ“Š Statistics Tab: View system health and metrics
  • πŸ“– Transcripts Tab: Browse and preview all transcripts
  • βš™οΈ Sidebar: Real-time status, settings, and quick links
  • πŸ’‘ Sample Questions: Pre-built queries to get started
  • πŸ”„ Auto-Start Qdrant: No manual startup needed
  • πŸ›‘οΈ Stable Queries: Run unlimited queries without errors

Screenshot Features:

  • Clean, modern interface
  • Multiple query modes (hybrid, local, global, naive)
  • Real-time Qdrant status monitoring
  • Query timing and metadata
  • Transcript filtering and preview

πŸ•ΈοΈ Knowledge Graph Viewer

Explore the network of people and their connections from Lenny's podcasts with an interactive graph visualization.

Knowledge Graph LennyHubNetwork-TopConnectors-19January2026-ezgif com-optimize

Launch the Graph Viewer:

python serve_graph.py

The graph will automatically open in your browser at http://localhost:8000/graph_viewer_simple.html

Features:

  • 🎯 Interactive Network: 544 people with all names visible
  • 🌟 Top Connectors Highlighted: See the 5 most connected people
    • Lenny Rachitsky (292 connections) - Gold
    • Bob Moesta (98 connections) - Amber
    • April Dunford (85 connections) - Orange
    • Arielle Jackson (82 connections) - Deep Orange
    • Andrew Wilkinson (78 connections) - Red
  • πŸ” Smart Search: Find people with exact match prioritization
  • πŸ‘† Clickable Legend: Click any top connector to focus on them
  • πŸ–±οΈ Interactive Controls:
    • Drag nodes to reposition
    • Scroll to zoom in/out
    • Click for detailed information
    • Double-click to focus on a person
  • 🎨 Beautiful Design: Dark theme with Mona Sans font
  • ⚑ Auto-Centers: Graph starts focused on Lenny Rachitsky

What You'll Discover:

  • Who are the most connected people in Lenny's podcast network
  • Relationships between guests, experts, and industry leaders
  • Connection patterns across 544 people from the transcripts

πŸ’» Command Line Interface

Interactive Query Mode

python query_rag.py --interactive

Single Queries

python query_rag.py "What is a curiosity loop?"
python query_rag.py "What is the growth competency model?"

Query with Sources

python query_with_sources.py "What are best practices for onboarding?"
python query_rag_with_chunks.py "How do you build a great product team?"

πŸ’‘ Example Queries

Career Strategy

"What is the explore and exploit framework for career development?"
"How do you avoid being the boiled frog in your career?"
"What advice does Ada give about early career strategy?"
"How should you use values to make career decisions?"

Growth & Product Management

"What are the four components of the growth competency model?"
"Why is onboarding important for growth?"
"How can onboarding improve retention?"
"What are opinionated defaults?"

Decision Making & Frameworks

"What is a curiosity loop and how does it work?"
"What is the PMF framework for choosing a company?"
"What is the inner vs outer scorecard concept?"
"What is the eating your vegetables concept?"

Leadership & Management

"Should you start a company with your partner?"
"How do you build trust with your team?"
"What makes a great product leader?"

πŸ“– Documentation

Quick Start Guides

Technical Documentation

Reference

πŸ—‚οΈ Project Structure

lennyhub-rag/
β”œβ”€β”€ πŸ“Š Data & Storage
β”‚   β”œβ”€β”€ data/                         # 297 podcast transcripts
β”‚   β”œβ”€β”€ rag_storage/                  # Knowledge graph & metadata
β”‚   └── qdrant_storage/               # Vector embeddings (local DB)
β”‚
β”œβ”€β”€ πŸš€ Setup & Configuration
β”‚   β”œβ”€β”€ setup_rag.py                  # One-command automated setup
β”‚   β”œβ”€β”€ install_qdrant_local.sh       # Install Qdrant (macOS/Linux)
β”‚   β”œβ”€β”€ install_qdrant_windows.ps1    # Install Qdrant (Windows)
β”‚   β”œβ”€β”€ start_qdrant.sh               # Start Qdrant server
β”‚   β”œβ”€β”€ stop_qdrant.sh                # Stop Qdrant server
β”‚   β”œβ”€β”€ status_qdrant.sh              # Check Qdrant status
β”‚   β”œβ”€β”€ qdrant_config.yaml            # Qdrant configuration
β”‚   β”œβ”€β”€ qdrant_config.py              # Python Qdrant config
β”‚   β”œβ”€β”€ requirements.txt              # Python dependencies
β”‚   └── .env                          # API keys & settings
β”‚
β”œβ”€β”€ 🎨 User Interfaces
β”‚   β”œβ”€β”€ streamlit_app.py              # Visual web interface
β”‚   β”œβ”€β”€ query_worker.py               # Subprocess query handler
β”‚   β”œβ”€β”€ run_streamlit.sh              # Launch Streamlit app
β”‚   β”œβ”€β”€ query_rag.py                  # CLI query interface
β”‚   β”œβ”€β”€ query_with_sources.py         # Query with source attribution
β”‚   └── query_rag_with_chunks.py      # Query with chunk details
β”‚
β”œβ”€β”€ πŸ”§ Building & Processing
β”‚   β”œβ”€β”€ build_transcript_rag.py       # Build RAG (all transcripts)
β”‚   β”œβ”€β”€ build_rag_quick.py            # Quick build (10 transcripts)
β”‚   └── build_transcript_rag_parallel.py  # Parallel processing
β”‚
└── πŸ“š Documentation
    β”œβ”€β”€ README.md                     # This file
    β”œβ”€β”€ SETUP_GUIDE.md                # Setup instructions
    β”œβ”€β”€ STREAMLIT_QUICKSTART.md       # Streamlit quick start
    β”œβ”€β”€ STREAMLIT_README.md           # Streamlit full docs
    β”œβ”€β”€ VISUAL_APP_SUMMARY.md         # Streamlit features
    β”œβ”€β”€ QDRANT_SETUP.md               # Qdrant documentation
    β”œβ”€β”€ OVERVIEW.md                   # Technical architecture
    └── ADDING_TRANSCRIPTS.md         # Adding transcripts

🎯 Use Cases

For Product Managers

  • Research frameworks and best practices
  • Learn from top PMs at Airbnb, Stripe, Meta
  • Study product strategy and execution
  • Interview preparation

For Growth Professionals

  • Understand growth competency models
  • Learn retention and onboarding strategies
  • Study successful growth strategies
  • Framework deep-dives

For Career Development

  • Career strategy frameworks
  • Decision-making guidance
  • Leadership insights
  • Personal values exploration

For Founders & Leaders

  • Startup advice from successful founders
  • Leadership frameworks
  • Team building strategies
  • Strategic decision-making

🧠 How It Works

Architecture

User Query
    ↓
Streamlit UI / CLI
    ↓
RAG System (RAG-Anything)
    ↓
LightRAG (Knowledge Graph)
    ↓
β”œβ”€β†’ Entity Extraction (GPT-4o-mini)
β”œβ”€β†’ Relationship Mapping
β”œβ”€β†’ Embeddings (text-embedding-3-small)
└─→ Qdrant Vector Storage
    ↓
Hybrid Search (local + global + vector)
    ↓
Answer Synthesis (GPT-4o-mini)
    ↓
Results with Sources

Parallel Processing

The system supports parallel transcript processing for significantly faster indexing:

Sequential Processing:

  • Processes one transcript at a time
  • Safer, more predictable
  • ~2-3 minutes per transcript

Parallel Processing (⚑ 5-10x faster):

  • Processes 5-10 transcripts simultaneously
  • Uses asyncio semaphore for concurrency control
  • Rate-limit safe (max 10 workers)
  • Smart resume: skips already-processed transcripts
  • ~20-30 seconds per transcript (with 5 workers)
# Enable parallel mode
python setup_rag.py --max 50 --parallel

# Custom concurrency
python setup_rag.py --parallel --workers 8

Search Modes

Hybrid (Recommended)

  • Combines local + global + vector search
  • Best overall results
  • Balanced speed and accuracy

Local

  • Entity-focused search
  • Fast and precise
  • Great for specific concepts

Global

  • Relationship-focused
  • Broader context
  • Best for understanding connections

Naive

  • Pure vector similarity
  • Fastest mode
  • Simple semantic search

πŸŽ“ Want to Build Your Own AI Agents?

Screenshot 2026-01-16 at 20 13 13

This RAG system demonstrates advanced agent engineering with knowledge graphs, vector databases, and LLM orchestration. Want to learn how to build systems like this from scratch?

Join the Agent Engineering Bootcamp: Developers Edition

  • Learn to build production-ready AI agents
  • Master RAG, LLMs, and agentic workflows
  • Taught by Hamza Farooq (Ex-Google, Prof UCLA & UMN)
  • 4.8β˜… rating from 95+ students

Get $200 OFF with code 200OFF β†’


πŸ—οΈ Technical Stack

  • RAG Framework: RAG-Anything v1.2.9+
  • Knowledge Graph: LightRAG v1.4.9+
  • Vector Database: Qdrant v1.16+
  • LLM: OpenAI GPT-4o-mini
  • Embeddings: OpenAI text-embedding-3-small (1536 dims)
  • Web UI: Streamlit 1.28+
  • Language: Python 3.8+

πŸ’° Cost & Performance

Initial Build Costs

Transcripts Embeddings Entity Extraction Total Sequential Parallel (5x)
10 (quick) $0.04 $0.20 ~$0.24 5 min 5 min*
50 $0.20 $1.00 ~$1.20 30-40 min 6-8 min
297 (all) $1.20 $6.00 ~$7.20 2-3 hrs 25-35 min

*Small batches don't benefit much from parallelization

Query Costs

  • Per Query: $0.001-0.01
  • Cached Queries: Free (stored responses)
  • Typical Session: ~$0.05-0.10

Cost Optimization

  • LLM response caching (saves ~80% on repeated queries)
  • Efficient chunking and embedding strategies
  • Smart query routing

βš™οΈ System Requirements

  • OS: Windows, macOS, or Linux
  • Python: 3.8 or higher (3.11 recommended)
  • RAM: 2GB+ recommended (4GB+ for all transcripts)
  • Disk Space:
    • Base: ~500MB
    • 10 transcripts: ~1GB
    • 50 transcripts: ~2GB
    • 297 transcripts: ~5GB
  • Internet: Required for OpenAI API calls

πŸ”§ Advanced Usage

Custom Configuration

Edit .env file:

# Vector Database
USE_QDRANT=true
QDRANT_URL=http://localhost:6333
QDRANT_COLLECTION_NAME=lennyhub

# Working Directory
WORKING_DIR=./rag_storage

Qdrant Management

# Start Qdrant
./start_qdrant.sh

# Check status
./status_qdrant.sh

# View logs
tail -f qdrant.log

# Stop Qdrant
./stop_qdrant.sh

# Dashboard
open http://localhost:6333/dashboard

Manual Build (Advanced)

Sequential Processing:

# Build all transcripts
python build_transcript_rag.py

# Quick build (10 transcripts)
python build_rag_quick.py

Parallel Processing (5-10x faster):

# Using setup_rag.py (recommended)
python setup_rag.py --max 50 --parallel --workers 5

# Using standalone parallel script
python build_transcript_rag_parallel.py

Performance Comparison:

  • Sequential: ~2-3 min/transcript
  • Parallel (5 workers): ~20-30 sec/transcript
  • Parallel (10 workers): ~15-20 sec/transcript

Programmatic Access

from raganything import RAGAnything, RAGAnythingConfig
from qdrant_config import get_lightrag_kwargs
import asyncio

# Initialize
config = RAGAnythingConfig(working_dir="./rag_storage")
lightrag_kwargs = get_lightrag_kwargs()
rag = RAGAnything(config=config, lightrag_kwargs=lightrag_kwargs)

# Query
response = await rag.aquery("Your question here", mode="hybrid")
print(response)

πŸ› Troubleshooting

Qdrant Issues

# Check if running
curl http://localhost:6333/

# Restart Qdrant
./stop_qdrant.sh && ./start_qdrant.sh

# View logs
tail -f qdrant.log

Setup Issues

# Reinstall dependencies
pip install -r requirements.txt --upgrade

# Check API key
echo $OPENAI_API_KEY

# Clear cache and rebuild
rm -rf rag_storage/ qdrant_storage/
python setup_rag.py --quick

Streamlit Issues

# Clear cache
streamlit cache clear

# Run on different port
streamlit run streamlit_app.py --server.port 8502

# Check logs
streamlit run streamlit_app.py --logger.level debug

Windows-Specific Issues

# Install Qdrant if not found
.\install_qdrant_windows.ps1

# Check if Qdrant is running
Invoke-RestMethod -Uri "http://localhost:6333/"

# Activate virtual environment
.venv\Scripts\Activate.ps1

# Install missing packages
uv pip install nest-asyncio

πŸ“ˆ Performance Tips

Indexing Performance

  1. Use Parallel Mode: 5-10x faster with --parallel flag
  2. Adjust Workers: More workers = faster (up to 10 for rate limits)
  3. Smart Resume: System automatically skips processed transcripts
  4. Start Small: Test with --quick before full indexing
  5. Monitor Resources: Check RAM usage with large datasets

Query Performance

  1. Use Hybrid Mode: Best balance of speed and accuracy
  2. Enable Caching: Responses are cached automatically (saves ~80%)
  3. Batch Queries: Process multiple questions in one session
  4. Choose Right Mode: Naive is fastest, hybrid is most accurate
  5. Reuse Sessions: Keep Streamlit app running for instant queries

🀝 Contributing

Contributions welcome! Areas for improvement:

  • Add more transcripts
  • Improve query templates
  • Enhance UI features
  • Add new search modes
  • Optimize performance
  • Expand documentation

πŸ“ License

See LICENSE file for details.

πŸ™ Credits

🌟 Featured Guests

Ada Chen Rekhi, Adam Fishman, Adam Grenier, Andrew Wilkinson, Annie Duke, Brian Balfour, Casey Winters, Claire Hughes Johnson, Elena Verna, Gokul Rajaram, Jeff Weinstein, Julie Zhuo, Kevin Kwok, Lenny Rachitsky, Maggie Crowley, Marily Nika, Patrick Collison, Shreyas Doshi, and 279 more amazing guests!

πŸ“§ Support

πŸŽ‰ What's New

Latest Updates

  • πŸͺŸ Windows Support: Full Windows compatibility with PowerShell scripts
  • πŸ”„ Auto-Start Qdrant: Streamlit app automatically starts Qdrant
  • πŸ›‘οΈ Stable Multi-Query: Subprocess isolation prevents event loop conflicts
  • ⚑ Parallel Processing: 5-10x faster indexing with --parallel flag
  • ✨ One-Command Setup: Automated setup_rag.py script
  • 🎨 Streamlit Web UI: Beautiful visual interface
  • πŸ—„οΈ Local Qdrant: Production vector DB (no Docker)
  • πŸ“š 297 Transcripts: Complete podcast library
  • πŸš€ Smart Resume: Automatically skips processed transcripts
  • πŸ“Š Statistics Dashboard: Real-time system monitoring
  • πŸ’‘ Sample Questions: Built-in query examples

Ready to explore?

git clone https://github.com/traversaal-ai/lennyhub-rag.git
cd lennyhub-rag
python setup_rag.py --quick

πŸš€ Level Up Your AI Agent Skills

Enjoyed building with this RAG system? Take your skills to the next level!

Agent Engineering Bootcamp: Developers Edition teaches you to build production-ready AI agents like this one (and more advanced systems). Learn RAG pipelines, knowledge graphs, LLM orchestration, and agentic workflows from industry experts.

Taught by Hamza Farooq

  • Founder & Ex-Google Engineer
  • Professor at Stanford Continuing Studies, UCLA & UMN
  • 4.8β˜… rating (95+ students)

Enroll now with $200 OFF β†’


Built with ❀️ using RAG-Anything, LightRAG, Qdrant, and Streamlit

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages