Python AI agent libraries

Updated Nov 2026

Python AI agent libraries run a language model in a loop that calls tools, reads the results, and decides the next step. A framework manages the conversation state, tool definitions, and handoffs between agents across each run. These libraries let developers build agents that research, write code, and operate software for a user.

Popularity

LangChain has the most monthly downloads in this comparison, at 157.1M.

LibraryMonthly downloadsStarsLast releaseLicense
LangChain
157.1M
149.9KNov 2026MIT
LangGraph
58.7M
45.0KNov 2026MIT
Strands Agents
38.6M
9.2KNov 2026Apache-2.0
Pydantic AI Slim
36.8M
21.2KNov 2026MIT
OpenAI Agents SDK
20.2M
30.8KNov 2026MIT
google-adk
11.0M
22.3KNov 2026Apache-2.0
Browser Use
7.3M
121.5KNov 2026MIT
DSPy
5.9M
39.1KNov 2026MIT
Downloads: PyPI, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Builds LLM applications from composable components.

Downloads / mo
157.1M
Stars
149.9K
Last release
1.5.2
License
MIT

Quickstart

From README.md
$ python -m pip install langchain langchain-openai
from langchain.agents import create_agent
agent = create_agent(model='openai:gpt-6.1-sol', tools=[])
result = agent.invoke({'messages': [{'role': 'user', 'content': 'Hello'}]})
print(result['messages'][-1].content)

LangChain examples

From open-source projects on GitHub

Orchestrates long-running agents through stateful graphs and a runtime.

Downloads / mo
58.7M
Stars
45.0K
Last release
1.2.22
License
MIT

Strengths

  • Retains graph state in checkpoints. Use a checkpointer to retain thread-scoped state across graph runs.
  • Pauses for application approval. Interrupt graph execution and resume it with an application-supplied response.

Limitations

  • Persistence needs a checkpointer. Configure a checkpointer before relying on retained thread state.
  • Resuming restarts the interrupted node. Keep code before an interrupt safe to repeat.

Quickstart

From graph-api.md
$ python -m pip install langgraph
from typing_extensions import TypedDict
from langgraph.graph import END, START, StateGraph

class State(TypedDict):
    text: str

def node_a(state: State):
    return {'text': state['text'] + 'a'}

graph = (StateGraph(State)
    .add_node('node_a', node_a)
    .add_edge(START, 'node_a')
    .add_edge('node_a', END)
    .compile())
print(graph.invoke({'text': ''}))

LangGraph examples

From open-source projects on GitHub

Builds AI agents with a model-driven approach.

Downloads / mo
38.6M
Stars
9.2K
Last release
1.65.0
License
Apache-2.0

Quickstart

From README.md
$ python -m pip install strands-agents
from strands import Agent
agent = Agent()
print(agent('Hello'))

Strands Agents examples

From open-source projects on GitHub

Pydantic AI Slim

Provides the slim package of the Pydantic AI agent framework.

Downloads / mo
36.8M
Stars
21.2K
Last release
2.69.0
License
MIT

Quickstart

From README.md
$ python -m pip install "pydantic-ai-slim[openai]"
from pydantic_ai import Agent
agent = Agent('openai:gpt-5.2')
result = agent.run_sync('What is the capital of France?')
print(result.output)

Pydantic AI Slim examples

From open-source projects on GitHub

OpenAI Agents SDK

Provides the OpenAI SDK for building agents.

Downloads / mo
20.2M
Stars
30.8K
Last release
0.25.0
License
MIT

Quickstart

From README.md
$ python -m pip install openai-agents
from agents import Agent, Runner
agent = Agent(name='Assistant', instructions='You are a helpful assistant')
result = Runner.run_sync(agent, 'Write a haiku about recursion in programming.')
print(result.final_output)

OpenAI Agents SDK examples

From open-source projects on GitHub

Provides the Google Agent Development Kit.

Downloads / mo
11.0M
Stars
22.3K
Last release
2.14.1
License
Apache-2.0

Quickstart

From runners.py
$ python -m pip install google-adk
import asyncio
from google.adk import Agent
from google.adk.runners import InMemoryRunner
agent = Agent(name='greeting_agent', model='gemini-3.5-flash', instruction='Greet the user warmly.')
runner = InMemoryRunner(agent=agent)
asyncio.run(runner.run_debug('Hello'))

google-adk examples

From open-source projects on GitHub

Browser Use

Runs a browser agent on Pydantic AI against cloud or local Chrome.

Downloads / mo
7.3M
Stars
121.5K
Last release
1.0.6
License
MIT

Quickstart

From README.md
$ python -m pip install browser-use==1.0.6
from browser_use import Agent
result = Agent('Find the number of stars of the browser-use repo').run_sync()
print(result.final_result())

Programs language models with code rather than prompts.

Downloads / mo
5.9M
Stars
39.1K
Last release
3.5.0
License
MIT

Quickstart

From mcp.md
$ python -m pip install dspy
import dspy
dspy.configure(lm=dspy.LM('openai/gpt-4.1-mini'))
agent = dspy.ReAct('question -> answer', tools=[])
result = agent(question='What is the capital of France?')
print(result.answer)

FAQ

LangGraph suits long-running agents that need explicit state and control flow. OpenAI Agents SDK and Pydantic AI Slim suit smaller agents with typed tools and handoffs. Browser Use suits agents that operate a web browser.

LangGraph orchestrates long-running agents as stateful graphs of steps. Its runtime persists state between steps, letting a run pause for human input and resume.

LangChain is a framework for building LLM applications from composable parts such as models, prompts, tools, and retrievers. Its agents run on LangGraph.

LangChain provides model integrations and a high-level agent API. LangGraph is the lower-level runtime for agents that need custom control flow and durable state.

DSPy is a framework for programming language models with declarative modules instead of hand-written prompts. Its optimizers tune prompts and weights against a metric.

google-adk is the Agent Development Kit, an open-source Google framework for building and deploying agents. It works with Gemini and other models.

For coding agents

Found your AI agent library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official