<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Sri Deevi on AI & Cloud]]></title><description><![CDATA[Principal Cloud Architect exploring agentic AI, one project at a time.]]></description><link>https://srirdeevi.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 10 Sep 2026 07:11:49 GMT</lastBuildDate><atom:link href="https://srirdeevi.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[From Documents to Intelligent Answers:  Building a RAG Agent from Scratch & Lessons Learned]]></title><description><![CDATA[Artificial Intelligence applications are rapidly moving beyond simple question-answering systems. Modern enterprise AI assistants need to understand internal documents, retrieve accurate information, ]]></description><link>https://srirdeevi.hashnode.dev/from-documents-to-intelligent-answers-building-a-rag-agent-from-scratch-lessons-learned</link><guid isPermaLink="true">https://srirdeevi.hashnode.dev/from-documents-to-intelligent-answers-building-a-rag-agent-from-scratch-lessons-learned</guid><dc:creator><![CDATA[Sri Deevi]]></dc:creator><pubDate>Tue, 14 Jul 2026 19:53:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a5689f7b74740d99442a74e/bee7f2bd-a66c-4954-8034-f15ecee97839.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Artificial Intelligence applications are rapidly moving beyond simple question-answering systems. Modern enterprise AI assistants need to understand internal documents, retrieve accurate information, and provide reliable answers based on company knowledge.</p>
<p>I started building agentic AI systems from scratch — not to theorize about them, but to actually write the code, break it, and understand it from the inside out. This post walks through the second project in that journey: a Retrieval-Augmented Generation (RAG) system, what I built, what tripped me up, and where I'm taking it next.</p>
<h3>What is RAG?</h3>
<p>Retrieval-Augmented Generation combines two capabilities:</p>
<ol>
<li><p>Retrieval: The system searches a knowledge base and finds relevant information related to the user's question.</p>
</li>
<li><p>Generation: The retrieved information is provided as context to an LLM, which generates a response based on that knowledge.</p>
</li>
</ol>
<p>Instead of asking an LLM to remember everything, RAG allows the model to access external knowledge dynamically.</p>
<h3>Technologies Used</h3>
<p>Python, LangChain, Ollama (Local LLM), Embeddings, Vector Database, FastAPI</p>
<h2>What I Built</h2>
<p>The core idea is to build a system that answers questions using only the content of a document, rather than whatever the underlying model already "knows."</p>
<p>Documents → Text Splitter → Embeddings → Vector Store → Retriever → LLM → Answer</p>
<ul>
<li><p><strong>Document loading</strong> — a company policy document, loaded with LangChain's <code>TextLoader</code></p>
</li>
<li><p><strong>Text Splitting</strong> — split into 200-character chunks with 50-character overlap, using <code>RecursiveCharacterTextSplitter</code></p>
</li>
<li><p><strong>Create Embeddings</strong> — generated with <code>sentence-transformers/all-MiniLM-L6-v2</code> via <code>HuggingFaceEmbeddings</code></p>
</li>
<li><p><strong>Vector store</strong> — persisted in <strong>Chroma</strong></p>
</li>
<li><p><strong>Retrieval</strong> — top-2 most relevant chunks pulled per question</p>
</li>
<li><p><strong>Generation</strong> — a strict prompt template that instructs the model to answer <em>only</em> from the retrieved context, run through <strong>Ollama's</strong> <code>tinyllama</code>.</p>
</li>
</ul>
<h3>Lessons Learned</h3>
<p>Building a RAG system taught me that successful AI applications are not only about selecting a powerful LLM. The quality of the final answer depends heavily on:</p>
<ul>
<li><p>Document quality</p>
</li>
<li><p>Chunking strategy</p>
</li>
<li><p>Retrieval accuracy</p>
</li>
<li><p>Prompt design</p>
</li>
<li><p>Evaluation methods</p>
</li>
</ul>
<h3>Conclusion</h3>
<p>RAG provides a practical foundation for building enterprise AI assistants that can use private knowledge while reducing hallucination risks. This project became the foundation for my next experiments with multi-agent workflows, MCP servers, and autonomous AI systems.</p>
<p>Source Code: <a href="https://github.com/srirdeevi/agentic-ai-portfolio">https://github.com/srirdeevi/agentic-ai-portfolio</a></p>
<p>#AI #GenerativeAI #RAG #LLM #LangChain #Python #ArtificialIntelligence</p>
]]></content:encoded></item></channel></rss>