PATH 03

AI Agents

LLMs that don't just answer — they reason, plan, use tools, and accomplish goals autonomously.

01

AI Agent vs Agentic AI

AI AGENT

A single LLM equipped with tools that autonomously completes tasks within a defined scope.

  • Single goal, single execution loop
  • Perceive → Think → Act cycle (ReAct)
  • Tools: search, code interpreter, APIs
  • Examples: customer support bot, code reviewer
AGENTIC AI

A system of coordinated agents that collaborate to complete complex, multi-domain workflows.

  • Multi-agent coordination
  • Planner, Executor, Critic, Reviewer roles
  • Long-running workflows, stateful
  • Examples: AI developer team, research pipeline
DimensionAI AgentAgentic AI System
Number of LLMsOneMultiple (specialized)
CoordinationNone neededOrchestrator + sub-agents
StateShort conversation bufferDistributed shared state
Failure handlingRetry same loopReassign to another agent
ComplexityLow → MediumMedium → Enterprise
02

The ReAct Pattern

ReAct (Reason + Act) is the foundational agent loop. The LLM alternates between Thought (reasoning) and Action (tool call), observing results until it reaches the final answer.

sequenceDiagram participant U as User participant A as Agent (LLM) participant T as Tools U->>A: "What is Azure Foundry's latest SDK version and how do I install it?" A->>A: Thought: I need to search for the latest version A->>T: Action: web_search("Azure Foundry SDK latest version") T->>A: Observation: "azure-ai-projects 1.0.0b8 released Nov 2024" A->>A: Thought: Found version, now I need installation command A->>T: Action: code_execute("pip show azure-ai-projects") T->>A: Observation: ">=1.0.0b8 requires Python 3.8+" A->>A: Thought: I have all info needed to answer A->>U: Final Answer: "Version 1.0.0b8. Install with: pip install azure-ai-projects"
# LangChain ReAct agent — minimal example
from langchain.agents import AgentExecutor, create_react_agent
from langchain_openai import AzureChatOpenAI
from langchain.tools import DuckDuckGoSearchRun, PythonREPLTool

llm = AzureChatOpenAI(model="gpt-4o", temperature=0)
tools = [DuckDuckGoSearchRun(), PythonREPLTool()]

agent = create_react_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools, verbose=True)

result = executor.invoke({"input": "Analyze sales data and email summary"})
03

Function Calling & Tool Use

Tool Definition (OpenAI format)

# Define a tool the agent can call
tools = [{
  "type": "function",
  "function": {
    "name": "get_weather",
    "description": "Get current weather",
    "parameters": {
      "type": "object",
      "properties": {
        "city": {"type": "string"}
      }
    }
  }
}]

Common Agent Tools

searchWeb search (Bing, Brave, DuckDuckGo)
code_execPython REPL, Jupyter kernel
file_ioRead, write, parse documents
api_callREST APIs, databases, webhooks
retrieverRAG — query vector DB
sub_agentDelegate to specialized agent
04

Agent Memory Types

1

Short-Term (Conversation Buffer)

The current conversation history in the context window. Limited by token budget. Lost when session ends.

Implementation: List of messages passed each call. Use ConversationBufferWindowMemory(k=10) to cap.
2

Long-Term (Persistent Store)

Facts stored externally — databases, files, vector stores. Survives sessions and scales indefinitely.

Implementation: Redis, Cosmos DB, Azure Blob. Agent uses read/write tools to access it.
3

Episodic Memory

Record of past interactions and decisions. Agent can reflect: "Last time I tried X and it failed, so I'll try Y."

Implementation: Vector DB of past (task, action, outcome) tuples. Queried with semantic similarity.
4

Semantic Memory

General world knowledge and domain facts extracted and indexed for RAG-based retrieval during agent execution.

Implementation: RAG pipeline (see PATH 02). Agent calls retriever tool when it needs domain knowledge.
05

Agent Frameworks Compared

FrameworkPatternBest ForComplexity
LangChainChain + ReAct agentsStandard RAG + agent workflowsLow
LangGraphState machine graphComplex multi-step, branching logicMedium
CrewAIRole-based crewsCollaborative multi-agent teamsMedium
AutoGenConversational agentsCode generation, peer review loopsMedium
Azure AI Agent SvcManaged agentsEnterprise, Azure-native, managed infraLow (managed)
Semantic KernelPlugin/skill modelMicrosoft ecosystem, .NET/PythonMedium
Use LangGraph when

You need complex conditional flows, human-in-the-loop checkpoints, or stateful multi-step workflows with retries.

Use CrewAI when

You're building team simulations — researcher, writer, reviewer — each with a defined role, backstory, and goal.

Use Azure AI Agent Svc when

You want fully managed agents in Azure with auto-scaling, thread management, file storage, and no infra to manage.

06

Model Context Protocol (MCP)

MCP (Anthropic, 2024) is an open standard for connecting AI agents to external tools and data sources. Think of it as USB-C for AI integrations — write a connector once, use it with any MCP-compatible model.

flowchart LR subgraph CLIENTS ["MCP Clients"] C1[Claude] C2[VS Code Copilot] C3[Your Agent] end subgraph SERVERS ["MCP Servers"] S1[GitHub Server\n— repos, issues, PRs] S2[Database Server\n— SQL, NoSQL queries] S3[File Server\n— read, write local files] S4[Azure Server\n— resources, deployments] end C1 <-->|MCP Protocol| S1 C2 <-->|MCP Protocol| S2 C3 <-->|MCP Protocol| S3 C3 <-->|MCP Protocol| S4 style CLIENTS fill:#fff7ed,stroke:#ea580c style SERVERS fill:#f0fdf4,stroke:#16a34a
Transport
stdio, SSE (HTTP), WebSocket
Primitives
Tools, Resources, Prompts
SDK Support
Python, TypeScript, Go, Java
07

7 Layers of Agentic Capability

1
LLM (Foundation)
Pretrained language model — GPT-4o, Claude 3.5, Gemini. The language reasoning core.
2
Tool Use
Function calling, code execution, API integrations. Transforms LLM from reader to actor.
3
Memory
Short-term (context), long-term (DB), episodic (past tasks), semantic (RAG) — see section 04.
4
Planning & Reasoning
Task decomposition, goal hierarchies (CoT, ToT, ReAct). Breaks big problems into steps.
5
Self-Reflection & Evaluation
Critic agents, self-critique, output scoring. Quality assurance before final response.
6
Multi-Agent Coordination
Orchestrator → Router → Specialist agents. CrewAI, LangGraph, AutoGen patterns.
7
Governance & Safety
Human-in-the-loop, rate limiting, budget controls, content filtering, audit logging.
← RAG Guide Next: Agentic AI →