Skip to main content

Nexura Agents

Build typed Python agents with tools, estimated-cost admission control, exact-action approvals and resumable runs.

Install

pip install nexura-agents

Alpha (0.4): pip install nexura-agents (or pip install -e packages/nexura-agents from the source checkout). Core dependencies are only httpx and pydantic; nexura-vertex, [litellm] and [otel] add Vertex AI, LiteLLM and tracing.

Minimal examples

A real model needs credentials and is not run by the docs tests:

from nexura_agents import Agent

agent = Agent(name="Support", instructions="Be brief.", model="vertex:gemini-2.5-flash")
print(agent.run("Hello").output)  # requires nexura-vertex and Google ADC

Run the same interface with a deterministic local fake, without keys:

from nexura_agents import Agent, FakeModel

agent = Agent(name="Support", instructions="Be brief.", model=FakeModel(responses=["Hello!"]))
print(agent.run("Hi").output)

For an async application:

import asyncio
from nexura_agents import Agent, FakeModel

async def main() -> None:
    agent = Agent(name="Support", instructions="Be brief.", model=FakeModel(responses=["Hello!"]))
    assert (await agent.run_async("Hi")).output == "Hello!"

asyncio.run(main())

A local fake refund example shows typed dependencies, typed output and approval persisted as JSON:

from dataclasses import dataclass, field

from pydantic import BaseModel

from nexura_agents import (
    Agent,
    FakeModel,
    ModelRetry,
    RunContext,
    Runner,
    RunInterruption,
    ToolCall,
    UsageLimits,
    tool,
)


@dataclass
class Shop:  # your database, clients, current user...
    orders: dict[str, float]
    refunds: list[str] = field(default_factory=list)


class Decision(BaseModel):  # the agent must return exactly this
    order_id: str
    refunded: float


@tool
async def get_order(ctx: RunContext[Shop], order_id: str) -> float:
    """Return the order total."""
    if order_id not in ctx.deps.orders:
        raise ModelRetry(f"No order {order_id}. Order IDs look like A1.")  # model retries
    return ctx.deps.orders[order_id]


@tool(requires_approval=lambda ctx, args: args["amount"] > 100)  # big refunds wait
async def refund(ctx: RunContext[Shop], order_id: str, amount: float) -> str:
    """Refund an order."""
    ctx.deps.refunds.append(f"{order_id}:{amount}")
    return "refunded"


model = FakeModel(
    responses=[  # stands in for "vertex:gemini-2.5-flash"
        [ToolCall(id="1", name="get_order", arguments={"order_id": "A1"})],
        [ToolCall(id="2", name="refund", arguments={"order_id": "A1", "amount": 250.0})],
        '{"order_id": "A1", "refunded": 250.0}',
    ]
)
agent = Agent(
    name="Refunds",
    instructions="Resolve refund requests.",
    model=model,
    tools=[get_order, refund],
    output_type=Decision,
)
runner = Runner(usage_limits=UsageLimits(request_limit=8))
shop = Shop(orders={"A1": 250.0})

result = runner.run(agent, "Refund order A1 in full", deps=shop)
assert result.status == "paused" and shop.refunds == []  # nothing happened yet
saved = result.interruption.to_json()  # store it anywhere

# ...later, maybe in another process, after a human reviews paused.pending:
paused = RunInterruption.from_json(saved)
result = runner.resume(agent, paused, approve=True, deps=shop)  # or reject={id: "reason"}
print(result.output)  # order_id='A1' refunded=250.0
print(shop.refunds)  # ['A1:250.0']

Status and limits

Alpha (0.4). Python 3.11–3.13 declared; GitHub Actions runs the wheel's test suite on 3.11, 3.12 and 3.13 (Linux) and on 3.12 for macOS and Windows, all passing since 2026-10-21. On 2026-10-09, 295 SDK tests passed from wheels on 3.11 and 3.13, excluding 4 platform-importing files. nexura-runtime requires Python 3.12. Providers are mock-verified except owner-run Vertex AI (2026-10-08: reply/tool/stream) and Gemini API (2026-10-20: reply/tool/stream/structured output); OpenAI, Anthropic and Sarvam live checks have not run. LiteLLM is checked only with the real library's offline mock mode.

Open-source edition: single user, this machine only; for a team or a public endpoint use the hosted or enterprise edition. Agent teams compose code, not human accounts. No external security review; no real-world users yet. Budgets reserve estimates, not an invoice ceiling; unknown usage fails closed under token limits. Only marked tools pause for approval; canonical digests refuse non-string mapping keys. MCP serving is checked with this SDK's in-process client only, not external apps. A2A has no push notifications, ListTasks/Subscribe, HTTP+JSON/gRPC, signed cards or OAuth; no live third-party-agent checks. There are no hosted web-search/code/file tools or tracing UI. See all SDK details, approvals, budget limits, verification history and the historical comparison caveats.

Documentation and licence

Main documentation: 48 guides plus the generated API reference. More examples: getting started, harness, teams, providers, MCP/OpenAPI. Apache-2.0, Copyright (c) 2026 Liceron; see LICENSE. Security reports: info@liceron.in.

Metadata

Release files for nexura-agents 0.9.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nexura-agents 0.9.3
File Size Uploaded Provenance Actions
nexura_agents-0.9.3.tar.gz 498.8 kB Without provenance Details for nexura_agents-0.9.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nexura-agents 0.9.3
File Interpreter ABI Platform Actions
nexura_agents-0.9.3-py3-none-any.whl Python 3 none any Details for nexura_agents-0.9.3-py3-none-any.whl

Total release size: 1.1 MB

Release files / nexura_agents-0.9.3.tar.gz

Download URL nexura_agents-0.9.3.tar.gz
Size 498.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7309387765e03510d9464aae2e70b6d18909d5174e6adbc83948f804c9281b1f
BLAKE2b-256 checksum
How to use checksums
c242ae6bc3b1669804ab04d9245a73b2774c308aa1dd0b4e7e3503894694dfa0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / nexura_agents-0.9.3-py3-none-any.whl

Download URL nexura_agents-0.9.3-py3-none-any.whl
Size 591.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e982f3193a721cf3ab4efed38a053a8f83bbebce3eb8052d480839402fabd87
BLAKE2b-256 checksum
How to use checksums
24e38fc00ae8eb30eabeb0e28d26b7a6cd69992d1866da33057402e53c47597d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for nexura-agents 0.9.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page