nage-ai — Python SDK
Official Python client for Nage — source-attributed AI on the SEDIM architecture.
pip install nage-ai
(Package is published as nage-ai; import stays as nage.)
Why Nage
Every response ships with a STEMMA — a real-time attribution map showing which source contributed how much. For regulated teams (legal, compliance, finance, healthcare) where "the model said so" isn't a good answer, STEMMA is how you defend every claim.
Quickstart
from nage import Nage
client = Nage(api_key="nk_live_...") # or set NAGE_API_KEY env var
r = client.think(
query="Explain the GDPR right to erasure",
platform="nm/fehm",
inference_mode="top_k",
)
print(r.text)
print(r.stemma.weights) # {'fehm-en': 0.71, 'cortex-reasoning': 0.21, ...}
print(r.stemma.dominant_varve) # 'fehm-en'
print(r.stemma.entropy) # 0.52
print(r.latency_ms) # 847
VARVE management
for v in client.varves.list():
print(v.name, v.status, v.rank)
health = client.varves.health("<varve-id>")
# health.status ∈ {'optimal', 'weak', 'collapsed', 'overtrained', 'unknown'}
# health.rho — orbital ρ (want [0.05, 0.30])
# GDPR / KVKK Article 17 surgical removal
client.varves.privacy_delete("<varve-id>")
Upload + train a VARVE
varve = client.ingest.upload_and_train(
file_path="./contracts/q1-2026.pdf",
name="contracts-q1-2026",
layer="FEHM",
varve_type="flash", # 'ephemeral' | 'flash' | 'full'
wait_for_ready=True, # poll until training completes
)
print(varve.id, varve.status)
Streaming conversation context
# Multi-turn conversation — pass prior messages as context
context = []
for turn in ["Hello", "What's STEMMA?"]:
r = client.think(query=turn, context=context)
context.append({"role": "user", "content": turn})
context.append({"role": "assistant", "content": r.text})
print(f"> {turn}\n{r.text}\n")
Error handling
All errors inherit from NageError:
from nage import Nage, RateLimitError, AuthError, NageError
try:
r = client.think(query="...")
except RateLimitError as e:
print(f"Rate-limited. Retry after {e.retry_after}s.")
except AuthError as e:
print(f"Auth: {e}")
except NageError as e:
print(f"Other: {e.status} — {e.body}")
The client retries 429 and 5xx automatically (up to max_retries=3,
exponential backoff with jitter). You only see these if the retries
exhaust.
Configuration
client = Nage(
api_key="nk_live_...", # or NAGE_API_KEY env var
base_url="https://api.sedim.ai", # or NAGE_BASE_URL env var
timeout_s=90, # cold-start can hit ~30s
max_retries=3,
)
You can also authenticate with a user JWT (for platform-scoped operations like Canvas editing):
client = Nage(bearer_token="<jwt>")
Context manager
with Nage(api_key="nk_live_...") as client:
r = client.think(query="...")
# Connection closed automatically
Links
- Platform: https://nage.ai
- Docs: https://nage.ai/docs
- Dashboard + keys: https://nage.ai/dashboard
- Status: https://nage.ai/status
- GitHub: https://github.com/NageAI
License
Apache-2.0
Metadata
Release files for nage-ai 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nage_ai-0.1.1.tar.gz | 11.9 kB | Without provenance | Details for nage_ai-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nage_ai-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for nage_ai-0.1.1-py3-none-any.whl |
Total release size: 23.0 kB
Release files / nage_ai-0.1.1.tar.gz
| Download URL | nage_ai-0.1.1.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f83daebb8a9ce47b818331d4ec8be12b62c6c1d0c19e90abdb049cb29339d8b
|
|
BLAKE2b-256 checksum How to use checksums |
aca1bd2d1fb80836fde96b08d8d11c522cce79eed8bc8183b214cf568ccf84bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / nage_ai-0.1.1-py3-none-any.whl
| Download URL | nage_ai-0.1.1-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c4238742bdb7365d2e7d40c78fecc1962df321d567490a0bfcb4e6bfdd35c184
|
|
BLAKE2b-256 checksum How to use checksums |
a60f2711cdd2d593aae0810648af0302c72a81c0e62eb51dd3c6963f1839fdbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for nage-ai 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.