Understanding AI Agents and AI Agents Frameworks.

ANURAG KULEANURAG KULE
7 min read

πŸš€ Introduction

In the era of Generative AI, we're no longer limited to passive LLMs that just respond to prompts. Today, we build AI agentsβ€”intelligent software entities that think, plan, and act.

With the rise of agentic frameworks like LangGraph, Pydantic-AI, CrewAI, AutoGen, and Phidata, choosing the right one can be overwhelming.

This blog demystifies:

  • What AI Agents are

  • Their types

  • What is Agentic AI?

  • The difference between AI Agents and Agentic AI

  • A brief overview and when to use each popular AI Agent framework


🧠 What Are AI Agents?

AI Agents are software entities powered by LLMs (Large Language Models) that can perceive their environment, make decisions, and perform actions to achieve defined goals. They can:

  • Access tools (e.g., calculators, APIs)

  • Make step-by-step plans (via ReAct, Chain of Thought)

  • Collaborate with other agents or humans

  • Autonomously execute workflows

Common Use Cases:

  • Customer support bots

  • Research agents (e.g., browsing and summarizing)

  • Task automation (e.g., file handling, emails)

  • Code generation and debugging assistants

🧠 Working of the AI Agent Architecture

πŸ” Important Component: AI Agent

The AI Agent sits at the core and acts as the decision-maker. It:

  • Receives inputs

  • Plans actions

  • Delegates tasks

  • Interfaces with tools and memory

  • Responds to or interacts with the environment


πŸ§‘β€πŸ’Ό 1. Human Control

  • Purpose: Allows humans to intervene, monitor, or provide high-level instructions.

  • Flow: The human can supervise or override actions via Human-in-the-loop control.

  • Example: You prompt an agent to β€œPlan my trip.” You can approve or change its suggestions.


βš™οΈ 2. Autonomous Action

  • Purpose: Once instructed, the agent can act independently without further guidance.

  • Flow: The agent chooses tools, makes decisions, and executes tasks automatically.

  • Example: Booking a ticket or generating a report using available APIs or documents.


🧠 3. Memory Access

  • Purpose: Provides context and continuity across interactions.

  • Flow: The agent stores or retrieves past conversations, knowledge, or user preferences.

  • Example: Remembers you like window seats when booking flights or that you prefer vegetarian meals.


πŸ‘οΈ 4. Reactivity (Environment Sensing)

  • Purpose: Allows the agent to react to changes in its environment or external data.

  • Flow: It observes or is notified about changes and updates its actions accordingly.

  • Example: Weather changed in your travel city β†’ agent updates itinerary.


🌐 5. Tool Access

  • Purpose: The agent uses tools to enhance its capabilities.

  • Components:

    • API Calls: For actions like payment, database access, or cloud services.

    • Internet Access: For live information like news, weather, flights, stock prices.

    • Code Interpretation: For scripting, calculations, or debugging.

  • Example: Uses OpenWeather API to get live weather and Python to calculate travel costs.


πŸ§‘β€πŸ€β€πŸ§‘ 6. Delegate Tasks (Multi-Agent Collaboration)

  • Purpose: Complex tasks are split among specialized sub-agents.

  • Flow: The main agent delegates subtasks (e.g., Research, Summarize, Write, Review).

  • Example: In a blog generation task:

    • Researcher Agent β†’ Finds content

    • Writer Agent β†’ Drafts blog

    • Editor Agent β†’ Refines it


☁️ 7. Environment

  • Purpose: Represents external systems the agent interacts with.

  • Flow: The agent perceives or manipulates the environment via tools, APIs, or sensors.

  • Example: CRM system, home automation devices, enterprise databases.


βš™οΈ Example End-to-End Flow:

Goal: "Book a 3-day Goa trip and generate a report"

  1. User Input: "Plan my Goa trip"

  2. Agent decides to:

    • Use a sub-agent for research

    • Call weather + flight APIs

    • Store preferences in memory

  3. Tools Used:

    • API Call β†’ Flight prices

    • Internet β†’ Hotel ratings

    • Code Tool β†’ Trip cost calculator

  4. Sub-agents collaborate to finalize the plan.

  5. Agent executes bookings, generates PDF, and sends it.

  6. User approves the plan or modifies it manually.


🧱 Types of AI Agents

TypeDescription
Reactive AgentsRespond to prompts without memory or long-term planning.
Tool-Using AgentsCan call tools (e.g., search, calculator, APIs) to complete tasks.
Planning AgentsUse ReAct/Chain-of-Thought to plan and execute steps.
Memory-EnabledPersist context across interactions. Useful for long-running tasks.
Multi-Agent SystemsTeams of agents with roles that collaborate or debate to solve problems.
Autonomous AgentsTrigger workflows on their own with minimal user input.

πŸ€– What is Agentic AI?

Agentic AI goes a step further by embedding intentionality, memory, identity, and autonomy into agents. These agents:

  • Exhibit goal-directed behavior

  • Maintain persistent memory and context

  • Can collaborate in teams or hierarchies

  • Adapt and learn over time

While a single AI Agent might complete a task, Agentic AI systems simulate human-like behavior across tasks and timeframes, making them ideal for multi-agent systems, simulations, and long-running autonomous workflows.


πŸ” AI Agents vs. Agentic AI: Key Differences

FeatureAI AgentAgentic AI
Task ExecutionShort-term or reactiveLong-term, goal-oriented
Planning DepthProcedural or basic planningStrategic, adaptive planning
MemoryStateless or ephemeralLong-term, persistent memory
IdentityGenericPersonalized agent profiles
CollaborationMinimalTeams of agents working in coordination
Example FrameworkLangChain, OpenAI ToolsAutoGen, CrewAI, Phidata

πŸ› οΈ Frameworks Overview & Practical Guide

1. 🧭 LangGraph

Framework for building multi-step agent workflows with conditional logic and memory.

πŸ” Description:

LangGraph extends LangChain to build stateful agent flows using graph structures (nodes + edges). Ideal for defining workflows like:

  • Document Q&A

  • ReAct-style agents

  • Tool-enhanced pipelines

βœ… Best for:

  • Branching logic

  • Agent state control

  • Workflow automation

πŸš€ Get Started:

bashCopyEditpip install langgraph langchain openai

πŸ§ͺ Example:

pythonCopyEditfrom langgraph.graph import StateGraph
from langchain.schema.runnable import RunnableLambda

def step_fn(state): return {"msg": "Hello from LangGraph"}
graph = StateGraph(dict)
graph.add_node("start", RunnableLambda(step_fn))
graph.set_entry_point("start")
app = graph.compile()
print(app.invoke({}))

2. πŸ“¦ Pydantic-AI

Framework for type-safe, schema-first LLM applications.

πŸ” Description:

Powered by pydantic, this framework defines LLM input/output as structured Python modelsβ€”making agent communication predictable and safe.

βœ… Best for:

  • Structured JSON outputs

  • Type-safe LLM interaction

  • Production API pipelines

πŸš€ Get Started:

bashCopyEditpip install pydantic-ai openai

πŸ§ͺ Example:

pythonCopyEditfrom pydantic_ai.assistant import AI
from pydantic import BaseModel

class Movie(BaseModel):
    title: str
    genre: str

response = AI.ask("Recommend a sci-fi movie", output_model=Movie)
print(response)

3. πŸ‘₯ CrewAI

Framework for simulating collaborative multi-agent teams with roles.

πŸ” Description:

CrewAI structures agents like a real-world team (e.g., PM, Researcher, Developer) working together. Agents can have goals, tools, and memory.

βœ… Best for:

  • Role-based collaboration

  • Report/plan generation

  • Human-in-the-loop teams

πŸš€ Get Started:

bashCopyEditpip install crewai

πŸ§ͺ Example:

pythonCopyEditfrom crewai import Agent, Task, Crew

dev = Agent(name="Dev", role="Code writer")
reviewer = Agent(name="QA", role="Reviewer")

task = Task(description="Write a Python script", agent=dev)
crew = Crew(agents=[dev, reviewer], tasks=[task])
result = crew.kickoff()
print(result)

4. πŸ”„ AutoGen (Microsoft)

Powerful framework for multi-agent conversational ecosystems.

πŸ” Description:

AutoGen allows agents to chat with each other, use tools, and even include humans in the loop. Message-based architecture is ideal for simulations and dialog planning.

βœ… Best for:

  • Research agents

  • Co-worker bots

  • Multi-turn reasoning

πŸš€ Get Started:

bashCopyEditpip install pyautogen

πŸ§ͺ Example:

pythonCopyEditfrom autogen import AssistantAgent, UserProxyAgent

assistant = AssistantAgent(name="Bot", llm_config={"model": "gpt-4"})
user = UserProxyAgent(name="User", human_input_mode="NEVER")
user.initiate_chat(assistant, message="What is RAG in AI?")

5. 🧩 Phidata

End-to-end platform for building full-stack agentic apps with LLMs, tools, memory, and UI.

πŸ” Description:

Phidata is a modular framework to create production-ready AI systems, including:

  • Memory-based agents

  • LangChain/OpenAI integrations

  • Gradio/UI support for dashboards

βœ… Best for:

  • Dashboard apps

  • RAG agents

  • Developer/enterprise use

πŸš€ Get Started:

bashCopyEditpip install phidata

πŸ§ͺ Example:

pythonCopyEditfrom phidata.agent.workflow import Workflow
from phidata.agent.task import PrintTask

wf = Workflow(name="demo", tasks=[PrintTask("Hello, Phidata!")])
wf.run()

πŸ”š Final Comparison

Feature/Use CaseLangGraphPydantic-AICrewAIAutoGenPhidata
Multi-step workflowsβœ…βŒβœ…βœ…βœ…
Typed input/outputβŒβœ…βŒβŒβœ…
Role-based collaborationβŒβŒβœ…βœ…βœ…
Tool execution & autonomyβœ…βŒβœ…βœ…βœ…
Full-stack apps + UIβŒβŒβŒβŒβœ…

✨ Final Thoughts

The future of AI isn’t just smarter modelsβ€”it's smarter agents. Whether you're building a collaborative team of AI agents or a dashboard-integrated RAG app, these frameworks give you the tools to bring intelligent agents to life.

Thank you for reading the article! 😊

0
Subscribe to my newsletter

Read articles from ANURAG KULE directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

ANURAG KULE
ANURAG KULE