🧠 AI Engineering — RAG, MCP & AI Agents¶
From fundamentals to production deployment — complete guides, implementations, and interview preparation for AI engineering systems
📦 Modules¶
| Module | Description | Key Topics |
|---|---|---|
| 📚 RAG | Retrieval-Augmented Generation | Pipeline architecture, embeddings, retrieval strategies, production scaling, fine-tuning |
| 🔌 MCP | Model Context Protocol | Protocol mechanics, server implementation, RAG integration, production deployment |
| 🤖 Agents | AI Agent Engineering | Agent architecture, orchestration, tool-use loops, multi-agent systems, production guardrails |
| 🏭 Production AI | Production AI Engineering & Interview Prep | RAG debugging, hallucination detection, cost optimization, latency debugging, enterprise agents, MCP security, multi-agent workflows |
| 🔧 Harness & Loop Engineering | Production Scaffolding & Agentic Loops | Evaluation/agent harnesses, guardrails, sandboxing, prompt-injection containment, verification loops, ReAct patterns, loop safety, termination logic |
| 🧬 LLM Internals | How Claude and Claude Code Work | Prefill/decode and KV cache, sampling, tokenization, Messages API request/response cycle, prompt caching, prompting, cost optimization |
🏗️ Architecture Overview¶
┌────────────────────────────────────────────────────────────────────┐
│ AI AGENT (Host) │
│ ┌──────────────────────────────────────────────────────────────┐ │
│ │ Planning → Memory → Tool-Use → Execution → Feedback │ │
│ └──────────────────────────┬───────────────────────────────────┘ │
│ │ │
└─────────────────────────────┼─────────────────────────────────────┘
│ MCP Protocol (JSON-RPC 2.0)
┌───────────────────┼────────────────────┐
│ │ │
▼ ▼ ▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ RAG Pipeline │ │ MCP Server │ │ External APIs │
│ (Knowledge) │ │ (Tools/Actions) │ │ (3rd Party) │
└──────────────────┘ └──────────────────┘ └──────────────────┘
🚀 Quick Start¶
# RAG — Index documents and query
cd rag/
pip install -r implementation/requirements.txt
python implementation/main.py --index --docs ./data/
python implementation/main.py --query "What is RAG?"
# MCP — Start servers
cd ../mcp/
python -m servers.calculator_server # Test the calculator MCP server
python -m clients.python_client --server calculator --list # List tools
📚 Recommended Learning Path¶
- RAG Fundamentals → Understand knowledge retrieval architecture
- MCP Fundamentals → Learn protocol mechanics and primitives
- MCP Implementation & RAG → Build servers and connect RAG
- MCP Production Architecture → Enterprise security, deployment
- Agents → Orchestration, tool-use loops, production guardrails
- Production AI → Debugging, optimization, and enterprise architecture for production systems
- Harness Engineering & Loop Engineering → Production scaffolding, loop design
- Interview Questions → Prepare for Staff/Principal-level interviews