Skip to main content

nvoken Python SDK

The Python SDK gives an application a local-feeling facade over nvoken's durable Agent runtime. Reusable behavior is an Agent; one execution is a Turn; continuity is an explicit Conversation; memory is selected independently.

pip install nvoken

Run a stored Agent

Looking up an Agent is awaited because it performs a remote read and fails immediately when the exact key does not exist. An omitted owned_by means the App-owned namespace.

import os
from nvoken import Client

async with Client(os.environ["NVOKEN_API_KEY"]) as client:
    analyst = await client.agent("real-estate-analyst")
    answer = await analyst.text(
        "Compare these two listings",
        tenant="acme",
        user="alice",
    )

Tenant- and user-owned Agent keys are explicit:

from nvoken import OwnedBy

custom = await client.agent("assistant", owned_by=OwnedBy("acme"))
personal = await client.agent("assistant", owned_by=OwnedBy("acme", "alice"))

The Agent's owner, the Turn actor, Conversation ownership, and memory scope are independent. Every execution states its tenant; user, memory, conversation, and narrowed limits are optional per-execution coordinates.

from nvoken import ConversationRef, Memory

turn = await analyst.start(
    "Analyze the offer",
    tenant="acme",
    user="alice",
    memory=Memory.tenant("deal-team"),
    conversation=ConversationRef.by_key("deal-42", owner="user"),
    limits={"max_iterations": 6},
)

snapshot = await turn.status()
result = await turn.result(timeout=60)

start() returns after durable admission. run() is start() followed by result(). text() additionally requires text output. Dropping a waiter or update iterator never cancels the Turn. A local timeout= covers admission and waiting; TurnTimeoutError retains the admitted Turn, or the idempotency key when admission itself timed out, so callers can recover without starting duplicate work.

Inline behavior

inline() is local and makes no request until execution:

from nvoken import Behavior, InlineMemory

classifier = client.inline(Behavior(
    instructions="Classify the request as sales, support, or billing.",
    model="anthropic/claude-sonnet-5",
    output_schema={
        "type": "object",
        "properties": {"queue": {"type": "string"}},
        "required": ["queue"],
        "additionalProperties": False,
    },
))

result = await classifier.run(
    "I need a copy of last month's invoice",
    tenant="acme",
    memory=InlineMemory.none(),
)

Inline tenant or user memory requires an explicit namespace. Anonymous Turns are memoryless.

Host tools

Tool contracts belong to behavior. bind_tools() attaches only process-local handlers by exact name and returns a new wrapper; it does not change durable behavior or the idempotency fingerprint.

async def lookup_property(arguments, context):
    return {"address": arguments["address"], "status": "active"}

ready = analyst.bind_tools({"lookup_property": lookup_property})
answer = await ready.text("Check 10 Main St", tenant="acme", user="alice")

The handler context carries the exact turn_id, tool_call_id, and local cancellation state. Replayed projections do not repeat a handled call; a failed submission clears the local guard so it can be retried. If a compatible handler is absent, the durable Turn remains waiting for another process.

Conversation binding and Turn recovery

conversation = analyst.conversation(
    ConversationRef.by_key("deal-42", owner="tenant"),
    tenant="acme",
    user="alice",
    memory=Memory.tenant("deal-team"),
)
answer = await conversation.text("What changed since yesterday?")

# Synchronous: no request until status/result/updates is used.
recovered = client.turn(saved_turn_id, tenant="acme", user="alice")
result = await recovered.bind_tools({"lookup_property": lookup_property}).result()

Agent lifecycle and exact HTTP access

from nvoken import Behavior

agent = await client.agents.create(
    "real-estate-analyst",
    name="Real Estate Analyst",
    behavior=Behavior(
        instructions="Analyze properties and local market conditions.",
        model="anthropic/claude-sonnet-5",
    ),
)

revision = await agent.publish(
    Behavior(
        instructions="Analyze properties, market conditions, and financing.",
        model="anthropic/claude-sonnet-5",
    ),
)

Create and publish generate idempotency keys when omitted. Pass an explicit key when the host needs to coordinate retries itself.

client.raw exposes the exact generated OpenAPI APIs, including agents, conversations, memory_spaces, and turns, for management or wire-level operations the facade does not simplify.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nvoken-0.32.0.tar.gz (257.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nvoken-0.32.0-py3-none-any.whl (882.5 kB view details)

Uploaded Python 3

File details

Details for the file nvoken-0.32.0.tar.gz.

File metadata

  • Download URL: nvoken-0.32.0.tar.gz
  • Upload date:
  • Size: 257.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nvoken-0.32.0.tar.gz
Algorithm Hash digest
SHA256 b3e6cb0935459d82556d043348924873d4717e7712cc73a9e09e567b1133f1d5
MD5 84cc18c1921eb91ff17cf640fabe3085
BLAKE2b-256 f2e9bb5221a8d82c456293ef022b183b4383d094f0bc6d3510edf8d352d48d6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for nvoken-0.32.0.tar.gz:

Publisher: release-pypi.yml on deepnoodle-ai/nvoken

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nvoken-0.32.0-py3-none-any.whl.

File metadata

  • Download URL: nvoken-0.32.0-py3-none-any.whl
  • Upload date:
  • Size: 882.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nvoken-0.32.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71f6804ee2420f0e9e6d26947f58def3787951a6b90c62e2870294509be1e6c6
MD5 bb9a70226a27efaa1b3e0fa35e5cfa87
BLAKE2b-256 6083a5ef33ed278c891ab85a7066af6b2c94578b7f466279de456ff4e064e0e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for nvoken-0.32.0-py3-none-any.whl:

Publisher: release-pypi.yml on deepnoodle-ai/nvoken

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.35.0

2 files

0.34.0

2 files

0.33.0

2 files

This release

0.32.0 This release

2 files

0.31.0

2 files

0.30.0

2 files

0.29.0

2 files

0.28.0

2 files

0.27.0

2 files

0.26.0

2 files

0.25.0

2 files

0.24.0

2 files

0.23.0

2 files

0.22.0

2 files

0.21.0

2 files

0.20.0

2 files

0.19.0

2 files

0.18.0

2 files

0.17.0

2 files

0.16.0

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.1

2 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