Inspiration
Every creator on YouTube knows the golden rule: listen to your audience. But as a channel grows, actually listening becomes physically impossible. With hundreds or thousands of comments pouring in daily, finding the signal in the noise is a nightmare.
Currently, creators only have two choices:
- Manual scrolling: Spending hours reading through comment sections. This is slow, mentally draining, and makes it incredibly easy to miss recurring questions or requests.
- Standard analytics platforms: YouTube Studio shows you views, CTR, and watch time, but it doesn't tell you what your viewers are actually struggling with, what tutorials they are begging for, or where your content has unexplained gaps.
We had an "Aha!" moment: What if we treated the comment section as a structured database of user feedback?
We set out to build AudienceOS—a complete AI-driven audience intelligence engine that functions as an automated research team. It imports live comments, runs deep semantic classification, scores the best opportunities, and immediately writes complete, ready-to-produce scripts, transforming raw feedback into a continuous pipeline of validated content.
What it does
AudienceOS is structured as a creator control center divided into five core layers:
- Live YouTube Integration & Ingestion: Creators input their handle (e.g.,
@MKBHD), and the system connects to the YouTube Data API to fetch the most recent comment threads. - AI Comment Classifier: Every comment is analyzed and classified. It tags the comment type (QUESTION, REQUEST, CONFUSION, IDEA, FEEDBACK), identifies the exact technology or topic (e.g., AI Agents, RAG, Ollama, LangChain), and evaluates the creator's priority (High, Medium, Low).
- Content Gap Detector: By comparing what the audience is asking for against what the channel has already covered, it uncovers "Content Gaps"—high-demand subjects that have low or zero coverage on the channel.
- Opportunity Scorer: The system ranks discovered gaps on a scale from 0 to 100 using a formula that weights comment volume, interaction growth rates, and viewer urgency. This bubbles up the highest-value video concepts.
- Content Studio & Auto-Scripting: Once an opportunity is selected, the AI generates a complete production package: viral titles, SEO tags, a high-retention opening hook, and a full, structured 1,000-word video script.
- Smart Production Calendar: A built-in drag-and-drop schedule that allows creators to queue up and schedule generated script packages, keeping their upload timeline organized.
How we built it
We wanted a clean, ultra-responsive developer experience that did not rely on heavy, bloated frameworks.
- Frontend: Built from scratch using modern HTML5, Vanilla CSS, and JavaScript. We constructed a custom Single Page Application (SPA) router that supports client-side navigation. To ensure refreshing the page doesn't break the app, we implemented custom rewrite rules. Styling uses a premium dark-themed CSS design system with custom HSL color tokens, micro-animations, and CSS Grid layouts.
- Backend: Built with FastAPI (Python). It provides a lightweight, asynchronous API that handles data flow between the YouTube API, the AI models, and our storage layers.
- AI Infrastructure: Powered by Groq Cloud APIs. To make the AI resilient, we built a custom cascading runner in the backend. If the primary model hits a rate limit or goes down, the engine immediately catches the error, puts the model on a temporary cooldown, and fallbacks to the next available model in the chain.
- Database Architecture: Supported by a dual-engine database layer using
psycopg2. In local development, the app runs on a fast, lightweight SQLite file. For cloud deployment, it seamlessly connects to a remote PostgreSQL (Supabase) database with built-in connection pooling to handle high-frequency writes.
Challenges we faced
1. The Groq Token Limit (429 Rate Limit Errors)
Groq's Free/Developer tier is incredibly fast but has strict Daily Token Limits (TPD) and Minute Token Limits (TPM). Early on, running analysis on a channel with 100 comments would consume over 8,000 tokens in a single API call, hitting rate limits in just a few runs.
- The Solution: We re-architected the system to use a hybrid classification model. We built a fast, local keyword-based parser that handles initial classification. Then, we only send the most dense and complex comment samples to the LLM (capping the batch at 25 comments). Finally, we optimized the prompt so the LLM returns only index-based classification metadata, completely removing text-echoing and saving 82% of token usage.
2. Ephemeral Storage on Cloud Providers
When deploying the FastAPI backend to Render's free tier, the container's hard drive resets every time it goes to sleep or is redeployed. This meant our SQLite database kept getting wiped out, deleting all imported channels and saved opportunities.
- The Solution: We integrated PostgreSQL support. By detecting the presence of a
DATABASE_URLenvironment variable, the application dynamically swaps its SQLite connector for a PostgreSQL connection pool connected to a remote Supabase instance.
3. SPA Page Refresh 404s
Using a custom routing system on static hosts like Vercel often results in 404 Not Found errors when a user refreshes the browser on a subpage (like /opportunities).
- The Solution: We designed a
vercel.jsonconfiguration file to enforce a routing rewrite rule. This ensures Vercel redirects all incoming routes to the mainindex.htmlfile, allowing our client-side JavaScript router to handle the rendering correctly.
What we learned
We learned that building AI applications requires a "graceful degradation" mindset. You cannot rely on LLMs as single points of failure. By combining simple, deterministic rule-based algorithms (for speed and fallback) with semantic AI agents (for deep intelligence), we created an application that is extremely fast, cost-efficient, and virtually impossible to break.
What's Next for AudienceOS
In the future, we plan to expand AudienceOS into a multi-channel platform:
- Multi-Platform Analytics: Pulling comments and feedback from Discord, Reddit, and Twitter/X to create a unified creator dashboard.
- Voice Cloned Previews: Integrating text-to-speech models to let creators listen to a generated script read in their own voice.
- Automatic Auto-Posting: Hooking up the production calendar directly to YouTube's Community Tab to post updates and schedule announcements automatically.
Built With
- css3
- fastapi
- groq
- html5
- javascript
- llama-3.1
- llama-3.3
- postgresql
- python
- react
- sqlite
- supabase
- youtubeapi
Log in or sign up for Devpost to join the conversation.