Python SDK
Use the Python client when you are building server-side Python code or automation.
The Python SDK is a thin client over the public REST API.
It keeps the same surface as the platform, but in Python method form.
Install and initialize
Install
pip install axisdreamAsync client
from axisdream import AsyncAxisdream
cog = AsyncAxisdream()
space = await cog.space("my-space")Sync client
from axisdream import Axisdream
with Axisdream() as cog:
space = cog.space("my-space")Core methods
MethodPurpose
space.retrieve(query, ...)
Find relevant context
space.fetch(path | paths)
Read one or more exact files
space.add(path, content, bucket, topic, ...)
Create or replace a file
space.list(folder)
Browse a folder
space.update(path, changes, ...)
Apply a targeted edit
space.forget(path)
Delete a file
space.update_confidence(path, confidence)
Change a file confidence score
space.get_related_files(path, rel_type)
See directly related files
space.get_tools()
Fetch the live public tool list
Typical flow
Search, write, read
results = await space.retrieve("release checklist", query_variants=[
{"query": "focused release checklist intent", "kind": "rewrite"},
{"query": "a passage about a release checklist", "kind": "hyde"},
{"query": "release checklist ship confidence", "kind": "exact"},
])
related = [item.file_path for item in results.results]
await space.add(
path="knowledge/release-checklist.md",
content="# Release checklist\n\nShip with confidence.",
bucket="knowledge",
topic="release",
related=related,
)
file = await space.fetch("knowledge/release-checklist.md")
print(file.content)Error handling
Catch authentication, not-found, and rate-limit errors in the SDK just like you would with any API client.