Python SDK for the Ambertrace neurosymbolic AI platform API
Project description
AmbertraceAI Python SDK
Python client for the Ambertrace neurosymbolic AI platform API.
Install
pip install ambertraceai
Quick Start
from ambertraceai import AmbertraceAPI
api = AmbertraceAPI(
base_url="https://app.ambertrace.ai",
api_key="at_...",
)
# Create a domain
domain = api.domains.create(
name="Legal Contracts",
description="Contract analysis for risk and compliance",
)
# Upload data
dataset = api.datasets.upload(
domain_id=domain["id"],
file_path="contracts.csv",
)
# Build a platform (async — returns a job)
result = api.platforms.create(
domain_id=domain["id"],
dataset_id=dataset["id"],
)
# Wait for the build to finish
job = api.wait_for_job(result["job_id"], timeout=600)
# Query the platform
answer = api.platforms.query(
platform_id=result["platform_id"],
query="What are the highest-risk clauses?",
)
print(answer["answer"])
print(answer["explanation"])
Resources
| Resource | Methods |
|---|---|
api.domains |
list, create, get, update, delete, build_ontology |
api.datasets |
list, get, upload, fetch, quality, clean, preview, delete |
api.platforms |
list, create, get, status, query, suggest_rules, list_suggestions, graph |
api.predictions |
predict, list_configs, create_config, train, list_predictions |
api.jobs |
get |
api.api_keys |
list, create, revoke |
Agent Keys
AI agents authenticate with user-scoped API keys that give full lifecycle access (domains, datasets, platforms, rules, predictions). A human creates the key from the dashboard; the agent can then create narrower platform-scoped keys for its integrations.
# Agent creates a platform-scoped key for a specific integration
platform_key = api.api_keys.create(
scope="platform",
platform_id=42,
name="Slack Integration",
)
# List keys visible to this agent
keys = api.api_keys.list()
# Revoke a platform key the agent created
api.api_keys.revoke(platform_key["id"])
User-scoped keys cannot create other user-scoped keys (no self-replication). Chat, conversations, and billing remain human-only.
Job Polling
Long-running operations (platform builds, data cleaning, training) return a job_id. Use wait_for_job to poll:
job = api.wait_for_job(job_id, timeout=300, poll_interval=5)
if job["status"] == "error":
print(f"Failed: {job.get('error_message')}")
Error Handling
from ambertraceai import AmbertraceAPI, AmbertraceError
try:
api.domains.get(999)
except AmbertraceError as e:
print(e.status_code) # 404
print(e.code) # "not_found"
print(str(e)) # "Domain not found."
API Documentation
Full API reference: app.ambertrace.ai/openapi/redoc
Project details
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 ambertraceai-0.2.0.tar.gz.
File metadata
- Download URL: ambertraceai-0.2.0.tar.gz
- Upload date:
- Size: 26.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0b4b73c245b41ab6968581101913d8216df9b3dbe49361ab552d7ce3ebfa73e
|
|
| MD5 |
f16b23bcf40e479088fd3a642fa53c97
|
|
| BLAKE2b-256 |
cdf26c606de6c2627c1a309b1f3e62e8937ce0c1fc420b064a45a5d4d60fcb26
|
Provenance
The following attestation bundles were made for ambertraceai-0.2.0.tar.gz:
Publisher:
publish.yml on Pilot-Generative-AI/ambertraceai-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ambertraceai-0.2.0.tar.gz -
Subject digest:
e0b4b73c245b41ab6968581101913d8216df9b3dbe49361ab552d7ce3ebfa73e - Sigstore transparency entry: 1672289021
- Sigstore integration time:
-
Permalink:
Pilot-Generative-AI/ambertraceai-python@342f1de1d31f7da3098bea43dd21a78a119224b4 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Pilot-Generative-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@342f1de1d31f7da3098bea43dd21a78a119224b4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ambertraceai-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ambertraceai-0.2.0-py3-none-any.whl
- Upload date:
- Size: 107.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83f88bd25133f3cf9bf8cc8f3f9f88a13c0c619727b6a9a2bfeebcebdded52ab
|
|
| MD5 |
a7e2dcfa89e4a2737f09bb71db022420
|
|
| BLAKE2b-256 |
0ce1aa5f0a8889ae50f68ae83379415ea80860eb92dd25f62c0bf7af30569747
|
Provenance
The following attestation bundles were made for ambertraceai-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on Pilot-Generative-AI/ambertraceai-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ambertraceai-0.2.0-py3-none-any.whl -
Subject digest:
83f88bd25133f3cf9bf8cc8f3f9f88a13c0c619727b6a9a2bfeebcebdded52ab - Sigstore transparency entry: 1672289029
- Sigstore integration time:
-
Permalink:
Pilot-Generative-AI/ambertraceai-python@342f1de1d31f7da3098bea43dd21a78a119224b4 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Pilot-Generative-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@342f1de1d31f7da3098bea43dd21a78a119224b4 -
Trigger Event:
release
-
Statement type: