Understanding AI Agents and AI Agents Frameworks.


π 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"
User Input: "Plan my Goa trip"
Agent decides to:
Use a sub-agent for research
Call weather + flight APIs
Store preferences in memory
Tools Used:
API Call β Flight prices
Internet β Hotel ratings
Code Tool β Trip cost calculator
Sub-agents collaborate to finalize the plan.
Agent executes bookings, generates PDF, and sends it.
User approves the plan or modifies it manually.
π§± Types of AI Agents
Type | Description |
Reactive Agents | Respond to prompts without memory or long-term planning. |
Tool-Using Agents | Can call tools (e.g., search, calculator, APIs) to complete tasks. |
Planning Agents | Use ReAct/Chain-of-Thought to plan and execute steps. |
Memory-Enabled | Persist context across interactions. Useful for long-running tasks. |
Multi-Agent Systems | Teams of agents with roles that collaborate or debate to solve problems. |
Autonomous Agents | Trigger 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
Feature | AI Agent | Agentic AI |
Task Execution | Short-term or reactive | Long-term, goal-oriented |
Planning Depth | Procedural or basic planning | Strategic, adaptive planning |
Memory | Stateless or ephemeral | Long-term, persistent memory |
Identity | Generic | Personalized agent profiles |
Collaboration | Minimal | Teams of agents working in coordination |
Example Framework | LangChain, OpenAI Tools | AutoGen, 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 Case | LangGraph | Pydantic-AI | CrewAI | AutoGen | Phidata |
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! π
Subscribe to my newsletter
Read articles from ANURAG KULE directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
