A minimal RAG CLI for querying .srt video transcripts. Built for AI coding agents like Claude Code, Codex, OpenCode, and Droid—no UI, just fast answers from your transcripts via the command line.
bun install- Copy
.env.exampleto.envand add yourAI_GATEWAY_API_KEY - Place
.srtfiles intranscripts/directory
bun index.ts --ingest # Ingest new transcripts
bun index.ts --ingest --force # Re-ingest all
bun index.ts --ingest --transcripts-dir <path>Notes:
- Ingest automatically skips unchanged files based on mtime + size.
- If the database schema changes, existing data is cleared and you must re-ingest.
bun index.ts --list-lessons # Show all ingested lessonsbun index.ts --ask "your question" # Query transcripts
bun index.ts --ask "?" --top-k 10 # Retrieve 10 chunks (default 25)
bun index.ts --ask "?" --transcripts-dir <path>
bun index.ts --ask "?" --lessons "lesson-name" # Filter to one lesson
bun index.ts --ask "?" --lessons "lesson-1,lesson-2" # Filter to multipleRAG details (built-in, no flags needed):
- Chunking: ~45s windows with 10s overlap.
- Normalization: trims cues like “[music]”, removes speaker prefixes, de-dups consecutive lines.
- Retrieval: hybrid (vector + BM25) with rerank, then neighbor expansion (±1 chunk).