Month 3 — Agentic AI + DSA Begins (Wk 9–12)

🚀 AI Engineer Journey — Plan & Trackers · Hope AI — ML & DS Course

Weeks 9–12 · Days 57–84

🎯 Theme: Agentic AI — Build agents that plan, reason, and take actions autonomously
Active Tracks: AI (Agents) · Communication · System Design · DSA (STARTS!)

🎯 Month 3 Goals

  • Build a working ReAct agent
  • Build a multi-agent pipeline
  • Build and deploy a custom MCP server
  • Solve 30 DSA problems (arrays → graphs)
  • Polish 5 STAR behavioral stories

📋 Month 3 Milestone

✅ ReAct agent built + MCP server live + multi-agent pipeline built + 30 DSA problems + 5 STAR stories

🧠 Week 9 — The ReAct Loop: Your First Agent

One line: ReAct = Reason + Act. The agent thinks about what tool to use, uses it, observes the result, thinks again — looping until the problem is solved.

🎯 Analogy: ReAct agent = a detective. Sherlock does not just answer immediately. He reasons ("I need to check the lab"), acts (goes to lab), observes ("fingerprints found"), reasons again ("check the suspect database"), acts again — until he solves the case.

🔑 The ReAct Loop (Visual)

User: "What is the capital of France and what is 25°C in Fahrenheit?"

[THOUGHT]     I need two tools: one for facts, one for unit conversion.
[ACTION]      search("capital of France")
[OBSERVATION] "Paris is the capital of France"
[THOUGHT]     Now I need temperature conversion.
[ACTION]      convert_temp(25, "C", "F")
[OBSERVATION] "77°F"
[ANSWER]      "The capital is Paris. 25°C = 77°F."

🔑 Key Terms

TermMeaning
ThoughtLLM reasons about what to do next
ActionLLM calls a tool
ObservationResult your code returns after running the tool
TrajectoryThe full sequence of thought → action → observation steps
Stopping ConditionWhen the agent decides it has the final answer

🏗️ Build: ReAct agent with 4 tools (search, calculator, weather, time zone). Give it multi-step questions: "Is it warmer in Chennai or Paris right now? By how many degrees?"


🧠 Week 10 — Multi-Agent Systems

One line: Instead of one LLM doing everything, you split work across multiple specialized agents — each an expert in one domain — that pass work to each other.

🎯 Analogy: A hospital. One doctor does not do everything. The GP refers to a specialist → specialist runs tests → lab sends results → GP gives diagnosis. Multi-agent = a medical team working together, not a solo doctor doing everything.

🔑 Common Multi-Agent Patterns

PatternHow it worksWhen to use
Orchestrator + WorkersOne agent breaks the task and assigns to workersComplex tasks with clear sub-tasks
PipelineAgent A → Agent B → Agent C in sequenceData processing workflows
DebateTwo agents argue a point, third judge decidesFact-checking, decisions
Parallel SpecialistsEach agent works on one domain simultaneouslyResearch + writing + QA at same time

🔑 Key Terms

TermMeaning
OrchestratorThe manager agent — plans, delegates, collects results
Worker AgentSpecialist agent with one specific job
HandoffPassing task context from one agent to the next
Shared MemoryA common store all agents can read from and write to

🔑 Agent Handoff Flow (Visual)

[Orchestrator] receives: "Write an article on RAG"
       │
       ├──► [Research Agent]  searches web  ──► findings
       │                                             │
       ├──► findings ──► [Writer Agent]    ──► draft article
       │                                             │
       └──► draft ──► [QA Agent]          ──► verified output ──► FILE SAVED

🏗️ Build: Research pipeline — Orchestrator receives a topic → Research Agent searches the web → Writer Agent drafts an article → QA Agent checks facts → final output saved to a file.


🧠 Week 11 — MCP: Model Context Protocol

One line: MCP is a standard protocol for connecting LLMs to external data sources and tools — like USB-C, but for AI apps. Any LLM, any data source, one standard.

🎯 Analogy: Before USB-C, every device needed a different charger — a mess. MCP = USB-C for AI. Any LLM (Claude, GPT, Gemini) connects to any data source (your database, Google Drive, GitHub, Slack) using the same standard interface.

🔑 MCP Architecture

[Claude / LLM]  ←→  [MCP Client]  ←→  [MCP Server]  ←→  [Your Data / Tool]

🔑 Key Concepts

TermMeaningExample
MCP ServerExposes your data and tools via a standard interfaceA Python server wrapping your database
MCP ClientThe LLM-side connector (built into Claude Desktop)Claude Desktop reads your MCP server
ResourceRead-only data the LLM can accessYour files, database rows, API responses
ToolA function the LLM can callrun_sql_query(), list_files()
PromptPre-built prompt templates the LLM can use/summarize_document command

💻 Minimal MCP Server (5 lines)

from mcp.server.fastmcp import FastMCP

mcp = FastMCP("MyServer")

@mcp.tool()
def get_user_data(user_id: str) -> dict:
    """Fetch user info from the database"""
    return {"id": user_id, "name": "Arumugam", "plan": "Pro"}

if __name__ == "__main__":
    mcp.run()

🏗️ Build: MCP server that exposes 3 tools from your own data (read local files, query a SQLite DB, get system info). Connect it to Claude Desktop and test it.


One line: Basic RAG does a simple vector search. Advanced RAG adds smarter chunking, hybrid search, re-ranking, and query rewriting to get dramatically more accurate answers.

🎯 Analogy: Basic RAG = Google in 2000 (keyword match only). Advanced RAG = Google in 2024 (semantic understanding, page rank, spell correction, personalization, result re-ranking). Same idea, massively better results.

🔑 Advanced RAG Techniques

TechniqueProblem It SolvesHow
Hybrid SearchPure vector search misses exact keywordsCombine keyword search (BM25) + vector search
Re-rankingTop 3 results may not be the most relevantUse a cross-encoder to re-score retrieved chunks
Query RewritingUser's question is vague or ambiguousLLM rewrites the query before searching
Parent-Child ChunksSmall chunks retrieved, but need more contextRetrieve small chunk, inject its full parent paragraph
HyDENo good match exists for the queryGenerate a hypothetical answer, search with that instead

🔑 Hybrid Search (Visual)

Query: "What does the CEO earn?"

BM25 (keyword):   finds "CEO", "earn", "salary" — exact word match
Vector Search:    finds "executive compensation" — semantic match
Hybrid result:    BOTH types merged → much better recall

🏗️ Build: Upgrade your Week 3 PDF bot with hybrid search + re-ranking. Test accuracy on 20 questions before vs after — you should see a clear improvement.


📅 Week Pages — Detailed Daily Checklists

  • Week 9 — The ReAct Loop: Your First Agent
  • Week 10 — Multi-Agent Systems
  • Week 11 — MCP: Model Context Protocol
  • Week 12 — Advanced RAG & Vector Search