Skip to main content

smooai-smooth-operator-temporal (Python)

Optional Temporal durable-execution backend for the smooai-smooth-operator-core Python agent engine (ADR-030). The Python sibling of the smooai-smooth-operator-temporal Rust crate.

An agent turn runs as a Temporal workflow whose side-effects — the model call and each tool invocation — are Temporal activities. The workflow drives the engine's deterministic drive_turn orchestration unchanged, so the durable path and the in-process path are the same loop. That buys crash-safe resume, durable human-in-the-loop, and durable timers without a second implementation of the agent loop to keep in sync.

Optionality

The serde DTO boundary (smooth_operator_temporal.dto) imports no Temporal SDK and is always available. The workflow/activity wiring (smooth_operator_temporal.temporal) imports temporalio, provided by the optional temporal extra — mirroring the Rust crate's off-by-default temporal cargo feature:

pip install 'smooai-smooth-operator-temporal[temporal]'

What it gives you

  • Crash-safe resume — the workflow's event history is the checkpoint, so a worker restart mid-turn resumes rather than restarting the turn.
  • Durable human-in-the-loop — a tool named in approval_required_tools blocks on workflow.wait_condition until an approve_tool / deny_tool signal names its call id. The pending decision lives in workflow history, so it survives a disconnected client and can resolve hours later. A denial returns a tool-error result to the model without ever executing the tool.
  • Durable timers — a call to the configured wait_tool sleeps the workflow on a Temporal timer, a pause that can span days.

Usage

Register the workflow and activities on a worker, injecting the engine handles the activities run against:

from temporalio.client import Client
from temporalio.worker import Worker
from smooth_operator_temporal.temporal import AgentTurnActivities, AgentTurnWorkflow, HealthWorkflow

activities = AgentTurnActivities.from_engine(my_llm_provider)  # AgentOptions optional
client = await Client.connect("localhost:7233")
worker = Worker(
    client,
    task_queue="smooth-operator-agent-turn",
    workflows=[AgentTurnWorkflow, HealthWorkflow],
    activities=[activities.health_echo, activities.model_call, activities.tool_invoke],
)

Start a turn:

from smooth_operator_temporal.dto import AgentTurnInput

messages = await client.execute_workflow(
    AgentTurnWorkflow.run,
    AgentTurnInput(system_prompt="You are a test agent", user_message="what is the durable answer?"),
    id="agent-turn-1",
    task_queue="smooth-operator-agent-turn",
)

Unlike the Rust reference — whose activities are free functions fed by a process-global init_engine — Python holds the engine handles on the AgentTurnActivities instance (plain dependency injection).

Status

The durable backend (workflow + activities + durable timer + HITL signals) is implemented and covered by skip-gated e2e tests. Adapting it behind the engine's streaming AgentExecutor protocol — so a server can select it per turn — is deferred for the same reason the Rust server defers it: a workflow-backed turn has no token-delta stream to feed the runner's event translator. The server-side selection seam (env-gated, injected) lands separately in the smooth-operator server repo.

License

MIT

Metadata

Release files for smooai-smooth-operator-temporal 1.14.1

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

Source distribution (sdist)

Source distribution for smooai-smooth-operator-temporal 1.14.1
File Size Uploaded Provenance Actions
smooai_smooth_operator_temporal-1.14.1.tar.gz 39.0 kB Without provenance Details for smooai_smooth_operator_temporal-1.14.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for smooai-smooth-operator-temporal 1.14.1
File Interpreter ABI Platform Actions
smooai_smooth_operator_temporal-1.14.1-py3-none-any.whl Python 3 none any Details for smooai_smooth_operator_temporal-1.14.1-py3-none-any.whl

Total release size: 47.8 kB

Release files / smooai_smooth_operator_temporal-1.14.1.tar.gz

Download URL smooai_smooth_operator_temporal-1.14.1.tar.gz
Size 39.0 kB
Tags Source
SHA-256 checksum
How to use checksums
be4344d557f42c4cb84fa9436b4d07ed6ea113c00f7f39446dc3426830c91cc5
BLAKE2b-256 checksum
How to use checksums
af041471802511415e373d97a4ca4d7bfdfd74966e3b869e51921e07e1eecad8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / smooai_smooth_operator_temporal-1.14.1-py3-none-any.whl

Download URL smooai_smooth_operator_temporal-1.14.1-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ea9d1855f111e352a7e6448898c3412a85dc51e425d9795042ed6f917b81191
BLAKE2b-256 checksum
How to use checksums
ad1355a537b8197fa26e943ebc575dc053952b1002f57cd911689af3046b2cce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for smooai-smooth-operator-temporal 1.14.1

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