Getting started
Install the SDK, inspect the function-call schemas, read the version-pinned PHQ-9 and GAD-7 bodies, and wire a client over HTTP. Five minutes.
Updated May 29, 2026
The Nyra Agent SDK ships in two languages with the same surface. TypeScript: @humyn/nyra. Python: humyn-nyra. Same function-call schemas, same evidence-map shape, same audit-chain algorithm, byte-for-byte.
v0.1.0 ships the contract, not the data. HttpTransport raises NotLiveYetError on every method until the Nyra auth server is live. You can install the package today to wire types into your agent, hand the tool definitions to your LLM, render PHQ-9 and GAD-7 items locally, and validate audit chains against any real graph once you have one.
For the wider story (what the graph is for, the commit boundary, what an agent cannot do), read /agents.
Install
# TypeScript
pnpm add @humyn/nyra
# Python
pip install humyn-nyra
TypeScript: inspect tools, read PHQ-9, wire the client
import {
NyraClient,
HttpTransport,
NotLiveYetError,
PHQ9_DEFINITION,
toolDefinitions,
TOOL_NAMES,
} from "@humyn/nyra";
console.log(TOOL_NAMES);
// ["me.read", "evidence_map.read", "scales.read", "audit.read",
// "sandbox.fork", "simulation.run", "draft.create"]
console.log(PHQ9_DEFINITION.versionPinned); // "1999.kroenke.spitzer.williams"
console.log(PHQ9_DEFINITION.questions.length); // 9
console.log(PHQ9_DEFINITION.item9Escalation); // crisis-escalation policy
const client = new NyraClient({
transport: new HttpTransport({
baseUrl: "https://api.nyra.us.com",
token: "<oauth-token>",
}),
});
try {
await client.me();
} catch (err) {
if (err instanceof NotLiveYetError) {
// v0.1.0. The shape is committed; only the bodies change when auth ships.
} else {
throw err;
}
}
Python: same calls, async
import asyncio
from humyn_nyra import (
NyraClient,
HttpTransport,
NotLiveYetError,
PHQ9_DEFINITION,
TOOL_NAMES,
)
from humyn_nyra.transport.http import HttpTransportOptions
async def main():
print(TOOL_NAMES)
print(PHQ9_DEFINITION.version_pinned) # "1999.kroenke.spitzer.williams"
print(len(PHQ9_DEFINITION.questions)) # 9
client = NyraClient(transport=HttpTransport(HttpTransportOptions(
base_url="https://api.nyra.us.com",
token="<oauth-token>",
)))
try:
await client.me()
except NotLiveYetError:
pass # expected in v0.1.0
asyncio.run(main())
What ships in v0.1.0
- Types and Zod / Pydantic schemas for
EvidenceMap,PatientModel,AuditLogEntry,ScaleDefinition,SimulationRun,Draft,Sandbox,MeResponse. - The seven function-call definitions, OpenAI- and Anthropic-compatible.
HttpTransport, a typed skeleton that raisesNotLiveYetErroruntil the auth server is up. The shape is committed; only the bodies change.PHQ9_DEFINITIONandGAD7_DEFINITION, version-pinned reference bodies you can render and score against without a network call.- Audit-log verification with a byte-identical algorithm across TypeScript and Python, locked by a golden SHA256.
- DPoP proof claim builder. Bring your own ES256 signer.
- Five typed errors mapping the marketing-spec refusals:
CommitNotAllowedError,ClinicianRejectedDraftError,InstrumentFrozenError,ScopeError, andRateLimitError.
Two surfaces, one substrate
The TS and Python packages are generated from the same JSON Schema source of truth. The audit canonical-JSON algorithm is locked at the byte level. The function-call schemas are the same JSON object. Same prompt loop, same wire format, two SDKs.
Next: Authentication.