RAG Agent (Talk to YT Transcripts)
🔴 THE PROBLEM
The client had a growing knowledge base of processed transcripts and documents but no efficient way for users to extract insights from it. Manual search was slow and surface-level — users couldn't ask natural-language questions and get grounded, accurate answers. The business needed an intelligent interface that could retrieve contextually relevant information and generate reliable responses without hallucinating or going off-source.
🔧 WHAT I BUILT
I built a full Retrieval-Augmented Generation (RAG) system connecting the Pinecone knowledge base to an AI-powered query interface:
Query intake and embedding conversion — user questions are vectorized and matched against the Pinecone knowledge base in real time
Layered retrieval logic with dynamic metadata filters (category + topic keywords), plus automatic fallback to unfiltered search when filtered results are insufficient
Graph RAG pre-processing layer that extracted subject–relation–object triples from transcripts using an LLM, normalized them with custom JavaScript, and stored entity/edge relationships in PostgreSQL for relational context enrichment
Alias and topic management system that merged entity variations and deduplicated keywords — improving recall across different user phrasings
OpenAI Tools Agent orchestration — the agent selects between filtered and unfiltered Pinecone tools, assembles retrieved context, and generates answers strictly grounded in the knowledge base
Prompt engineering and guardrails to prevent hallucination — the agent only answers from retrieved content, citing source context
✅ THE RESULT
Users could now interact with the entire knowledge base conversationally — asking natural-language questions and receiving accurate, source-grounded answers in seconds. Retrieval accuracy improved significantly over keyword search, and the Graph RAG layer added relational context that standard vector retrieval misses. The system transformed a static document archive into a practical AI assistant, reducing research time and improving decision-making speed for the client's team.