any-agent: Mozilla’s Python Library to Run AI Agents Anywhere
Sick of Rewriting Agents Just to Try a New Framework?
Imagine spending days writing a smart assistant in LangChain—only to realize you want to benchmark it on CrewAI. Suddenly, you’re rewriting everything: the agent logic, the tool integrations, even the tracing format. Again.
This is the current state of AI agent development: every framework is its own silo. And whether you're a researcher comparing performance, or a startup trying to scale something fast, framework switching is painful.
That’s where any-agent comes in. Created by Mozilla.ai, this Python library gives you one common interface to build AI agents and then deploy them to whichever agent framework you like—LangChain, CrewAI, Smolagents, and more—without touching your core logic.
It's the bridge between reusability and framework flexibility—and it saves you a mountain of redundant code.
What Is any-agent?
any-agent is an open-source Python library built by Mozilla’s applied-AI division, Mozilla.ai. Officially released on April 10, 2025, it’s licensed under Apache-2.0, making it free to use, modify, and extend.
The library introduces a single, abstract interface that allows you to define agents in a consistent way, regardless of the underlying backend. You do this using just two components:
- AnyAgent: the runtime adapter that delegates work to the chosen framework
- AgentConfig: a configuration object for models, tools, and instructions
Once you define your agent using this pattern, you can run it on any of the seven supported frameworks by simply passing a different string to `AnyAgent.create()`—no logic refactoring required.
It’s like a plug-and-play system for AI agents: define your task once, then rotate frameworks at will.
Why Fragmentation in Agent Frameworks Is a Problem
Let’s look at the current landscape of agent frameworks. LangChain, CrewAI, Smolagents, OpenAI SDK, and others have emerged rapidly—each with its own philosophy, API structure, and tooling integrations.
While choice is great, the lack of standardization leads to several issues:
- Redundant coding: Want to switch from LangChain to Smolagents? Rewrite your entire agent pipeline.
- Inconsistent evaluation: Each framework has different logging and output formatting, making A/B testing unreliable.
- Debugging nightmares: Without uniform tracing, debugging across platforms requires custom wrappers and hacks.
- Vendor lock-in: Once you go deep into a framework, switching feels prohibitively expensive.
any-agent flips this model. It gives developers a decoupled architecture that keeps agent logic clean and portable.
Core Identity of any-agent
Here’s a quick snapshot of the project’s identity:
- Name: any-agent
- Creator: Mozilla.ai
- Release Date: April 10, 2025
- License: Apache-2.0
- Purpose: To allow developers to write agent logic once and execute it across multiple frameworks without rewriting code.
This identity ties back to Mozilla's broader mission: championing open, standardized, privacy-conscious technology in a rapidly evolving AI world.
Supported Frameworks in any-agent (as of July 2025)
Currently, any-agent supports seven widely-used agent runtimes:
- LangChain – The pioneer in LLM agent orchestration
- CrewAI – Focused on team-based AI agent roles
- Smolagents – Lightweight, minimalist, zero-dependency design
- Google ADK – Enterprise-grade agent infrastructure
- OpenAI Agents SDK – Powered by GPT and native OpenAI tool APIs
- Agno AI – A rising star in modular, inspectable agents
- LlamaIndex – Ideal for RAG-based workflows and document agents
- TinyAgent – Default lightweight runner for minimal installs
Mozilla tracks additional integrations using open GitHub tickets and encourages the community to propose adapters and PRs.
Installing any-agent: Simple, Modular, Flexible
You can get started with just a single pip command:
For the barebones version (TinyAgent only):
pip install any-agent
For a specific framework:
pip install any-agent[langchain,crewai]
For everything:
pip install any-agent[all]
The installation model is extensible—only install what you need, when you need it.
Minimal Example: Write Once, Run Anywhere
Here’s what building a framework-agnostic agent looks like:
from any_agent import AgentConfig, AnyAgent
agent = AnyAgent.create("smolagents",
AgentConfig(
model_id="gpt-4o-mini",
instructions="Use the tools to find an answer",
tools=["serper_search"]
)
)
result = agent.run("Top 3 AI news today")
Want to test it on CrewAI instead?
agent = AnyAgent.create("crewai", config)
Just change the string. Everything else stays the same. That’s the power of abstraction.
Exploring AgentConfig and AnyAgent.create()
The `AgentConfig` class is the blueprint for your agent. It defines:
- Model ID (e.g., "gpt-4o-mini" or "claude-3-haiku")
- Instructions (how the agent should behave)
- Tools (the functions/APIs the agent can use)
- Memory, context windows, and more (optional)
`AnyAgent.create()` is the factory method that binds the config to a backend adapter. Under the hood, it:
- Loads the required module
- Injects tools
- Applies tracing
- Runs evaluation hooks (if enabled)
Together, these two components offer a standardized way to run AI agents—regardless of framework complexity.
Feature Deep Dive: What Makes any-agent Special?
Let’s go deeper into what makes any-agent a standout library in 2025.
One API to Rule Them All
Your core logic doesn’t change. Switching backends is just a matter of changing a string literal.
Built-in Tracing via OpenTelemetry
All agent traces are normalized to OpenTelemetry GenAI standards. That means you can:
- Monitor behavior visually
- Export traces to Grafana, Honeycomb, etc.
- Reuse trace data for audits or evaluations
LLM-as-a-Judge Evaluation
Use an LLM to automatically score and rank agent outputs. Great for:
- Regression tests
- A/B testing agents
- Detecting hallucinations
A2A Protocol Support
Agents can now talk to each other directly using Mozilla’s Agent-to-Agent (A2A) protocol. Perfect for:
- Team-based agents
- Role-based negotiation systems
- Parallel task pipelines
MCP Integration
All supported frameworks can serve through Model Context Protocol (MCP)—a Mozilla-led standard for interoperability between LLM runtimes and orchestrators.
Real-World Use Cases & Scenarios
Whether you're building for research, production, or rapid prototyping, any-agent fits into your workflow.
Academic Research
Compare LangChain vs. CrewAI performance without rewriting your agent logic. Use trace data for reproducible benchmarks.
Product Development
Build your logic on Smolagents for fast iteration. Switch to OpenAI SDK for production. Same codebase, different runtime.
Multi-Agent Systems
Use A2A protocols to orchestrate autonomous teams (e.g., planner-agent, researcher-agent, writer-agent).
APIs and Microservices
Expose your agent as a REST endpoint via MCP. Use any-agent behind the scenes to keep things backend-agnostic.
agent-factory: Natural Language to Agent Code
Mozilla also maintains a companion project called agent-factory.
What it does:
- Takes a natural language prompt like:
“Create a news summary agent using LangChain and SerperSearch” - Generates runnable Python code using any-agent format
- Automatically structures the AgentConfig, tools, and instructions
This is especially useful for:
- Teams with non-technical members
- Prototyping new flows
- LLM-to-agent pipelines
agent-factory requires Python 3.13+, and it plugs right into any-agent's core interface.
Cookbooks, Blueprints, and Mozilla’s Vision
Mozilla backs any-agent with excellent developer documentation:
- Cookbooks with working examples
- Ready-made Blueprints (e.g. surf-spot finder)
- Real-world demos using MCP and A2A
- GitHub stars: 594 ⭐, 43 forks (as of July 2025)
These resources aren’t just for reference—they're meant to seed a community of contributors and explorers building multi-agent systems.
Caveats: What You Should Know Before Adopting
Like any abstraction, any-agent introduces some trade-offs:
- Slight performance cost from adapter layers
- Adds complexity when debugging low-level framework bugs
- Increases surface area for security (esp. when using tools or protocols)
Mozilla openly encourages developers to evaluate before deploying in production, especially for high-security or high-reliability tasks.
Roadmap & Community Involvement
any-agent is still growing. Planned features include:
- Token streaming support
- Expanded eval metrics (e.g., task success, consistency)
- More adapters (AutoGen, LangGraph)
- Native Jupyter integration
- Multi-agent orchestration via YAML
Want to contribute?
- GitHub: mozilla-ai/any-agent
- Chat: Join the Mozilla AI Discord
- Docs: mozilla-ai.github.io/any-agent
Contributors are welcome to submit adapters, cookbooks, evaluation protocols, or testing benchmarks.
TL;DR
You shouldn’t need to rewrite your agent every time you switch frameworks.
With any-agent, you can:
- Build once with `AgentConfig`
- Run anywhere with `AnyAgent.create(...)`
- Trace everything with OpenTelemetry
- Evaluate with LLMs or humans
- Scale with A2A and MCP protocols
It’s your universal interface for agent development—backed by Mozilla and built for the future.
pip install any-agent[all]
That’s all it takes to go from fragmented to frictionless.
Ready to Streamline Your AI Agent Development?
The AI agent landscape is rapidly evolving, and managing multiple frameworks can be a significant hurdle. By adopting a unified approach with tools like any-agent, you can dramatically cut down on redundant development work, ensure consistent evaluation, and build more robust and portable AI solutions.
Don't let framework fragmentation slow down your innovation. Embrace a strategy that allows your AI agents to run anywhere, giving you the flexibility and efficiency needed to stay ahead.
Take control of your AI development future.
- Are you ready to build once and deploy anywhere?
Explore Unified AI Agent Solutions
Contact us today to discover how a unified approach can transform your AI projects.
Frequently Asked Questions
any-agent is Mozilla.ai’s open-source Python library designed to unify agent development across different AI frameworks like LangChain, CrewAI, Smolagents, and more. Instead of writing separate code for each framework, any-agent allows developers to use a single interface to configure, run, trace, and evaluate agents across multiple backends. This matters because it solves one of the biggest pain points in the agent ecosystem: fragmentation. Developers can now focus on logic, not plumbing.
The whole point of any-agent is to let you avoid rewriting AI agent code every time you want to test or deploy on a new framework. With just a one-line change to the framework string inside AnyAgent.create(), you can run the same agent logic on LangChain, Smolagents, CrewAI, OpenAI SDK, and others. It’s like writing once and deploying anywhere—dramatically reducing dev time and cognitive overhead.
Yes, one of any-agent’s standout features is its ability to compare AI agent frameworks through consistent evaluation. It uses OpenTelemetry-standard tracing across all supported backends and integrates with LLM-as-a-judge and human-in-the-loop evaluation setups. This means you can A/B test LangChain vs. CrewAI (for example) using the same agent and get apples-to-apples performance metrics—all without rewriting code.
Using a single interface for AI agents means your code is cleaner, easier to maintain, and way more portable. It promotes a modular architecture where your agent’s logic, tools, and evaluation strategy are decoupled from the specific runtime. This makes it easier to benchmark, prototype, and move between environments, especially in multi-agent or production systems.
Absolutely. One of any-agent’s core strengths is its native OpenTelemetry integration for AI agents. Every trace—regardless of whether you’re running on LangChain, Smolagents, or CrewAI—is normalized to GenAI telemetry standards. This lets you debug issues more easily, plug into observability stacks like Grafana or Datadog, and even export trace logs for audits or external evaluations.
You can find official any-agent examples, cookbooks, and demos on Mozilla’s GitHub and documentation site. The cookbooks walk you through everything from building your first agent to multi-agent systems using A2A protocols. There’s even a surf-spot finder demo that shows real-world application. For auto-generated agents, check out the companion project agent-factory, which turns natural language prompts into runnable any-agent code.