atlanai
Python SDK for the Atlan Agent Gateway: manage agents, skills, sessions, and workspaces, and optionally trace what your agents do.
Install
pip install atlanai
Tracing is a separate extra — it pulls in OpenTelemetry, which a management-only install doesn't need:
pip install 'atlanai[tracing]'
Quickstart
from atlanai import AtlanClient
client = AtlanClient(
"https://<your-gateway-host>",
bearer_token="<your-api-token>",
)
agent = client.agents.create({
"name": "support-triage",
"workspace_id": "workspace_01example",
})
page = client.agents.list(limit=10)
print(f"{len(page.items)} agents")
Methods read as client.<resource>.<action> — client.agents.get(agent_id),
client.sessions.messages.create(session_id, {...}), and so on. Every public
Agent Gateway operation is reachable this way; nothing requires reaching into
a generated client directly.
Pass a default workspace once instead of repeating it on every call:
client = AtlanClient(gateway_url, bearer_token=token, workspace="workspace_01example")
Start an eval run
Resolve an existing dataset by artifact ID or exact name, then create the Registry experiment before the runner emits any traces:
from atlanai import ContextItem, ContextManifest, start_experiment
context = ContextManifest([
ContextItem(
kind="file",
name="CLAUDE.md",
version="git:0123456789abcdef0123456789abcdef01234567",
digest="sha256:" + "0" * 64,
),
])
run = start_experiment(
client,
"conversational-studio-daily", # exact name, or dataset_... ID
{"name": "candidate-run", "config": {"model": "example-model"}},
context_manifest=context,
)
with run.trace():
output = existing_runner()
run.experiment is the generated create response and run.id is its
experiment_id. The helper pins the resolved dataset version and context
manifest in the immutable experiment config. run.trace() reuses the tracing
SDK to stamp only the experiment join and context-manifest digest on spans.
Execution, result upload, summarization, and terminal status remain the existing
client.experiments operations.
Tracing
import atlanai.tracing as atlan
tracer = atlan.init(api_key="<your-tracing-key>", workspace_id="workspace_01example")
with tracer.start_as_current_span("handle-request", as_type="task") as span:
span.update(model="claude-sonnet-5", usage={"input_tokens": 120, "output_tokens": 40})
Tracing has its own API key and lifecycle — it does not reuse the management client's bearer token or transport.
Errors
Every non-2xx response raises AtlanAPIError, with .status, .code, and
(where the gateway includes one) .trace_id:
from atlanai import AtlanAPIError
try:
client.agents.get("agent_does_not_exist")
except AtlanAPIError as error:
print(error.status, error.code)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file atlanai-0.2.1.tar.gz.
File metadata
- Download URL: atlanai-0.2.1.tar.gz
- Upload date:
- Size: 650.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
024a41f35434da57b55aabf7164502612f806c7e29b96accf72c3de5900dd8a5
|
|
| MD5 |
702e57c6b3494f412c7042d45a8a3e4f
|
|
| BLAKE2b-256 |
0adc604014268d298bcac634eb097e0557d63f202f7b982b25359cfd88195cb3
|
File details
Details for the file atlanai-0.2.1-py3-none-any.whl.
File metadata
- Download URL: atlanai-0.2.1-py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
517fdf01e30f507c28374a5a4772dff0f611726729b580edbe2b730a06e20fc0
|
|
| MD5 |
ab70db5cc6f9a30b2e0c95ecf8dd6bd7
|
|
| BLAKE2b-256 |
880f4ca592e2dfc4101f257ceae70ded081926ca201840b0cd1a6d61a469de45
|