A Cloudflare Workers application that transcribes YouTube videos, stores transcriptions, and provides semantic search capabilities using AI embeddings.
- YouTube video transcription using Groq's Whisper model
- Vector embeddings generation using Cloudflare AI
- Semantic search across video transcriptions
- Caching with Cloudflare KV
- Workflow-based processing architecture
-
Node.js (Latest LTS version recommended)
-
Cloudflare Workers account
-
Required API keys:
- Groq API key
- Clone the repository
- Install dependencies:
bun install
- Create a
wrangler.toml
file based on the provided template - Set up the required secrets using Wrangler:
wrangler secret put GROQ_API_KEY
Run the development server:
bun run dev
Deploy to Cloudflare Workers:
bun run deploy
- POST
api/process-video/:id
- Starts transcription process for a YouTube video
- Returns cached result if available
- GET
api/status/:instanceId
- Check the status of a running transcription workflow
- GET
api/search?q=query
- Perform semantic search across transcribed videos
The application uses several Cloudflare services:
- Workers: Main application runtime
- KV: Caching transcriptions
- Vectorize: Vector database for embeddings
- AI: Embedding generation
- Workflows: Orchestrating the transcription process
- Built with Hono.js framework
- TypeScript for type safety
- Uses Cloudflare's AI models for embeddings
- Implements workflow-based processing for long-running tasks
- Includes automatic retries and error handling
- Implements caching strategies for performance
The application includes comprehensive error handling:
- Workflow retries for transient failures
- Graceful degradation
- Detailed error logging
- Client-friendly error responses
- Maximum video length may be limited by processing time constraints
- API rate limits apply based on Cloudflare Workers limits
- Cached transcriptions expire after 30 days
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
MIT License