Skip to main content

Actant

Actant is a durable Python agent runtime built on Temporal. Define agents and tools normally; Actant handles parallel tools, human approval, deferred work, subagents, suspension, and crash-safe continuation.

Actant is pre-1.0. Public APIs may change.

https://github.com/user-attachments/assets/021014df-4af6-47fe-8da9-cd6221008604

Why Actant

Agent tools become a distributed-systems problem when calls run in parallel, wait for people, or outlive a worker. Actant handles that orchestration:

  • allowed tools execute concurrently;
  • deferred tools pause without holding a worker;
  • the next model turn waits for the complete tool group;
  • approvals and nested-agent waits surface through the same API;
  • Temporal recovers execution after process or worker failure;
  • projection stores keep state easy for APIs and UIs to read.
flowchart TB
    Turn["One agent turn emits A, B, and C"]
    A["A: execute → completed"]
    B["B: wait ··· human approves → completed"]
    C["C: execute → completed"]
    Barrier["Durable tool-group barrier"]
    Next["Next agent turn"]

    Turn --> A & B & C
    A --> Barrier
    B --> Barrier
    C --> Barrier
    Barrier --> Next

Read Why Actant? for the detailed guarantees and framework comparison.

Install

pip install actant
pip install "actant[openai]"     # optional provider
pip install "actant[anthropic]"  # optional provider
pip install "actant[gemini]"     # optional provider

Start a local Temporal development server:

actant server start

The server stays attached so its logs and lifecycle remain visible. Pass --detach only when you intentionally want it to run in the background.

Quickstart

This complete example hosts a worker, submits a message, and reads the persisted reply:

import asyncio
from contextlib import suppress
from uuid import uuid4

from temporalio.client import Client
from actant import AgentDefinition
from actant.llm.providers.fake import FakeLLM, FakeResponse
from actant.runtime import AgentRuntime
from actant.runtime.stores import InMemoryRuntimeStores
from actant.tools import ToolRegistry

agent = AgentDefinition(
    id="assistant",
    name="Assistant",
    persona="You are useful.",
    llm=FakeLLM([FakeResponse(text="Hello from Actant.", text_chunks=["Hello ", "from Actant."])]),
    tools=ToolRegistry([]),
)


async def resolve_agent(agent_id: str, thread_id: str) -> AgentDefinition:
    if agent_id != agent.id:
        raise KeyError(agent_id)
    return agent


async def main() -> None:
    client = await Client.connect("localhost:7233")
    runtime = AgentRuntime(
        client=client, stores=InMemoryRuntimeStores(), resolve_agent=resolve_agent
    )
    polling = asyncio.create_task(runtime.run_worker())
    try:
        thread = runtime.thread(agent.id, uuid4())
        workflow_id = await thread.send("hello")
        await client.get_workflow_handle(workflow_id).result()
        print((await thread.messages())[-1].content)
    finally:
        polling.cancel()
        with suppress(asyncio.CancelledError):
            await polling


asyncio.run(main())
# Hello from Actant.

thread.send() durably submits work and returns immediately. thread.events() provides typed live deltas and lifecycle events; thread.messages() provides the persisted reload path. Custom hooks and listeners remain available for advanced worker-side callbacks.

The runtime has three write-side entry points:

thread = runtime.thread(agent.id, uuid4())
await thread.send("Start")
await thread.resolve(tool_call_id, approved=True)
await thread.cancel()

The equivalent runtime-level methods remain available when an application already carries agent_id and thread_id separately. A thread handle also exposes state(), messages(), waiting_tools(), and typed live events().

Use OpenAIProvider, AnthropicProvider, GeminiProvider, or QwenProvider in place of FakeLLM. Actant never chooses a model ID for you.

Tools and approvals

Annotated functions become tools directly:

from actant import tool


@tool
async def weather(city: str) -> dict[str, str]:
    """Get the current weather for a city."""
    return {"city": city, "forecast": "sunny"}


@tool(approval="Publish {title}?")
async def publish(title: str) -> dict[str, str]:
    """Publish an update."""
    return {"published": title}

Register them with ToolRegistry([weather, publish]). Actant derives the JSON schema from annotations. Approval tools enter the same durable AWAIT_HUMAN state as advanced deferred tools and execute only after thread.resolve(..., approved=True).

Demo

The included FastAPI + React viewer demonstrates streaming, approvals, multiple-choice questions, mixed parallel tools, and nested subagents without an API key:

just demo-sync
just demo

Open http://localhost:5173.

Documentation

Development

just sync
just test
just lint
just typecheck
just package

The justfile is repository-only. Installed users receive the actant CLI; run actant server --help for local Temporal commands.

License

MIT

Metadata

Release files for actant 0.29.0

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

Source distribution (sdist)

Source distribution for actant 0.29.0
File Size Uploaded
actant-0.29.0.tar.gz 284.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for actant 0.29.0
File Interpreter ABI Platform
actant-0.29.0-py3-none-any.whl Python 3 none any Details

Total release size: 462.1 kB

Release files / actant-0.29.0.tar.gz

Download URL actant-0.29.0.tar.gz
Size 284.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d5b6f3bf3cd4433ba3602d5545d4fda7b467fa1f90dbae811912f500381a7e03
BLAKE2b-256 checksum
How to use checksums
75dd6a4530523d896e84cfabad25b784b19a1c5e24812e851ff1cfef31544a91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / actant-0.29.0-py3-none-any.whl

Download URL actant-0.29.0-py3-none-any.whl
Size 177.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
afbeb18e439eef99661e463290b6e143fca8662d5910b6e41216d606ab7314d4
BLAKE2b-256 checksum
How to use checksums
e8d903abb1acd8b6595c5bf72f2329e9ff505037c968186a3538e9e199c2d748
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release history Release notifications | RSS feed

0.40.2

2 release files

0.40.1

2 release files

0.40.0

2 release files

This release

0.29.0 This release

2 release files

0.26.1

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.24.0

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.21.2

2 release files

0.21.1

2 release files

0.21.0

2 release files

0.20.1

2 release files

0.20.0

2 release files

0.19.1

2 release files

0.19.0

2 release files

0.18.2

2 release files

0.18.1

2 release files

0.18.0

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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