AI Agents & Agentic Frameworks
Explore autonomous AI agents that can plan, reason, use tools, and execute multi-step tasks. Learn about AutoGen, CrewAI, LangGraph, and the agentic AI revolution.
What are AI Agents?
AI Agents are autonomous systems powered by large language models that can plan, reason, and take actions to accomplish complex goals. Unlike simple chatbots that respond to single prompts, agents can break down tasks, use external tools, observe results, and iterate until the objective is achieved.
The key difference is the action loop: an agent receives a goal → plans steps → executes actions (calling APIs, running code, searching the web) → observes outcomes → adjusts its plan → repeats until done.
🧠 Planning
Breaks complex tasks into sub-tasks and creates execution plans.
🔧 Tool Use
Calls external APIs, runs code, searches the web, reads files.
🔄 Reasoning Loop
Observes results, reflects on progress, and adjusts strategy.
💾 Memory
Maintains short-term and long-term memory across interactions.
Popular Agentic Frameworks
| Framework | Creator | Best For | Key Feature |
|---|---|---|---|
| LangGraph | LangChain | Stateful agent workflows | Graph-based orchestration |
| AutoGen | Microsoft | Multi-agent conversations | Agent-to-agent chat |
| CrewAI | CrewAI | Role-based agent teams | Crew collaboration |
| Semantic Kernel | Microsoft | Enterprise integration | .NET/Python/Java support |
| Smolagents | Hugging Face | Lightweight agents | Code-based tool calling |
Code Example — ReAct Agent with LangGraph
# pip install langgraph langchain-openai
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
from langchain_core.tools import tool
@tool
def search_web(query: str) -> str:
"""Search the web for information."""
# In production, call a real search API
return f"Search results for: {query}"
@tool
def calculator(expression: str) -> str:
"""Evaluate a math expression."""
return str(eval(expression))
# Create agent with tools
llm = ChatOpenAI(model="gpt-4o")
agent = create_react_agent(llm, tools=[search_web, calculator])
# Run the agent
result = agent.invoke({
"messages": [{"role": "user", "content": "What is the GDP of India and what is it divided by the population?"}]
})
print(result["messages"][-1].content)Agent Design Patterns
ReAct (Reason + Act)
The agent thinks step-by-step, decides on an action, observes the result, and repeats. Most common pattern.
Plan-and-Execute
First creates a full plan, then executes each step. Better for complex multi-step tasks.
Multi-Agent
Multiple specialized agents collaborate — e.g., a researcher, coder, and reviewer working together.
Reflection
The agent reviews its own output and iteratively improves it before returning the final result.
Real-World AI Agent Products
- Claude Code (Anthropic): Terminal-based coding agent that reads, writes, and debugs code autonomously.
- GitHub Copilot Agent: Autonomous coding agent that handles entire issues and pull requests.
- Google Jules: AI coding agent integrated into the Google ecosystem for automated development.
- OpenAI Operator: Web-browsing agent that can complete tasks like booking, shopping, and form-filling.
- Devin (Cognition): First "AI software engineer" that can plan, code, debug, and deploy applications.