Python and TypeScript Agent Frameworks

Profiles of the main Python and TypeScript agent frameworks — LangGraph and LangChain (create_agent, Deep Agents), OpenAI Agents SDK, Claude Agent SDK, Google ADK, Microsoft Agent Framework, CrewAI, LlamaIndex, Pydantic AI, AWS Strands, smolagents, Mastra and the Vercel AI SDK — with minimal code, strengths and trade-offs.

On this page

How to read this page#

Each profile answers the same questions: what is the core idea, what does minimal code look like, what is it good at, and what should you watch out for. Code is deliberately minimal and uses a placeholder MODEL; check each project’s documentation for current model identifiers and options.

LangGraph and LangChain#

Core idea. Three layers from the same team: LangChain is the framework (models, tools, create_agent with middleware), LangGraph is the runtime (state graphs with durable checkpoints, interrupts and streaming), and Deep Agents is a batteries-included harness on top (planning, file system, sub-agents, skills, context management).

LangChain, LangGraph and Deep Agents
flowchart TB
    DA["Deep Agents — harness<br/>sub-agents, file system, skills"] --> CA["LangChain create_agent<br/>agent + middleware"]
    CA --> LG["LangGraph runtime<br/>state graph, checkpoints, interrupts"]
    CUSTOM["Your custom graphs<br/>deterministic + agentic steps"] --> LG

Quick agent with create_agent:

from langchain.agents import create_agent

def get_order(order_id: str) -> str:
    """Return status of a customer's order, e.g. A-10293."""
    return orders_api.status(order_id)

agent = create_agent(model=MODEL, tools=[get_order],
                     system_prompt="You are a concise support agent.")
agent.invoke({"messages": [{"role": "user", "content": "Where is A-10293?"}]})

Explicit control with a LangGraph state graph:

from typing import TypedDict
from langgraph.graph import StateGraph, START, END
from langgraph.checkpoint.memory import InMemorySaver

class Claim(TypedDict):
    text: str
    category: str
    decision: str

def classify(s: Claim): return {"category": llm_classify(s["text"])}
def auto_settle(s: Claim): return {"decision": "settled"}
def to_adjuster(s: Claim): return {"decision": "queued for adjuster"}

g = StateGraph(Claim)
g.add_node("classify", classify)
g.add_node("auto_settle", auto_settle)
g.add_node("to_adjuster", to_adjuster)
g.add_edge(START, "classify")
g.add_conditional_edges("classify",
    lambda s: "auto_settle" if s["category"] == "simple" else "to_adjuster")
g.add_edge("auto_settle", END)
g.add_edge("to_adjuster", END)

app = g.compile(checkpointer=InMemorySaver())   # use a Postgres checkpointer in production
app.invoke({"text": claim_text}, config={"configurable": {"thread_id": "claim-881"}})
  • Good at: precise control flow, durable execution, human interrupts (interrupt()), streaming, time-travel debugging; huge integration ecosystem; LangSmith tracing.
  • Watch out: more concepts to learn; keep graphs small and readable; pin versions.

OpenAI Agents SDK#

Core idea. A small set of primitives: Agents (instructions + tools), handoffs (transfer to another agent), guardrails (input/output checks running in parallel), sessions (conversation memory) and built-in tracing. Uses the Responses API by default.

from agents import Agent, Runner, function_tool

@function_tool
def get_order(order_id: str) -> str:
    """Look up an order's status."""
    return orders_api.status(order_id)

billing = Agent(name="Billing", instructions="Handle refunds and invoices.", tools=[get_order])
triage  = Agent(name="Triage", instructions="Route the customer to the right specialist.",
                handoffs=[billing])

result = Runner.run_sync(triage, "I was charged twice for A-10293")
print(result.final_output)
  • Good at: minimal abstractions, clean handoff-based multi-agent apps, tracing on by default, voice/realtime agents.
  • Watch out: best experience with OpenAI models; for complex durable workflows add your own state or a workflow engine.

Claude Agent SDK#

Core idea. The agent harness behind Claude Code, available as a library: automatic context management and compaction, built-in tools (files, shell, web), sub-agents, hooks around tool calls, permission modes, MCP servers and Agent Skills (folders with a SKILL.md loaded on demand).

from claude_agent_sdk import query, ClaudeAgentOptions

options = ClaudeAgentOptions(
    system_prompt="You are an SRE agent. Investigate, then propose a fix; never deploy.",
    allowed_tools=["Read", "Grep", "Bash"],          # least privilege
    mcp_servers={"metrics": metrics_server_config},   # company MCP server
)

async for message in query(prompt="Why did checkout latency spike at 14:05?", options=options):
    print(message)
  • Good at: long-running, open-ended tasks (coding, research, operations) where a capable harness matters more than custom control flow; strong permission and hook model.
  • Watch out: opinionated harness centred on Claude models; give it a sandbox and narrow permissions. See agent harnesses.

Google Agent Development Kit (ADK)#

Core idea. LLM agents with tools plus deterministic workflow agents — SequentialAgent, ParallelAgent, LoopAgent — composed into hierarchies. Native A2A support; deploy locally, on Cloud Run or on Vertex AI Agent Engine. Available in Python, Java, Go and TypeScript.

from google.adk.agents import Agent, SequentialAgent

def get_policy(topic: str) -> dict:
    """Return the relevant policy text."""
    return policy_store.lookup(topic)

researcher = Agent(name="researcher", model=MODEL,
                   instruction="Find the policy that applies.", tools=[get_policy])
writer = Agent(name="writer", model=MODEL,
               instruction="Write a short answer citing the policy.")

pipeline = SequentialAgent(name="policy_answer", sub_agents=[researcher, writer])
  • Good at: mixing deterministic workflow agents with LLM agents; A2A; Google Cloud deployment and evaluation tooling; Java support.
  • Watch out: most value on Google Cloud and Gemini, although other models are supported.

Microsoft Agent Framework#

Core idea. The unified successor to AutoGen (multi-agent patterns such as group chat, handoff and Magentic-One) and Semantic Kernel (enterprise connectors, plugins, telemetry), released as 1.0 for .NET and Python in April 2026. Two building blocks: agents and graph-based workflows with checkpointing and human-in-the-loop; MCP and A2A support; integrates with Azure AI Foundry.

  • Good at: .NET estates, Azure integration, enterprise telemetry, multi-agent orchestration patterns, typed workflows.
  • Watch out: AutoGen and Semantic Kernel are in maintenance mode — plan migrations using Microsoft’s guides; start new work on Agent Framework.

CrewAI#

Core idea. Agents defined by role, goal and backstory, given tasks, assembled into a crew that runs sequentially or hierarchically (with a manager agent). Flows add event-driven, deterministic orchestration around crews.

from crewai import Agent, Task, Crew, Process

analyst = Agent(role="Credit analyst", goal="Assess SME loan applications",
                backstory="Ten years in SME lending.", tools=[financials_tool])
writer = Agent(role="Credit memo writer", goal="Write clear credit memos",
               backstory="Writes for the credit committee.")

assess = Task(description="Assess application {app_id}", expected_output="Risk summary",
              agent=analyst)
memo = Task(description="Write the credit memo", expected_output="One-page memo", agent=writer)

Crew(agents=[analyst, writer], tasks=[assess, memo], process=Process.sequential) \
    .kickoff(inputs={"app_id": "SME-2291"})
  • Good at: fast prototyping of role-based multi-agent teams; readable configuration.
  • Watch out: less fine-grained control; multi-agent token cost; benchmark latency for your workload.

LlamaIndex#

Core idea. The leading data/RAG framework, with event-driven Workflows and agents on top — strongest when the agent’s main job is reasoning over documents and data sources (LlamaParse, connectors, indexes).

  • Good at: document-heavy agents, agentic RAG, data connectors.
  • Watch out: pick it for its data strengths; general orchestration is equally good elsewhere.

Pydantic AI#

Core idea. “FastAPI for agents”: type-safe agents with validated structured outputs, dependency injection for tools, and easy testing.

from pydantic import BaseModel
from pydantic_ai import Agent

class Triage(BaseModel):
    category: str
    urgent: bool

agent = Agent(MODEL, output_type=Triage,
              instructions="Classify the customer email into billing, tech or sales.")
result = agent.run_sync(email_text)
print(result.output.category, result.output.urgent)
  • Good at: typed, testable Python services; strict output contracts; model-agnostic.
  • Watch out: lighter multi-agent features; pair with a workflow engine for complex flows.

AWS Strands Agents#

Core idea. A model-driven agent loop: give the model a prompt and tools and let it plan; simple code, with hooks that integrate with Amazon Bedrock AgentCore for runtime, memory, identity and observability.

from strands import Agent, tool

@tool
def get_order(order_id: str) -> str:
    """Return an order's status."""
    return orders_api.status(order_id)

agent = Agent(tools=[get_order], system_prompt="You are a support agent.")
agent("Where is my order A-10293?")
  • Good at: AWS-centric teams; quick path to AgentCore.
  • Watch out: ecosystem weighted toward AWS.

smolagents (Hugging Face)#

Core idea. Minimal code agents: the model writes small Python snippets as its actions instead of JSON tool calls, which can be more compact and expressive.

  • Good at: research, open-weight models, learning how agents work.
  • Watch out: generated code must run in a sandbox.

TypeScript options#

Framework Notes
LangGraph.js / LangChain.js Same concepts as Python
OpenAI Agents SDK (JS) Agents, handoffs, guardrails in TypeScript
Claude Agent SDK (TS) Same harness as Python
Google ADK (TS) ADK for Node.js
Mastra TypeScript-native agents, workflows, memory, evals
Vercel AI SDK Model calls, tool calling, streaming UI; agent loops in Next.js apps

Side-by-side: the same pattern#

Pattern LangGraph OpenAI Agents SDK Google ADK CrewAI Claude Agent SDK
Single tool-using agent create_agent Agent + function_tool Agent(tools=…) Agent + Task query() with tools
Routing / handoff Conditional edges handoffs=[…] Sub-agents, transfer Hierarchical process Sub-agents
Deterministic sequence Edges Code around Runner SequentialAgent Sequential process / Flows Hooks, skills
Parallel work Fan-out edges asyncio ParallelAgent Async tasks Parallel sub-agents
Human approval interrupt() Guardrails / custom Callbacks / tool confirmation human_input Permission modes, hooks
Durable state Checkpointers Sessions Session services Flow state Session resume

Common mistakes#

Review questions#

How do LangChain, LangGraph and Deep Agents relate? LangChain is the framework with create_agent and middleware; LangGraph is the runtime underneath with state graphs, checkpoints and interrupts; Deep Agents is a batteries-included harness built on create_agent with sub-agents, a file system and skills.

What are the primitives of the OpenAI Agents SDK? Agents, tools, handoffs, guardrails, sessions and tracing.

What distinguishes the Claude Agent SDK? It packages a full agent harness — context management, built-in tools, sub-agents, hooks, permissions, MCP and Agent Skills — rather than low-level building blocks.

What are ADK workflow agents? SequentialAgent, ParallelAgent and LoopAgent: deterministic orchestrators that run sub-agents in a fixed structure without the model deciding the order.

What happened to AutoGen and Semantic Kernel? Microsoft merged them into Microsoft Agent Framework (1.0 in April 2026); both predecessors are in maintenance mode.

When is CrewAI a good choice? For quickly prototyping role-based multi-agent teams where readability matters more than low-level control.

Summary#

  • LangGraph for explicit, durable control; create_agent/Deep Agents for speed.
  • OpenAI Agents SDK, Google ADK, Microsoft Agent Framework and Strands align with their ecosystems.
  • Claude Agent SDK and Deep Agents are harnesses for long-running autonomous work.
  • CrewAI for role-based teams, LlamaIndex for data-heavy agents, Pydantic AI for typed services.

References#