Python over HTTP
Northsun (formerly Mnemix) does not currently publish an official Python SDK from this repository. Python applications should use the frozen REST API directly with httpx or another maintained HTTP client; this avoids fictional package names and keeps the contract explicit.
Install an HTTP client
python -m pip install httpx
Create a shared client
import os
import httpx
client = httpx.Client(
base_url="https://mcp.mnemix.ai",
headers={"Authorization": f"Bearer {os.environ['MNEMIX_API_KEY']}"},
timeout=5.0,
)
Keep MNEMIX_API_KEY in a server-side secret store. Do not place it in a notebook you plan to share.
Host migration: the canonical platform host is moving to
mcp.northsun.ai. During the transitionmcp.mnemix.aicontinues to serve the full surface unchanged — existing integrations keep working, no action required. When the successor host is generally available, responses from this host will carry aDeprecationheader (RFC 9745) and aLink rel="successor-version"header pointing at the correspondingmcp.northsun.aiURL; a retirement date, if one is ever set, will be announced in advance with aSunsetheader (RFC 8594). No cutoff is scheduled.
Recall and enrich
response = client.post(
"/v1/recall_and_enrich",
json={
"phone_number": "+15551234567",
"trigger": "answered",
"session_id": "call_01",
},
)
response.raise_for_status()
packet = response.json()
print(packet["caller"]["name"])
print(packet["memory"]["summary"])
Write back after the call
response = client.post(
"/v1/calls/end",
json={
"phone_number": "+15551234567",
"session_id": "call_01",
"transcript": [
{"role": "user", "text": "Please call me Tuesday.", "ts_ms": 0},
{"role": "agent", "text": "I will note that request.", "ts_ms": 2400},
],
"duration_s": 18,
"outcome": "callback_requested",
},
)
response.raise_for_status()
assert response.status_code == 204
Read a caller
from urllib.parse import quote
phone = quote("+15551234567", safe="")
response = client.get(f"/v1/caller/{phone}")
For production code, URL-encode the phone number so the leading + becomes %2B. Treat 404 as an unknown caller, not as an authentication failure.
Retry deliberately
Retry timeouts, 429, and temporary 5xx responses with capped exponential backoff and jitter. Do not retry invalid JSON, validation errors, or authentication failures unchanged. See Errors and retries.
Python SDK status
Any older document showing a mnemix Python package or methods such as client.recall_and_enrich() is draft evidence until an official package, version, and contract are source-proved. This HTTP guide is the supported documentation path today.
Next steps
- API reference — exact route contracts.
- Authentication — key handling and tenant scope.
- Production readiness — launch checklist.