Module 09

Agent Frameworks & Tools

Building Systems AI Agents

Module 9 — Agent Frameworks & Tools 🧰

Goal of this module: Meet the real software you’ll use to build agents, understand what a “framework” does for you, and learn how to choose one. We’ll keep it beginner-friendly and concept-first — you can always read each tool’s docs later. (Note: the AI tooling world moves fast, so focus on the ideas, not memorizing version numbers.)


9.1 Do you even need a framework?

You’ve learned that an agent is really just a loop: think → act → observe, with tools and memory bolted on. You could build that loop yourself with plain code and an LLM API. In fact, for learning, building a tiny agent from scratch is the best exercise (we do that in Module 12).

So why use a framework? Because frameworks handle the boring, repetitive plumbing for you:

  • Managing the message history and context window
  • Parsing tool calls and running tools
  • Retry logic when something fails
  • Memory and retrieval (RAG) wiring
  • Coordinating multiple agents
  • Logging and debugging support

Analogy: You can build a website with raw HTML, but most people use a framework so they don’t reinvent buttons, forms, and routing. Same idea here.

Rule of thumb: Learn the concepts by building one simple agent yourself, then use a framework for real projects to save time.


9.2 The two families of tools

It helps to split the ecosystem into two groups:

(a) Orchestration frameworks (build the agent loop)

These help you build and coordinate agents — the loop, tools, multi-agent coordination.

(b) Data / retrieval frameworks (power memory & RAG)

These help you connect agents to your data — loading documents, embeddings, vector search (Module 6’s RAG).

Many real projects use one from each group together (e.g., an orchestration framework for the agent + a data framework for RAG).


9.3 The major frameworks (what each is good at)

Here’s a friendly tour. You don’t need all of them — this is a map so you recognize the names.

LangChain

One of the oldest, biggest toolkits for building LLM apps. Lots of pre-built integrations (tools, models, vector DBs). Great for getting started and for “glue.” Some find it heavy.

  • Good for: quickly wiring together LLMs, tools, and data with lots of ready-made pieces.

LangGraph

Built by the LangChain team, focused on agents as graphs — you define nodes (steps) and edges (transitions), giving you fine control over the agent’s flow, loops, and branching. Popular for complex, controllable agents.

  • Good for: when you need precise control over a multi-step or multi-agent flow.

LlamaIndex

Specializes in connecting LLMs to your data — loading documents, indexing, and retrieval. The go-to for RAG (Module 6).

  • Good for: building agents that answer questions over your documents/knowledge base.

CrewAI

Designed for multi-agent teams (Module 8). You define agents with roles (“researcher,” “writer”), give them tasks, and CrewAI coordinates the crew. Beginner-friendly and intuitive.

  • Good for: role-based multi-agent systems with minimal code.

AutoGen (Microsoft)

A framework for multi-agent conversations — agents that talk to each other (and to humans/tools) to solve problems. Strong for the debate/collaboration pattern.

  • Good for: conversational multi-agent setups and human-in-the-loop.

OpenAI Agents SDK / Assistants

First-party tools from OpenAI for building agents with their models — handles tool calling, state, and handoffs.

  • Good for: staying within the OpenAI ecosystem with official support.

Smolagents (Hugging Face)

A lightweight, minimal framework — small and easy to understand, good for learning and simple agents.

  • Good for: beginners who want something tiny and transparent.

Semantic Kernel (Microsoft)

An SDK for embedding AI into apps, popular in enterprise/.NET and Python settings.

  • Good for: integrating agents into larger business applications.

Reality check: New frameworks appear constantly and existing ones change fast. The concepts you learned in Modules 1–8 are stable; frameworks are just different packaging of those same concepts. Learn the ideas, and any framework becomes easy to pick up.


9.4 Supporting tools you’ll also meet

Beyond the agent frameworks, a real project uses supporting pieces:

  • Vector databases (Module 6): Pinecone, Chroma, Weaviate, Qdrant, FAISS — store embeddings for RAG.
  • Model providers: OpenAI, Anthropic, Google, plus open models via Hugging Face / Ollama (run models locally).
  • MCP servers (Module 4): pre-built tool packs (GitHub, Slack, databases) your agent can plug into.
  • Observability tools (Module 10): LangSmith, LangFuse, Helicone — to watch, log, and debug your agent.
  • Evaluation tools (Module 10): frameworks to score how good your agent is.
   ┌────────── Your Agent App ──────────┐
   │  Orchestration framework           │  ← LangGraph / CrewAI / AutoGen...
   │     + Data/RAG framework           │  ← LlamaIndex...
   │     + Model provider               │  ← OpenAI / Anthropic / local
   │     + Vector DB                    │  ← Chroma / Pinecone...
   │     + Tools (incl. MCP servers)    │  ← search, code, Slack...
   │     + Observability                │  ← LangSmith / LangFuse...
   └────────────────────────────────────┘

9.5 How to choose (a simple decision guide)

Don’t agonize. Use this:

  • Just learning? → Build a tiny agent yourself (Module 12), or use smolagents. Understand the loop first.
  • Need RAG over documents?LlamaIndex (or LangChain’s retrieval pieces).
  • Need a multi-agent team with roles?CrewAI (simple) or AutoGen (conversational).
  • Need precise control over a complex flow?LangGraph.
  • Want lots of ready-made integrations?LangChain.
  • Staying in one vendor’s ecosystem? → that vendor’s official SDK (e.g., OpenAI Agents SDK).

Biggest beginner mistake: framework-hopping — endlessly switching tools instead of building. Pick one reasonable option, build something end-to-end, and learn by doing. You can switch later; the concepts transfer.


9.6 What a framework does NOT do for you

Frameworks handle plumbing, but you still must:

  • Design good prompts (Module 2)
  • Choose and design good tools (Module 4)
  • Decide your planning/reasoning approach (Modules 3, 5)
  • Set up memory/RAG thoughtfully (Module 6)
  • Add guardrails and safety (Module 11)
  • Evaluate whether it actually works (Module 10)

The framework is the kitchen; you’re still the chef. A great kitchen doesn’t make a great meal on its own.


9.7 Common mistakes

MistakeResultFix
Framework-hoppingNever finish anythingPick one, build end-to-end
Framework before fundamentalsMagic you can’t debugBuild one agent from scratch first
Over-relying on defaultsMediocre prompts/toolsYou still design prompts, tools, evals
Picking the heaviest tool “to be safe”Needless complexityMatch the tool to the task’s real needs
Chasing every new releaseConstant churnConcepts are stable; don’t chase hype

9.8 Check yourself ✅

  1. What’s the main thing a framework does for you?
  2. Which framework family would you reach for to do RAG over your documents?
  3. Which framework is known for easy, role-based multi-agent teams?
  4. What’s the “framework-hopping” mistake and the fix?
Answers
  1. It handles the repetitive plumbing — message/context management, tool-call parsing, retries, memory/RAG wiring, multi-agent coordination, logging.
  2. A data/retrieval framework like LlamaIndex (or LangChain’s retrieval components).
  3. CrewAI (AutoGen is also strong for conversational multi-agent).
  4. Endlessly switching frameworks instead of building; fix by picking one reasonable option and building something end-to-end.

9.9 Summary

  • Frameworks handle the plumbing so you focus on design; but learn the loop yourself first.
  • Two families: orchestration (LangChain, LangGraph, CrewAI, AutoGen, smolagents) and data/RAG (LlamaIndex). Real projects often combine both, plus a model provider, vector DB, tools/MCP, and observability.
  • Choose based on your need (RAG → LlamaIndex; multi-agent → CrewAI/AutoGen; control → LangGraph; integrations → LangChain).
  • Frameworks don’t replace good prompts, tools, memory, safety, and evaluation — you’re still the chef.
  • Avoid framework-hopping; the concepts are stable, the tools are just packaging.

Next up: Module 10 — Evaluation & Observability. How do you actually know if your agent is good — and how do you debug it when it isn’t? 👉 10_Evaluation_And_Observability.md