Skip to content

Repository files navigation

AskTheCreator

Ask a YouTube channel anything it has covered. Answers are built from what the creator actually said. Every claim is footnoted with the moment it was said, and clicking one plays that second without leaving the page.

A question about cold plunging after lifting, answered from Andrew Huberman's videos. The answer names the guests who said it, quotes them, and footnotes every claim with the timestamp it came from

How it works

Transcripts are fetched per channel, chunked, and embedded into Postgres (pgvector, HNSW). Questions retrieve the nearest chunks for that channel; a similarity floor decides whether the content can answer at all, and answers must cite retrieved moments or they're discarded. Ungrounded prose is never served. Follow-up questions carry the conversation.

Stack: Next.js, TypeScript, Drizzle, Postgres + pgvector, any OpenAI-compatible LLM endpoint.

Quick start

Requirements:

git clone https://github.com/natnaelab/askthecreator && cd askthecreator
cp .env.example .env             # fill in the keys
docker compose up -d --build     # Postgres (pgvector) + app; migrations run on boot

Index a channel (newest 100 videos by default), then chat:

docker compose exec app npx tsx src/workers/ingest.ts @hubermanlab
# → http://localhost:3000/@hubermanlab

Re-running ingest is safe. It resumes, refreshes metadata, and never re-fetches what it has.

Developing (host Node instead of the app container)

Node 22 or newer.

npm install
docker compose up -d db
npm run db:migrate && npm test
npx tsx src/workers/ingest.ts @hubermanlab
npm run dev

Transcript fetching and IP blocks

YouTube serves captions readily to residential IPs and blocks datacenter IPs quickly. In practice: running on your own machine works; running on a VPS will hit walls. If you must run hosted, set PROXY_URL to a residential proxy. It's optional and off by default. Metadata (channel/video listings) uses the official Data API and is unaffected.

Configuration

Variable Required Purpose
DATABASE_URL yes Postgres with pgvector (docker compose up -d db provides one)
YOUTUBE_API_KEY yes Channel + video metadata (official Data API)
EMBEDDING_API_KEY yes Embeddings
EMBEDDING_BASE_URL / _MODEL no Embedding endpoint and model — defaults to OpenRouter's openai/text-embedding-3-small
GENERATION_BASE_URL / _API_KEY / _MODEL yes Answer generation, any OpenAI-compatible endpoint
PROXY_URL no Residential proxy for transcript fetching on hosted IPs
SITE_URL no Public origin of this instance
RATE_LIMIT_PER_DAY no Questions per visitor per day. Unset = unlimited; set it if the instance is public and runs on your keys

License

AGPL-3.0

About

Ask a YouTube channel anything it has covered. Every question is answered from one or more videos within the channel, and cited with timestamps.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages