The Event-Driven AI Content Engine
Built for the Backend Reloaded Hackathon using Motia.
ContentForge automates the tedious process of content repurposing. It takes any YouTube video or Short and instantly transforms it into a Blog Post, LinkedIn Article, or Tweet using state-of-the-art AI.
Unlike traditional synchronous APIs that time out on large files, ContentForge uses Motia's Event-Driven Architecture to handle heavy media processing asynchronously, delivering production-grade reliability and zero-latency user feedback.
ContentForge replaces a complex stack (Express + Redis + Worker + Python) with just two Motia Steps:
The event-driven pipeline: The API (Left) responds instantly, while the Async Worker (Right) handles heavy AI processing.
-
⚡ Zero-Latency API (Non-Blocking): The API accepts the request and returns immediately. The heavy processing happens in the background, preventing HTTP timeouts.
-
🌊 Streaming I/O: Uses
youtube-dl-execwith stream pipelines to download audio directly to disk, keeping memory usage low even for long videos. -
🛡️ Resilience by Default:
- Auto-Cleanup: Implements
try...finallyblocks to ensure temp files are deleted even if the server crashes. - Smart Error Handling: Distinguishes between Retriable Errors (Network blips) and Non-Retriable Errors (400 Bad Request), preventing infinite retry loops.
- Auto-Cleanup: Implements
-
🧠 Advanced AI Pipeline:
- Hearing:
whisper-large-v3for near-perfect transcription. - Thinking:
llama-3.3-70b-versatileon Groq LPU for instant text generation.
- Hearing:
- Framework: Motia (Unified Backend Runtime)
- AI Inference: Groq (Llama 3.3 & Whisper)
- Media Processing:
yt-dlp/youtube-dl-exec - Notifications:
fastforwardit - Language: TypeScript
- Node.js (v18 or v20 LTS recommended)
- A Groq API Key (Free)
- A Gmail account (App Password) for sending results
# Clone the repository
git clone https://github.com/yourusername/content-forge.git
cd content-forge
# Install dependencies
npm installCreate a .env file in the root directory:
# AI Configuration
GROQ_API_KEY=gsk_your_key_here
# Email Configuration (For sending results)
APP_MAIL=[email protected]
APP_PASS=your-gmail-app-password# Start the Motia development server
npm run devThe server will start at http://localhost:3000. Open this URL to see the Motia Workbench and visualize the content-forge-flow.
-
Open Workbench: Go to
http://localhost:3000 -
Send a Request: Use Postman, Curl, or the Workbench "Test" tab:
POST http://localhost:3000/api/generate Content-Type: application/json { "url": "https://www.youtube.com/shorts/your-video-id", "to": "[email protected]", "purpose": "LinkedIn Post" } -
Watch the Magic:
- You will receive an immediate
200 OKresponse - Look at the Workbench Logs to see the async worker waking up:
- ⬇️ Downloading audio...
- 📝 Transcribing...
- 🧠 Generating content...
- 📧 Sending email...
- You will receive an immediate
-
Check Inbox: You will receive a beautifully formatted HTML email with your AI-generated post!
During the development of ContentForge, I identified a DX gap in the Motia Workbench where logical connections (emit/subscribe) were not being visualized without explicit configuration.
I raised an issue and submitted a PR to improve the documentation and starter templates, ensuring future developers don't face the same friction.
- Saish Mungase - Full Stack Developer & Architect
This project is open-source and available under the MIT License.
