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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nvoken-0.34.0.tar.gz.
File metadata
- Download URL: nvoken-0.34.0.tar.gz
- Upload date:
- Size: 259.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e32187ddbceca33dbb956802fe45b97dd6367db8b2697321a1af120c90e446d0
|
|
| MD5 |
978b6961523584f65cc93c57cbd45bf0
|
|
| BLAKE2b-256 |
f73c3bc2090272a0f2f021b4b788ee128de136dab272abfef42159eadbd1b522
|
Provenance
The following attestation bundles were made for nvoken-0.34.0.tar.gz:
Publisher:
release-pypi.yml on deepnoodle-ai/nvoken
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nvoken-0.34.0.tar.gz -
Subject digest:
e32187ddbceca33dbb956802fe45b97dd6367db8b2697321a1af120c90e446d0 - Sigstore transparency entry: 2655227366
- Sigstore integration time:
-
Permalink:
deepnoodle-ai/nvoken@bf0a3b5851a1dd2367b043ea71722209eea6a8fd -
Branch / Tag:
refs/tags/pypi-v0.34.0 - Owner: https://github.com/deepnoodle-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@bf0a3b5851a1dd2367b043ea71722209eea6a8fd -
Trigger Event:
push
-
Statement type:
File details
Details for the file nvoken-0.34.0-py3-none-any.whl.
File metadata
- Download URL: nvoken-0.34.0-py3-none-any.whl
- Upload date:
- Size: 882.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf68549d97eaa5e4e44dd6049049f5205d81d114221df3aad0b5baa28ad6838e
|
|
| MD5 |
12be6cf7dbf37edd0b4656b753753ece
|
|
| BLAKE2b-256 |
01c8607f3497555e1d328f42103302165d63c7b6c3337c2b083c0f592e9c8c18
|
Provenance
The following attestation bundles were made for nvoken-0.34.0-py3-none-any.whl:
Publisher:
release-pypi.yml on deepnoodle-ai/nvoken
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nvoken-0.34.0-py3-none-any.whl -
Subject digest:
bf68549d97eaa5e4e44dd6049049f5205d81d114221df3aad0b5baa28ad6838e - Sigstore transparency entry: 2655227377
- Sigstore integration time:
-
Permalink:
deepnoodle-ai/nvoken@bf0a3b5851a1dd2367b043ea71722209eea6a8fd -
Branch / Tag:
refs/tags/pypi-v0.34.0 - Owner: https://github.com/deepnoodle-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@bf0a3b5851a1dd2367b043ea71722209eea6a8fd -
Trigger Event:
push
-
Statement type: