An intelligent application that transforms long-form podcast transcripts into a queryable knowledge base. Ask questions, get summaries, and generate new content in seconds. This project demonstrates an end-to-end Retrieval-Augmented Generation (RAG) pipeline, from data processing to a user-friendly web interface.
- Conversational Q&A: Ask questions in natural language and get concise, context-aware answers sourced directly from the podcast transcripts.
- On-the-Fly Summarization: Generate summaries of specific topics or entire episodes.
- Content Extraction: Pull out key takeaways, mentioned names, or companies in a structured format.
- Content Repurposing: Transform podcast discussions into new formats like Twitter threads or blog post outlines.
- Source Citing: Each response includes the specific text chunks from the transcripts that were used to generate the answer, ensuring transparency and trust.
This project is built on a modern, modular stack designed for building LLM applications.
- LLM Framework: LlamaIndex for orchestrating the RAG pipeline.
- LLM & Embeddings: Google Gemini API (
gemini-1.5-flash-latestfor generation,embedding-001for embeddings). - Web Framework: Streamlit for creating the interactive user interface.
- Language: Python 3.10+
- Environment:
python-dotenvfor managing API keys.
The application follows a classic RAG pattern:
-
Offline Indexing (
engine.py):- Podcast transcripts are loaded from the
/datadirectory. - Text is split into smaller, manageable chunks.
- Each chunk is converted into a vector embedding using Gemini's embedding model.
- The embeddings and corresponding text are stored in a local vector index using LlamaIndex's
StorageContext.
- Podcast transcripts are loaded from the
-
Real-time Querying (
app.py):- A user submits a query through the Streamlit interface.
- The query is converted into an embedding using the same model.
- The vector index is searched to find the most semantically similar text chunks (the "context").
- The context and the original query are passed to the Gemini Pro model in a carefully crafted prompt.
- The LLM generates a response based only on the provided context, which is then streamed back to the user.
Follow these instructions to set up and run the project locally.
- Python 3.10 or higher
- A Google Gemini API Key
git clone https://github.com/your-username/podcast-qa.git
cd podcast-qaWindows:
python -m venv .venv
.\.venv\Scripts\activatemacOS / Linux:
python3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txt-
Create a file named
.envin the root of the project directory. -
Add your Gemini API key to this file:
GEMINI_API_KEY="YOUR_API_KEY_HERE"
- Place your podcast transcript
.txtfiles inside the/datadirectory.
Run the indexing script. This only needs to be done once, or whenever you add new documents to the /data folder.
python engine.pyThis will create a storage directory containing your vector index.
You're all set! Launch the application with:
streamlit run app.pyYour web browser should automatically open with the app running.
- Implement conversation memory to allow for follow-up questions.
- Add support for more data sources (e.g., YouTube video transcripts, RSS feeds).
- Explore more advanced retrieval strategies like hybrid search.
- Containerize the application with Docker for easier deployment.
This project is licensed under the MIT License. See the LICENSE file for details.
