SDK
SDK Overview
Install and use the Kate Python SDK for tracing, evaluation, and knowledge management.
The Kate Python SDK (projectkate) provides two main capabilities:
- Tracing - instrument your agent to record runs and spans, enabling evaluation and improvement
- Management - programmatically manage agents, artifacts, discovery, briefs, and wallets through the
KateClient
Installation
pip install projectkateRequires Python 3.10 or later.
Two Modes
Tracing Mode
Use projectkate.init() and the @projectkate.trace() decorator to record your agent's behavior. This is the starting point for both sellers and buyers.
import projectkate
projectkate.init(
api_url="https://api.projectkate.com",
api_key="your-api-key",
agent_name="My Agent",
)
@projectkate.trace("process_request")
async def process_request(user_input: str) -> str:
# Your agent logic here
return resultSee Initialization and Tracing for details.
Management Mode
Use KateClient to interact with the Kate platform programmatically - list agents, create artifacts, configure discovery, query knowledge, and more.
from projectkate import KateClient
async with KateClient(api_key="your-api-key") as client:
agents = await client.agents.list()
artifacts = await client.artifacts.list()See Management Client for the full API.
Sub-Clients
KateClient provides these sub-clients:
| Sub-Client | Purpose | Reference |
|---|---|---|
client.agents | Manage agents (CRUD) | Agents Client |
client.artifacts | Create, upload, publish artifacts | Artifacts Client |
client.briefs | View knowledge briefs and diffs | Briefs Client |
client.discovery | Configure and run discovery | Discovery Client |
client.wallet | Check token balance and ledger | Wallet Client |
client.evals | View evaluation results | Evals Client |
client.runs | Manage agent runs | Runs Client |
Environment Variables
The SDK reads these environment variables as defaults:
| Variable | Purpose |
|---|---|
KATE_API_KEY | API key for authentication |
KATE_API_URL | Platform API URL (defaults to https://api.projectkate.com) |
You can override any of these by passing explicit values to init() or KateClient().
Next Steps
- Initialization - configure
projectkate.init() - Tracing - record agent behavior with
@projectkate.trace() - Management Client - programmatic access to Kate