Haystack, Pydantic AI, smolagents and Strands Agents are four open source Python libraries for building AI agents that run inside your own code, without a hosted control plane, and teams choosing between them need the same facts for each. They come from deepset, Pydantic, Hugging Face and Amazon Web Services respectively, and each takes a different starting point: pipelines, typed agents, code-writing agents and a model-driven agent loop. This page sets the four side by side on identical fields: owner, licence, Python requirement, current version, model support, tools and MCP, multi-agent patterns, code execution, observability and commercial add-ons. It is written for developers and architects shortlisting a framework and for the people who approve open source dependencies. Every fact comes from each project's own repository, documentation or release page. Frameworks are listed alphabetically; order is never a ranking. Last checked: 2026-11-15.
This is an independent reference page from NHI Mgmt Group based on public provider documentation; it is not sponsored or endorsed by any provider.
Key takeaways
- All four are permissively licensed. Haystack, smolagents and Strands Agents use Apache-2.0; Pydantic AI uses MIT.
- Python floors differ. Haystack and Pydantic AI require Python 3.11 or later; smolagents and Strands Agents require 3.10 or later.
- Each starts from a different core idea. Haystack builds on pipelines and components, Pydantic AI on a typed agent loop, smolagents on agents that write their actions as Python code, and Strands Agents on a model-driven loop with an assembled harness.
- All four connect to MCP servers. Each documents an MCP client path, and Haystack and Strands Agents also document ways to expose agents or knowledge as MCP servers.
- Support policies differ. Each project publishes its own version or security policy (major-version timelines, supported lines, backports), so pinning and upgrade planning matter as much as features.
What counts as a lightweight Python agent framework?
On this page the term means an open source Python library that you import into your own application to run an agent loop: the model call, tool execution, state and stopping rules. The library runs in your process and you choose where to host it. That separates these four from managed agent platforms, where the provider runs the agent for you, and from heavier stacks that bundle hosting and graph runtimes. The Agent Frameworks vs Managed Agent Platforms guide explains that split, and the AI Agent Frameworks and Platforms Hub (2026) lists the wider field.
How each project describes itself, in its own words:
- Haystack: "an open-source AI orchestration framework for building production-ready LLM applications in Python", with "modular pipelines and agent workflows with explicit control over retrieval, routing, memory, and generation".
- Pydantic AI: "the Python AI SDK: a typed, extensible agent loop with every model a string swap away".
- smolagents: "a library that enables you to run powerful agents in a few lines of code", whose agent logic "fits in ~1,000 lines of code".
- Strands Agents: "an open-source SDK for building and running AI agents in Python and TypeScript" for teams that "would otherwise write your own agent loop", running "in your process with no hosted control plane".
Key facts side by side
As of 15 November 2026, from each project's repository (README, LICENSE, pyproject) and release page.
| Field | Haystack | Pydantic AI | smolagents | Strands Agents |
|---|---|---|---|---|
| Maintainer | deepset | Pydantic Services Inc. | Hugging Face | Amazon Web Services |
| Repository | deepset-ai/haystack | pydantic/pydantic-ai | huggingface/smolagents | strands-agents/harness-sdk (monorepo, strands-py/) |
| PyPI package | haystack-ai | pydantic-ai (and pydantic-ai-slim) | smolagents | strands-agents (SDK); strands-harness (harness) |
| Licence | Apache-2.0 | MIT | Apache-2.0 | Apache-2.0 |
| Python requirement | 3.11 or later | 3.11 or later | 3.10 or later | 3.10 or later |
| Other languages | Python only | Python only | Python only | TypeScript SDK and harness in the same monorepo |
| Latest release seen | v3.4.1, 21 October 2026 (marked Latest on GitHub); docs carry a 3.5 version and main branch reads 3.6.0-rc0 | v2.67.0, 10 November 2026 | v1.26.0 (marked Latest on GitHub); main branch reads 1.27.0.dev0 | 1.x line, which SECURITY.md lists as the supported version |
| Core abstraction | Pipeline of components; Agent component | Agent with typed output_type and capabilities | CodeAgent and ToolCallingAgent | Agent; create_harness() |
| Price | Free and open source | Free and open source | Free and open source | Free and open source |
Models and providers
None of the four ships a model. Each connects to providers through its own classes or prefixes. As of 15 November 2026:
| Field | Haystack | Pydantic AI | smolagents | Strands Agents |
|---|---|---|---|---|
| How a model is chosen | A chat generator component, such as OpenAIChatGenerator, passed as chat_generator | A string in the form <provider>:<model> | A model class, such as InferenceClientModel, LiteLLMModel, OpenAIModel or TransformersModel | A model class, such as BedrockModel, GeminiModel or OllamaModel |
| Providers named in the docs | OpenAI, Mistral, Anthropic, Cohere, Hugging Face, Google, Azure OpenAI, AWS Bedrock, local models "and many others" | A directory covering model developers, cloud platforms (Bedrock, Vertex AI, Azure, Snowflake and others), inference platforms and gateways | Hugging Face Inference Providers, local Transformers and Ollama models, and other APIs through LiteLLM | Built-in Python providers including Amazon Bedrock, Anthropic, Cohere, Google, LiteLLM, llama.cpp, Mistral, Ollama, OpenAI, SageMaker and Writer, plus community providers |
| Default provider | Set by the component you choose | Set by the model string you choose | InferenceClientModel() uses a default model when none is given | Amazon Bedrock |
| Self-hosted models | Local models via integrations | Ollama, vLLM and any endpoint through OpenAICompatibleProvider | TransformersModel, Ollama, OpenAI-compatible servers via api_base | Ollama, llama.cpp; vLLM and SGLang as community providers |
| Failover | Swap components without rewriting the system (README) | ModelFallback capability and FallbackModel | Switch model class | Swap provider class |
The Strands README notes that the default Bedrock provider needs AWS credentials and model access enabled in the chosen region.
Agents, tools and multi-agent patterns
Haystack
The Agent component takes a chat_generator, tools, a system_prompt and a state_schema whose typed keys tools share and that come back in the result alongside messages and last_message. Tools can wrap pipeline components with ComponentTool. The README lists lifecycle hooks (before_llm, before_tool, on_exit), counters for step_count and token_usage, concurrent tool calls, SkillToolset for progressive skill discovery and ready-made agents in Agent Pack. Multi-step and multi-agent designs are built as pipelines with loops, branches and conditional routing.
Pydantic AI
An Agent is defined with a model string and an output_type, so every run returns a validated, typed result. Tools are functions registered with @agent.tool that receive a RunContext carrying dependencies; arguments are validated before your code runs. The Pydantic AI Harness adds capabilities such as memory, guardrails, sub-agents, planning, context compaction and a complete coding agent (Coder). Pydantic Graph, a separate package, gives typed control flow when one agent loop is not enough, and durable execution is available through Temporal, DBOS and Prefect extras.
smolagents
CodeAgent writes its actions as Python code, so tool calls become Python function calls with loops and conditionals; ToolCallingAgent uses standard JSON or text tool calling. Tools can come from an MCP server (ToolCollection.from_mcp), from LangChain (Tool.from_langchain) or from a Hugging Face Space (Tool.from_space), and agents and tools can be pushed to and pulled from the Hub. The README states that multi-agent hierarchies are supported, and the documentation includes a multi-agent orchestration example.
Strands Agents
An Agent takes tools defined with the @tool decorator, and load_tools_from_directory=True watches a ./tools/ directory and reloads tools as files change. The README lists lifecycle controls (turn limits, token budgets, cancellation, stop reasons), structured output, multi-agent patterns, memory and sessions, streaming, guardrails, hooks that intercept any step, and steering handlers. The harness package, started with create_harness(), assembles model, tools, memory, sessions and context management with preset defaults.
| Field | Haystack | Pydantic AI | smolagents | Strands Agents |
|---|---|---|---|---|
| Tool definition | Tool objects; ComponentTool wraps components | @agent.tool with RunContext | Tool classes and functions | @tool decorator |
| Structured output | Typed state_schema keys | output_type (Pydantic models) | Python return values from code actions | Structured output (README) |
| MCP client | MCPTool, MCPToolset | mcp extra | ToolCollection.from_mcp | MCPClient; works with mcp 1.x and 2.x |
| Expose as a server | Hayhooks: REST, MCP and OpenAI-compatible endpoints | Web, CLI and AG-UI interfaces (ui, ag-ui, web, cli extras) | Push to the Hugging Face Hub as a Space | a2a extra; separate MCP server for coding agents |
| Async | One Pipeline runs sync or async | run() and run_sync() | run(), with stream_outputs=True for streaming | Streaming built in |
Code execution and sandboxing
Agents that run model-written code or shell commands need an execution boundary. Each project documents its own options:
- Haystack: agents act through tools and pipeline components that you supply; the Agent page describes intercepting tool calls for human review before they run, with details on the Human in the Loop page.
- Pydantic AI: the Harness offers workspace-rooted file access and an allowlisted shell, and Pydantic publishes Monty, a separate open source sandboxed Python interpreter for model-written code.
- smolagents: code can run in sandboxed environments via Blaxel, E2B, Modal or Docker. The README states that the built-in
LocalPythonExecutor"is not a security sandbox" and must not be used to run untrusted code. - Strands Agents: the organisation publishes separate Box and Shell projects alongside the SDK, and the README lists guardrails that "catch mistakes before they run".
The AI Agent Sandboxing and Code Execution Guide covers how to choose an isolation boundary for any of them.
Observability and telemetry
| Field | Haystack | Pydantic AI | smolagents | Strands Agents |
|---|---|---|---|---|
| Tracing standard | Pipelines and agents described as "transparent and traceable" | OpenTelemetry instrumentation; works with any OTel backend | OpenTelemetry through the OpenInference SmolagentsInstrumentor | Observability APIs built into the SDK; docs recommend OpenTelemetry |
| Install | Core package | logfire extra for Pydantic Logfire | telemetry extra | otel extra |
| Default behaviour | Anonymous usage statistics on component initialisation; opt out with HAYSTACK_TELEMETRY_ENABLED=False | Plain OpenTelemetry instrumentation, per the README | Opt-in: tracing starts when you run the instrumentor | The README says the agent loop "traces every decision by default" |
| Backends named | Not stated on the telemetry page | Pydantic Logfire or any OTel backend | Arize Phoenix, Langfuse, MLflow | OpenTelemetry collectors |
Haystack's telemetry page says events carry an anonymous ID, environment details and, for pipelines with an Agent, the chat generator type, model and tool names, and exclude IP addresses, hostnames, file paths, queries and document contents. For what span attributes mean, see OpenTelemetry GenAI Semantic Conventions for Security Teams.
Commercial products around each framework
The libraries are free. Each maintainer also describes paid or hosted products, listed here as each project describes them; prices are not stated on the pages checked.
- Haystack: Haystack Enterprise Starter (support, templates and deployment guides) and Haystack Enterprise Platform, offered as a managed cloud service or self-hosted, with a free trial.
- Pydantic AI: Pydantic Logfire, described as an AI engineering platform, and the Pydantic AI Gateway, "one key for every model with real-time cost monitoring and budget control".
- smolagents: Hugging Face Inference Providers, reached through
InferenceClientModel, and Hub hosting for shared agents and tools. - Strands Agents: the README states the SDK runs "in your process with no hosted control plane"; Amazon Bedrock is the default model provider.
Versions and support policy
- Haystack: the 3.x line, with release candidates before each minor release (3.2.0 on 24 September, 3.3.0 on 1 October, 3.4.0 on 15 October and 3.4.1 on 21 October 2026, as shown on GitHub). Nightly pre-releases install with
pip install --pre haystack-ai. - Pydantic AI: V1 was released in September 2025 and V2.0 became stable on 23 June 2026. The version policy says Pydantic "will not intentionally make breaking changes in minor releases", that V1 receives security fixes for at least six months after V2's stable release, and that the next major version will not ship sooner than three months after V2.0. A V1 maintenance release (v1.107.10) appeared on 4 November 2026.
- smolagents: the 1.x line; the security policy states that fixes ship in the latest release and are not backported to older releases.
- Strands Agents: SECURITY.md lists 1.x.x as supported and versions below 1.0 as unsupported. Python SDK versions are set from git tags.
How to choose: factual criteria
These criteria come from the documented differences above. They describe fit, not quality.
| If your requirement is | Check this in each framework |
|---|---|
| Python 3.10 support | smolagents and Strands Agents state 3.10 or later; Haystack and Pydantic AI state 3.11 or later |
| A TypeScript version of the same framework | Strands Agents publishes Python and TypeScript SDKs; Haystack, Pydantic AI and smolagents are Python libraries |
| Retrieval-heavy pipelines | Haystack's pipeline and component model; the other three connect retrieval through tools |
| Typed, validated outputs | Pydantic AI's output_type; equivalent patterns in each framework's structured output docs |
| Agents that act by writing code | smolagents' CodeAgent and its sandbox executors |
| A preset harness to start from | Pydantic AI Harness (Coder), Strands harness (create_harness()), Haystack Agent Pack |
| Licence compatibility | MIT (Pydantic AI) or Apache-2.0 (Haystack, smolagents, Strands Agents); check against your open source policy |
| Upgrade stability | Each project's version policy and release cadence; pin versions in all cases |
For a TypeScript shortlist, see TypeScript Agent Frameworks Compared; for a multi-agent framework with its own history, see What Is AG2? The Community Fork of AutoGen; for managed options, see AI Agent Platforms Compared.
Security guidance
This page compares what the frameworks are. Framework-specific hardening is covered in the Pydantic AI Security Guide and the AWS Strands Agents SDK Security Guide, and the discipline as a whole in the Securing Agent Frameworks Guide. The common customer-side controls are the same for all four: give each agent only the tools and credentials it needs, keep provider keys out of code, run model-written code and shell commands in an isolated environment rather than the host, require human approval for irreversible actions, filter the tools exposed from each MCP server (see the MCP Security Guide), decide deliberately what trace content reaches your observability backend, and apply each project's security updates promptly.
Practitioner checklist
- Confirm the Python version in your runtime against each framework's floor (3.11 for Haystack and Pydantic AI, 3.10 for smolagents and Strands Agents).
- Record the licence (Apache-2.0 or MIT) in your open source register before adoption.
- Pin exact versions in lock files and read release notes before each upgrade.
- Decide on the code execution boundary before enabling any code or shell tool, and never treat a local executor as a sandbox.
- Set telemetry deliberately: opt out of Haystack usage statistics where policy requires, and configure tracing exporters and content capture for the others.
- Filter MCP tools per server and review each server as a dependency.
- Check the default model provider (Bedrock for Strands Agents, Hugging Face inference for smolagents' default model) so traffic goes where you expect.
- Map each framework's support policy (backports, major version timelines) to your patching cycle.
Standards and references
- deepset: Haystack repository and README
- deepset: Haystack telemetry
- Pydantic: Pydantic AI repository and README
- Pydantic: Pydantic AI version policy
- Hugging Face: smolagents repository, README and security policy
- Hugging Face: Inspecting runs with OpenTelemetry
- Strands Agents: harness-sdk repository and README
- Strands Agents: Model providers
Related NHI Mgmt Group resources: AI Agent Frameworks and Platforms Hub (2026) · AI Agent Platforms Compared · Securing Agent Frameworks Guide · Agent Frameworks vs Managed Agent Platforms