Python SDK
The Z3rno Python SDK is a thin httpx-based client for the z3rno-server HTTP API. It ships sync and async clients with identical surfaces — every method onZ3rnoClient exists as an async def on AsyncZ3rnoClient, plus one extra (recall_stream_sse) that’s async-only.
Current version: z3rno 0.7.0 on PyPI. Requires Python 3.11+.
Install
Client
| Parameter | Default | Notes |
|---|---|---|
base_url | required | z3rno-server URL. Local dev: http://localhost:8000. |
api_key | required | API key. Default dev: z3rno_sk_test_localdev. |
timeout | 30.0 | Per-request timeout (seconds). |
max_retries | 3 | Tenacity retries on transient failures. |
Method reference
Memory primitives
Streaming recall (Phase G slice 5)
Conversation memory (Phase G slice 2)
Forge — ingest, distill, refine
Tenant self-management (v0.20.3)
Sessions
Framework integrations
Each integration lives inz3rno.integrations.* and lazy-imports its host package — installing z3rno alone is enough until you actually use one.
| Integration | Module | Install extra | Use case |
|---|---|---|---|
| LangChain | z3rno.integrations.langchain | pip install 'z3rno[langchain]' | Chat message history + retriever |
| LlamaIndex | z3rno.integrations.llama_index | pip install 'z3rno[llama-index]' | Z3rnoChatMemoryBuffer + Z3rnoBaseRetriever |
| Anthropic | z3rno.integrations.anthropic | — | Helpers for stamping Claude tool-use turns |
| OpenAI Agents | z3rno.integrations.openai_agents | — | Memory provider for the Agents SDK |
| CrewAI | z3rno.integrations.crewai | — | Tool definitions for CrewAI agents |
| Mastra | z3rno.integrations.mastra | — | Python port of the Mastra-JS memory shape |
Models
Pydantic models exported fromz3rno:
Exceptions
All inherit fromZ3rnoError:
| Class | Maps to | When |
|---|---|---|
AuthenticationError | 401 | Bad / missing API key. |
AuthorisationError | 403 | Key valid but lacks scope (admin-only routes, gated Cypher). |
ValidationError | 400 / 422 | Bad request shape. |
NotFoundError | 404 | Memory / conversation / job not found. |
ConflictError | 409 | Duplicate dataset name, etc. |
RateLimitError | 429 | Includes retry_after from headers. |
ServerError | 5xx | Surfaces the server error id for log correlation. |
Reference
- Package:
z3rnoon PyPI —>=0.7.0 - Source: github.com/the-ai-project-co/z3rno-sdk-python
- Server: Components → z3rno-server — the API the SDK calls
- Verbs: Concepts → The Z3rno Verbs — canonical seven-verb table
- MCP variant: Integrations → Anthropic MCP — same SDK, exposed as MCP tools