Metadata-Version: 2.4
Name: aiXplain
Version: 0.2.43
Summary: aiXplain SDK adds AI functions to software.
Author-email: ahmet@aixplain.com, hadi@aixplain.com, kadir.pekel@aixplain.com, zaina.abushaban@aixplain.com
License: Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
Project-URL: Homepage, https://github.com/aixplain/aiXplain
Project-URL: Documentation, https://github.com/aixplain/pipelines/tree/main/docs
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries
Requires-Python: <4,>=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.1.0
Requires-Dist: tqdm>=4.1.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: validators>=0.20.0
Requires-Dist: filetype>=1.2.0
Requires-Dist: click>=7.1.2
Requires-Dist: PyYAML>=6.0.1
Requires-Dist: dataclasses-json>=0.5.2
Requires-Dist: Jinja2==3.1.6
Requires-Dist: sentry-sdk>=1.0.0
Requires-Dist: pydantic>=2.10.6
Requires-Dist: filelock>=3.0.0
Requires-Dist: twine>=6.2.0
Requires-Dist: pre-commit>=4.3.0
Provides-Extra: model-builder
Requires-Dist: model-interfaces~=0.0.2; extra == "model-builder"
Provides-Extra: test
Requires-Dist: pytest>=6.1.0; extra == "test"
Requires-Dist: docker>=6.1.3; extra == "test"
Requires-Dist: requests-mock>=1.11.0; extra == "test"
Requires-Dist: pytest-mock>=3.10.0; extra == "test"
Requires-Dist: pytest-rerunfailures>=16.0; extra == "test"

# aiXplain Agents SDK

**Build and deploy autonomous AI agents on production-grade infrastructure, instantly.**

---

## aiXplain agents

aiXplain Agents SDK gives developers Python and REST APIs to build, run, and deploy autonomous multi-step agents on [AgenticOS](https://docs.aixplain.com/getting-started/agenticos). Agents include built-in memory for short- and long-term context (opt-in), and adapt at runtime by planning steps, selecting tools and models, running code, and refining outputs until tasks are complete.

aiXplain agents include micro-agents for runtime policy enforcement and access control, plus proprietary meta-agents like Evolver for self-improvement.

With one API key, access 900+ vendor-agnostic models, tools, and integrations in the aiXplain Marketplace with consolidated billing, and swap assets without rewriting pipelines.

### Why aiXplain for developers

- **Autonomy** — agents plan and adapt at runtime instead of following fixed workflows.
- **Delegation** — route complex work to specialized subagents during execution.
- **Policy enforcement** — apply runtime guardrails with Inspector and Bodyguard on every run.
- **Observability** — inspect step-level traces, tool calls, and outcomes for debugging.
- **Portability** — swap models and tools without rewriting application logic.
- **Flexible deployment** — run the same agent definition serverless or private.

<div align="center">
  <img src="docs/assets/aixplain-workflow-teamagent.png" alt="aiXplain team-agent runtime flow" title="aiXplain"/>
</div>

## AgenticOS

AgenticOS is the runtime behind aiXplain Agents. It orchestrates multi-step execution, routes model and tool calls with fallback policies, enforces governance at runtime, records step-level traces, and supports both serverless and private deployment.

<div align="center">
  <img src="docs/assets/aixplain-agentic-os-architecture.png" alt="aiXplain AgenticOS architecture" title="aiXplain"/>
</div>

---

## Quick start

```bash
pip install aixplain
```

Get your API key from your [aiXplain account](https://console.aixplain.com/settings/keys).

<details open>
  <summary><strong>v2 (default)</strong></summary>

### Create and run your first agent (v2)

```python
from aixplain import Aixplain

aix = Aixplain(api_key="<AIXPLAIN_API_KEY>")

search_tool = aix.Tool.get("tavily/tavily-web-search/tavily")

agent = aix.Agent(
    name="Research agent",
    description="Answers questions with concise web-grounded findings.",
    instructions="Use the search tool when needed and cite key findings.",
    tools=[search_tool],
)
agent.save()

result = agent.run(query="Summarize the latest AgenticOS updates.")
print(result.data.output)
```

### Build a multi-agent team (v2)

```python
from aixplain import Aixplain

aix = Aixplain(api_key="<AIXPLAIN_API_KEY>")
search_tool = aix.Tool.get("tavily/tavily-web-search/tavily")

planner = aix.Agent(
    name="Planner",
    instructions="Break requests into clear subtasks."
)

researcher = aix.Agent(
    name="Researcher",
    instructions="Find and summarize reliable sources.",
    tools=[search_tool],
)

team_agent = aix.Agent(
    name="Research team",
    instructions="Delegate work to subagents, then return one final answer.",
    subagents=[planner, researcher],
)
team_agent.save()

response = team_agent.run(query="Compare top open-source agent frameworks in 5 bullets.")
print(response.data.output)
```

</details>

<details>
  <summary><strong>v1 (legacy)</strong></summary>

### Create and run your first agent (v1)

```python
from aixplain.factories import AgentFactory, ModelFactory

weather_tool = ModelFactory.get("66f83c216eb563266175e201")

agent = AgentFactory.create(
    name="Weather Agent",
    description="Answers weather queries.",
    instructions="Use the weather tool to answer user questions.",
    tools=[weather_tool],
)

result = agent.run("What is the weather in Liverpool, UK?")
print(result["data"]["output"])
```

You can still access legacy docs at [docs.aixplain.com/1.0](https://docs.aixplain.com/1.0/).

</details>

---

## Data handling and deployment

aiXplain applies runtime governance and enterprise controls by default:

- **No data retained by default** — agent memory is opt-in (short-term and long-term).
- **SOC 2 Type II certified** — enterprise security and compliance posture.
- **Runtime policy enforcement** — Inspector and Bodyguard govern every agent execution.
- **Sovereign deployment options** — serverless or private (on-prem, VPC, and air-gapped).
- **Encryption** — TLS 1.2+ in transit and encrypted storage at rest.

Learn more at [aiXplain Security](https://aixplain.com/security/) and [Sovereignty](https://aixplain.com/sovereignty/).

---

## Pricing

Start free, then scale with usage-based pricing.

- **Pay as you go** — prepaid usage with no surprise overage bills.
- **Subscription plans** — reduce effective consumption-based rates.
- **Custom enterprise pricing** — available for advanced scale and deployment needs.

Learn more at [aiXplain Pricing](https://aixplain.com/pricing/).

---

## Community & support

- **Documentation:** [docs.aixplain.com](https://docs.aixplain.com)
- **Example agents**: [https://github.com/aixplain/cookbook](https://github.com/aixplain/cookbook)
- **Learn how to build agents**: [https://academy.aixplain.com/student-registration/](https://academy.aixplain.com/student-registration/)
- **Meet us in Discord:** [discord.gg/aixplain](https://discord.gg/aixplain)
- **Talk with our team:** [care@aixplain.com](mailto:care@aixplain.com)

---

## License

This project is licensed under the Apache License 2.0. See the [`LICENSE`](LICENSE) file for details.
