Skip to content

About

Lenny Growth Assistant is a privacy-first, local AI agent built with React, FastAPI, and Ollama. It features a Retrieval-Augmented Generation (RAG) pipeline to query product transcripts, specialized skill routing for Ship 30 essays, and a secure, sandboxed Artifact Viewer to instantly render AI-generated HTML and UI components right in the chat.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

📸 Project Screenshots

Standard RAG Chat & Citations Standard Chat

Natively Rendered HTML Artifacts Artifact Viewer

🎙️ The Lenny Growth Assistant

An AI-powered conversational web application grounded in Lenny's Podcast and Newsletter transcripts. Every answer includes inline citations traceable to specific episodes and timestamps.

Architecture PRD Design


✨ Features

  • 🔍 Grounded RAG: All responses are sourced from transcript evidence with [Source: Episode @ Timestamp] citations
  • 🤖 Multi-Model Support: Dynamic switching between local Ollama (llama3.2) and cloud (Claude/GPT-4o)
  • 📝 Ship 30 for 30 Skill: Generates ~1,250-word high-impact essays from podcast insights
  • 🎨 Artifact Generation: Produces interactive HTML/Markdown components
  • 🔒 Sandboxed Viewer: Artifacts render in isolated iframes — XSS-safe
  • ⚡ Real-time Streaming: Server-Sent Events for instant token-by-token responses
  • 💾 Session Persistence: PostgreSQL-backed conversation history

🏗️ Architecture

Frontend (React + TypeScript + Tailwind)
        ↕ HTTP / SSE
Backend (FastAPI + Python 3.11+)
        ↕ Async SQLAlchemy
PostgreSQL + pgvector
        ↕
Ollama (Local LLM) | Anthropic Claude | OpenAI GPT-4o

See docs/architecture.md for full details.


📋 Prerequisites

Requirement Version Notes
Docker + Docker Compose v2.0+ Recommended for one-command setup
Python 3.11+ For local development
Node.js 18+ For frontend development
PostgreSQL 15+ With pgvector extension
Ollama Latest For local LLM (optional if using cloud)

🚀 Quick Start (Docker)

# 1. Clone and enter the project
cd The-Lenny-Growth-Assistant

# 2. Copy environment template
cp .env.example .env

# 3. Edit .env with your API keys (optional for local-only usage)
# nano .env

# 4. Start everything
docker-compose up --build

# 5. Open in browser
# Frontend: http://localhost:5173
# Backend:  http://localhost:8000
# API Docs: http://localhost:8000/docs

🔧 Local Development

Backend

cd backend

# Create virtual environment
python -m venv venv
source venv/bin/activate  # or `venv\Scripts\activate` on Windows

# Install dependencies
pip install -r requirements.txt

# Copy and configure .env
cp ../.env.example ../.env

# Run database migrations (optional — auto-creates tables on first run)
alembic upgrade head

# Start the backend
uvicorn app.main:app --reload --port 8000

Frontend

cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

# Open http://localhost:5173

Ollama Setup (Local LLM)

# Install Ollama (macOS/Linux)
curl -fsSL https://ollama.ai/install.sh | sh

# Pull required models
ollama pull llama3.2
ollama pull nomic-embed-text

# Verify Ollama is running
curl http://localhost:11434/api/tags

⚙️ Environment Variables

Variable Default Description
DATABASE_URL postgresql+asyncpg://lenny:lenny_secret@localhost:5432/lenny_growth PostgreSQL connection string
OLLAMA_BASE_URL http://localhost:11434 Ollama server URL
OLLAMA_DEFAULT_MODEL llama3.2 Default local LLM model
OLLAMA_EMBEDDING_MODEL nomic-embed-text Embedding model for RAG
ANTHROPIC_API_KEY (empty) Anthropic API key for Claude
ANTHROPIC_MODEL claude-3-5-sonnet-20241022 Claude model identifier
OPENAI_API_KEY (empty) OpenAI API key for GPT
OPENAI_MODEL gpt-4o GPT model identifier
DEFAULT_MODEL_PROVIDER ollama Default LLM provider
VECTOR_STORE_BACKEND pgvector Vector store: pgvector or memory
APP_DEBUG false Enable debug logging

🧪 Testing

cd backend

# Run all tests
pytest

# Run with coverage
pytest --cov=app --cov-report=html

# Run specific test suite
pytest tests/test_api.py -v
pytest tests/test_rag.py -v
pytest tests/test_agent.py -v

📁 Project Structure

The-Lenny-Growth-Assistant/
├── backend/
│   ├── app/
│   │   ├── api/v1/          # REST endpoints
│   │   ├── core/            # Config, logging, security
│   │   ├── db/models/       # SQLAlchemy models
│   │   ├── rag/             # Ingestion, chunking, retrieval
│   │   ├── agent/           # LLM routing, skills
│   │   └── schemas/         # Pydantic validation
│   ├── data/                # Sample transcripts
│   ├── tests/               # Test suites
│   └── main.py              # FastAPI entry point
├── frontend/
│   ├── src/
│   │   ├── components/      # React components
│   │   ├── hooks/           # Custom React hooks
│   │   ├── services/        # API client + types
│   │   └── styles/          # Tailwind globals
│   └── package.json
├── docs/                    # Documentation
├── docker-compose.yml       # Full-stack orchestration
├── .env.example             # Environment template
└── README.md

🐛 Troubleshooting

Ollama not connecting

# Check if Ollama is running
curl http://localhost:11434/api/tags

# Restart Ollama
ollama serve

# Verify model is pulled
ollama list

Database connection errors

# Check PostgreSQL is running
docker-compose up postgres

# Test connection
psql postgresql://lenny:lenny_secret@localhost:5432/lenny_growth

Frontend build errors

# Clear and reinstall
cd frontend
rm -rf node_modules
npm install

API key issues

  • Check .env file has correct keys (no quotes around values)
  • Verify keys are valid at provider's dashboard
  • Ollama requires no API keys for local usage

📄 License

MIT License — see LICENSE for details.


🙏 Acknowledgments

Built on the insights and frameworks shared by Lenny Rachitsky and his incredible guests on Lenny's Podcast.

About

Lenny Growth Assistant is a privacy-first, local AI agent built with React, FastAPI, and Ollama. It features a Retrieval-Augmented Generation (RAG) pipeline to query product transcripts, specialized skill routing for Ship 30 essays, and a secure, sandboxed Artifact Viewer to instantly render AI-generated HTML and UI components right in the chat.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages