// PROJECT · AI & AGENTS

Build Your First AI Agent

A twelve-notebook course that builds an AI agent from scratch — a hand-rolled ~35-line agent loop, then RAG, MCP, structured outputs, memory, multi-agent orchestration, and evals layered on top. Works with any OpenAI-compatible provider.

  • Python
  • Jupyter
  • LLMs
  • MCP
  • RAG

The whole course fits in one sentence: an agent is just a loop plus a capability table. Notebook 02 builds that loop by hand in ~35 lines as an explicit state machine — the model requests a tool by name and JSON arguments, your code executes it and feeds the result back, max_iterations acts as a TTL against runaway loops. Notebooks 04–06 then reuse the identical loop with three different read-only capability tables: one explores a codebase with ls/cat/grep, one triages logs, one queries SQLite. The repetition is the lesson.

The back half cashes it in: RAG with a hand-rolled numpy vector store (retrieval is just another tool), serving the same tools over MCP from a separate process, structured outputs with Pydantic validation and retry, session memory with context-budget summarization, a supervisor agent whose tools are the earlier specialist agents, and finally LLM-as-judge evals plus prompt-injection guardrails.

Core notebooks depend only on the openai client (any OpenAI-compatible provider works); one notebook rebuilds the same agent in LangChain/LangGraph so you can see exactly what a framework buys you. Every notebook ships a Gradio *_with_ui twin with a live agent-trace panel for demos.

SOURCE CODEgithub.com/harshithsunku/build-your-first-ai-agentOpen on GitHub ↗

// MORE IN AI & AGENTS

Agent loops, courses, and plumbing for LLMs.

All projects →
AI & AGENTSPython · Jupyter

Learn Jev end to end

A free, hands-on course on building AI agents with a fast brain and a slow brain — 12 short notebooks and 13 real use cases that put Jev, a decision model, inside an LLM agent loop. One API key; the whole course runs for under $0.20.

PythonJupyterLLMsAgentsOpenRouter
AI & AGENTSPython · MCP

mcp-gtags-server

Indexed code navigation for AI coding agents — replaces full-tree grep scans with GNU Global (gtags) lookups over the Model Context Protocol. ~100× faster per query on kernel-scale codebases, with radically less context noise.

PythonMCPGNU Globalctags