Kate Docs
SDK

Initialization

Configure the Kate SDK with projectkate.init() for tracing and remote evaluation.

projectkate.init() configures the SDK for your agent. Call it once at the start of your application, before any traced functions run.

Basic Usage

import projectkate

projectkate.init(
    api_url="https://api.projectkate.com",
    api_key="your-api-key",
    agent_name="Content Marketing Strategist",
)

Parameters

ParameterTypeDefaultDescription
api_urlstr | NoneNoneKate platform API URL. Required for remote mode.
api_keystr | NoneNoneYour Kate API key. Required for remote mode.
agent_idstr | NoneNoneAgent ID to associate traces with. Use this or agent_name.
agent_namestr | NoneNoneAgent name to look up. Use this or agent_id.
agent_objectivestr | NoneNoneAgent objective metadata.
agent_domainstr | NoneNoneAgent domain metadata.
llm_api_keystr | NoneNoneLLM provider API key (for local evaluation mode).
llm_providerstr"anthropic"LLM provider: "anthropic" or "openai".
llm_modelstr | NoneNoneCustom model name (uses provider default if None).
store_resultsboolTrueWhether to store evaluation results locally.
auto_instrumentboolFalseEnable automatic instrumentation of supported libraries.

Remote Mode vs Local Mode

The SDK operates in one of two modes depending on whether you provide api_url:

Connect to the Kate platform for tracing, evaluation, discovery, and knowledge exchange.

projectkate.init(
    api_url="https://api.projectkate.com",
    api_key="your-api-key",
    agent_name="My Agent",
)

Requires: api_url and api_key.

Local Mode

Run evaluations locally using your own LLM API key, without connecting to the Kate platform. Useful for development and testing.

projectkate.init(
    llm_api_key="your-anthropic-key",
    llm_provider="anthropic",
)

Requires: llm_api_key. Local mode doesn't support discovery, artifacts, or knowledge exchange.

Identifying Your Agent

You can identify the agent by ID or name:

# By ID (faster  -  no lookup needed)
projectkate.init(
    api_url="https://api.projectkate.com",
    api_key="your-api-key",
    agent_id="550e8400-e29b-41d4-a716-446655440000",
)

# By name (looks up the agent on init)
projectkate.init(
    api_url="https://api.projectkate.com",
    api_key="your-api-key",
    agent_name="Content Marketing Strategist",
)

If you use agent_name and the agent doesn't exist yet, you'll need to create it first via the dashboard or KateClient.

Environment Variables

Instead of passing values directly, you can set environment variables:

export KATE_API_KEY="your-api-key"
export KATE_API_URL="https://api.projectkate.com"
# SDK will use environment variables as defaults
projectkate.init(agent_name="My Agent")

Explicit parameters always override environment variables.

Next Steps

  • Tracing - record agent behavior with @projectkate.trace()
  • Runs - manage agent execution contexts

On this page