An AI Podcast Agent Gains Video Recognition and a Self-Cleaning Storage Layer
Turning a video or audio file into a podcast episode is a messy pipeline problem: recognition, script generation, voice design, and synthesis all produce intermediate artifacts that can silently fill a disk. The temp-to-permanent storage pattern with automatic cleanup solves that without requiring a separate media asset manager.
The third iteration of this AI audio creation agent adds content recognition as a first-class input path. Video and audio uploads are processed through Alibaba's Qwen ASR and multimodal models, which extract spoken content and visual context into a podcast script. A new temporary-permanent storage architecture keeps intermediate voice designs in a temp directory with a 10-minute TTL, while only user-approved timbres get promoted to permanent storage. A scheduled cleanup task recursively prunes expired temp files and empty directories, returning deletion statistics. The system prompt was restructured into six modular sections to reduce tool-calling mistakes, and a file-locking mechanism prevents index corruption during concurrent voice saves. Large videos over 21MB are automatically split into ≤10MB segments before upload, sidestepping API size limits.
Treating temp storage as a staging area with a hard TTL is a lightweight alternative to a full job-state machine for agent workflows where users make explicit keep/discard decisions.
Modularizing a system prompt into a responsibility table reduces LLM tool misinvocation more reliably than adding more natural-language guardrails, because it constrains the model's action space structurally.
Segmenting large media client-side before API calls is a practical workaround for model provider size limits, but it introduces a tradeoff: context that spans segment boundaries may be lost unless the segments are stitched back together logically.