PyPI Python CI License Tests

The readable AI agent runtime.

Zero runtime dependencies, a core you can read in one sitting, a bounded autonomous tool loop, streaming, async, conversation memory — and an honest feature list. The page below runs the real wheel from PyPI inside your browser.

Live demo · Pyodide + the actual PyPI wheel

Watch the agent loop think — in your browser

No install, no API keys. Click Boot runtime and this page loads CPython (WASM) plus nexusagent-runtime==1.9.1 straight from PyPI. The “model” is a small scripted router so everything stays offline and deterministic — the agent loop, tool execution, memory and streaming are the real package code, traced line by line.

scenarios
not loaded
Type any prompt: the offline demo brain (ADR 0016/0017) answers chess, color and science facts — try who start first in chess? black or white or why is the sky blue? — routes arithmetic like what is 144 / 12 through the real calculator tool loop, remembers my name is … across runs, suggests the closest topic when it misses, and falls back honestly on anything else — deterministic, zero API keys.
agent trace — real code paths
Why NexusAgent

Small core, honest features

Everything below is contract-tested; the public surface is pinned by CI (ADR 0010).

📦

Zero runtime dependencies

The whole core is the Python standard library. pip install nexusagent-runtime pulls nothing else.

🔁

Bounded autonomous tool loop

Providers request tools; the agent executes and re-invokes them, bounded by max_iterations.

🧠

Conversation memory

Opt-in Memory: in-process FIFO or persisted SQLiteMemory — remembered turns compose into each prompt.

🌊

Streaming

SSE text deltas from OpenAI, Anthropic and Gemini adapters, sync and async, through on_delta.

⚡

Async mirror

AsyncAgent/AsyncRuntime mirror every sync contract; sync providers keep working via a thread bridge.

🛡

Automatic retries

Transient HTTP failures retried with exponential backoff, full jitter and Retry-After support.

🔒

Stable public API

SemVer over the full root surface; a CI-pinned test fails on any accidental removal, rename or silent addition.

✅

Typed & tested

py.typed, mypy --strict clean, 1350+ offline tests, 99.6%+ coverage with a 95% CI floor.

Quick start

Five lines to a working agent

quickstart.py — offline by default
from nexusagent import create_application_runtime

runtime = create_application_runtime()   # offline `fake` provider

result = runtime.run("Hello NexusAgent")
print(result.output)                     # fake response: Hello NexusAgent
print(runtime.execute_tool("calculator", "2 + 3"))  # 5
memory.py — context across restarts
from nexusagent import SQLiteMemory, create_runtime

memory = SQLiteMemory("session.db", max_turns=50)
runtime = create_runtime(memory=memory)

runtime.run("My name is Sara")
memory.close()                           # a later process…

memory = SQLiteMemory("session.db", max_turns=50)
runtime = create_runtime(memory=memory)
print(runtime.run("What is my name?").output)
# the model still knows — the file remembers
Architecture decisions

Sixteen ADRs, all readable

Every decision that shaped the runtime is recorded, dated and linked.