<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>RS</title><description>Hey, I am Rashad I am a software developer who enjoys working on opensource software, GNU/Linux user (I use Arch, BTW XD).</description><link>https://rashadalsharpini.github.io/</link><item><title>mcp vs. rag</title><link>https://rashadalsharpini.github.io//posts/mcp-vs-rag/</link><guid isPermaLink="true">https://rashadalsharpini.github.io//posts/mcp-vs-rag/</guid><description>A comparison of MCP (Model Context Protocol) and RAG (Retrieval Augmented Generation)</description><pubDate>Fri, 06 Feb 2026 00:00:00 GMT</pubDate><content:encoded>## Retrieval Augmented Generation

Instead of relying on training data that may be outdated, RAG grounds the LLM to search through your own data sources or use a search engine first. This ensures the model returns the most up-to-date information.

RAG also provides citations, giving responses more credibility and reducing hallucinations. Additionally, it solves privacy concerns—while LLMs traditionally only know what&apos;s in their training data (public information), RAG lets you grant access to private PDFs and documents, enabling the model to answer specific questions about your organization.

This approach is also more cost-effective than retraining an LLM. Instead of expensive retraining, you simply add fresh data to your database.

### Steps to Implement

1. **Ingestion**: Collect your private data (PDFs, docs, SQL databases)
2. **Chunking**: Break text into smaller pieces so the AI doesn&apos;t get overwhelmed
3. **Embedding**: Run chunks through an embedding model to convert text into vectors (numerical representations of meaning)
4. **Vector Database**: Store vectors in specialized databases like Pinecone, Milvus, or Weaviate
5. **Retrieval**: When a user asks a question, convert it to a vector, find the most similar vectors in your database, and feed those facts to the LLM as context

---

## Model Context Protocol

MCP solves the &quot;knowing&quot; problem differently—and goes beyond just retrieving information.

While a RAG system returns insights to help answer questions, MCP can take those insights and perform actions.

For example, imagine you need a vacation and don&apos;t know the company policy:

- **Plain LLM**: May hallucinate an answer
- **RAG + LLM**: Retrieves relevant company documents and cites sources
- **MCP + RAG + LLM**: Retrieves the information AND takes action, like sending an email to HR requesting vacation time

### Steps to Implement

1. Choose or build an MCP server
2. Use an MCP-compatible client (like Claude Desktop or an IDE)
3. Connect the client to the server via a config file
4. Execution: When you ask the AI to &quot;check the weather,&quot; the client uses the MCP server to fetch live data from an API and brings it back into the chat

---
## So in the simplest words
- RAG is about **knowing** more
- MCP is about **doing** more</content:encoded><author>Rashad Alsharpini &lt;rashadalsharpini2@gmail.com&gt;</author></item></channel></rss>