--- title: Ask The Right Question emoji: 🎤 colorFrom: purple colorTo: indigo sdk: gradio sdk_version: "5.50.0" app_file: app.py pinned: false tags: - mcp-in-action-track-consumer - agents - question-generation - q-and-a - critical-thinking --- # Ask The Right Question > AI-powered assistant that helps you ask insightful questions during Q&A sessions at conferences, classes, and talks. ## The Problem You're at a conference, a class, or a talk. The speaker finishes and opens the floor for questions. Your mind goes blank. You want to: - Ask something meaningful that shows you were engaged - Make a connection with the speaker - Actually learn something valuable from the Q&A But coming up with good questions on the spot is hard. ## The Solution **Ask The Right Question** listens to the talk and helps you generate thoughtful, well-researched questions. It: 1. **Captures Context** - Record audio snippets or paste notes from the talk 2. **Researches** - Automatically researches the speaker's background, fact-checks claims, and finds relevant trends 3. **Generates Questions** - Creates insightful questions with explanations of *why* they're good 4. **Teaches Critical Thinking** - Helps you understand what makes a question valuable ## Features ### Core Features (MVP) - Live microphone capture with OpenAI Whisper transcription - Context accumulation as the talk progresses - AI-powered question generation with Claude - Web research via Tavily (speaker background, fact-checking, trends) - Question categorization (Clarification, Depth, Connection, Challenge, Practical, Forward) - Explanation of why each question is valuable ### Stretch Goals - Fill-in-the-blank questions for learning - Question ranking exercises - Gamification to build critical thinking skills ## How It Works ``` +----------------+ +------------------+ +-----------------+ | Microphone | --> | Transcription | --> | Context Store | | (Gradio) | | (OpenAI Whisper)| | (Accumulating) | +----------------+ +------------------+ +--------+--------+ | +--------------------------------+--------+ | v | | +-------------+ +----------------+ | | | Tavily API | | Claude Agent | | | | - Web Search| -> | Question Gen | | | | - News | +-------+--------+ | | | - Fact Check| | | | +-------------+ | | | Agent Loop | | +-----------------------------+-----------+ | v +-----------------+ | Gradio UI | | - Questions | | - Explanations| +-----------------+ ``` ## Question Categories | Category | Description | Example | |----------|-------------|---------| | **CLARIFICATION** | Seeks to understand better | "Could you elaborate on what you meant by...?" | | **DEPTH** | Explores a topic more deeply | "What's the underlying mechanism behind...?" | | **CONNECTION** | Connects to other fields | "How does this relate to developments in...?" | | **CHALLENGE** | Probes assumptions respectfully | "Have you considered the alternative view that...?" | | **PRACTICAL** | Asks about real-world application | "How would this work in practice for...?" | | **FORWARD** | Explores future implications | "Where do you see this heading in the next...?" | ## Tech Stack - **Frontend**: Gradio 6 - **Transcription**: OpenAI Whisper API - **Agent LLM**: Claude (Anthropic) - **Research**: Tavily API (web search, news, fact-checking) - **Hosting**: HuggingFace Spaces ## Setup ### Environment Variables Create a `.env` file with: ```bash OPENAI_API_KEY=your_openai_api_key ANTHROPIC_API_KEY=your_anthropic_api_key TAVILY_API_KEY=your_tavily_api_key ``` ### Local Development ```bash # Clone the repo git clone https://huggingface.co/spaces/YOUR_USERNAME/ask-the-right-question # Install dependencies uv sync # Run the app uv run python app.py ``` ## Usage 1. **Record Audio**: Click the microphone button to record snippets of the talk 2. **Or Paste Text**: Manually paste notes or transcript 3. **Add Speaker Info**: (Optional) Enter the speaker's name for background research 4. **Generate Questions**: Click the button to get AI-generated questions 5. **Learn**: Read the explanations to understand why each question is valuable ## Demo Video [Coming soon] ## Social Media Post [Link to social media post] ## Team - [Your Name](https://huggingface.co/YOUR_USERNAME) ## Acknowledgments Built for the MCP's 1st Birthday Hackathon by Hugging Face (November 2025) Powered by: - [Anthropic Claude](https://anthropic.com) - AI reasoning and question generation - [OpenAI Whisper](https://openai.com) - Audio transcription - [Tavily](https://tavily.com) - AI-optimized web search - [Gradio](https://gradio.app) - UI framework - [HuggingFace](https://huggingface.co) - Hosting ## Challenges & Solutions ### Audio Transcription Timing Issues (Solved ✅) **Original problem:** Short audio chunk intervals caused the transcription API to fall behind, resulting in fragmented audio and information loss. **Solutions implemented:** - ✅ **20-second audio chunks** - Longer intervals give Whisper more context and reduce API calls - ✅ **2-second overlap** - Prevents word cutoffs at chunk boundaries - ✅ **Background threading** - Transcription and question generation run in separate threads - ✅ **Sequential queue** - Ensures transcriptions complete in order while audio keeps buffering ## To-Do ### Future Improvements - [ ] **Add useful MCPs** - Integrate additional MCP servers for enhanced capabilities: - Academic paper search (for research talks) - Company/organization lookup (for business presentations) - Technical documentation search (for developer conferences) - [ ] **Implement voice activity detection (VAD)** - Only transcribe when speech is detected - [ ] **Add local transcription fallback** - Use local Whisper model when API latency is too high ## License MIT