Skip to main content

Agent observability SDK for tracking AI agent execution

Project description

Cascade SDK

Agent observability platform for tracking AI agent execution, LLM calls, and tool usage.

Quick Start

Install from PyPI

pip install cascade-sdk

Setup hello

  1. Set your API key (get one from Cascade Dashboard):

    export CASCADE_API_KEY="your-api-key"
    
  2. Use in your code:

    from cascade import init_tracing, trace_run, wrap_llm_client, tool
    from anthropic import Anthropic
    import os
    
    # Initialize tracing (uses cloud endpoint by default)
    init_tracing(project="my_project")
    
    # Wrap LLM client
    client = wrap_llm_client(Anthropic(api_key=os.getenv("ANTHROPIC_API_KEY")))
    
    # Decorate tools
    @tool
    def my_tool(query: str, client) -> str:
        """My custom tool."""
        response = client.messages.create(
            model="claude-3-haiku-20240307",
            max_tokens=100,
            messages=[{"role": "user", "content": query}]
        )
        return response.content[0].text
    
    # Trace agent execution
    with trace_run("MyAgent", metadata={"task": "example"}):
        result = my_tool("What is AI?", client)
        print(result)
    
  3. View traces in the Cascade Dashboard

TypeScript (Node.js)

This repo also includes a Node.js TypeScript SDK under typescript/cascade-sdk/.

  • Docs: docs/INTEGRATIONS_TYPESCRIPT_SDK.md
  • Vercel AI SDK (TypeScript) OTEL export: docs/INTEGRATIONS_VERCEL_AI_SDK.md

Features

  • Zero setup - No backend services to run
  • Cloud-first - Traces automatically sent to cloud
  • LLM tracking - Automatic tracking of LLM calls (Anthropic, OpenAI, etc.)
  • Tool tracing - Decorate functions with @tool for automatic tracing
  • Rich metadata - Add custom metadata to traces
  • OpenTelemetry - Built on OpenTelemetry standards
  • Vercel AI SDK support - Ingest TypeScript OTEL spans (see docs/INTEGRATIONS_VERCEL_AI_SDK.md)

Configuration

Environment Variables

  • CASCADE_API_KEY - Your Cascade API key (required)
  • CASCADE_ENDPOINT - Override default endpoint (default: https://api.runcascade.com/v1/traces)

Custom Endpoint

If you need to use a custom endpoint:

init_tracing(
    project="my_project",
    endpoint="https://your-custom-endpoint.com/v1/traces",
    api_key="your-api-key"
)

CLI Commands

  • cascade info - Show setup instructions and information
  • cascade --help - Show help message
  • cascade --version - Show version

Development

This is a monorepo containing:

  • cascade/ - SDK package (published to PyPI)
  • backend/ - Backend service (not included in package)
  • dashboard/ - Frontend dashboard (not included in package)

Install SDK in Development Mode

pip install -e .

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

cascade_sdk-0.2.0b23.tar.gz (115.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cascade_sdk-0.2.0b23-py3-none-any.whl (66.2 kB view details)

Uploaded Python 3

File details

Details for the file cascade_sdk-0.2.0b23.tar.gz.

File metadata

  • Download URL: cascade_sdk-0.2.0b23.tar.gz
  • Upload date:
  • Size: 115.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for cascade_sdk-0.2.0b23.tar.gz
Algorithm Hash digest
SHA256 f2829d4f38e13548dbd17779a9e77f59c0a2ca2f8a7db011d2e0aaaa6c30deab
MD5 7fbdd6c5b21efc527e9ae586d70dec33
BLAKE2b-256 564c698b681426ee533ed82e085ec1788c2baf5e54c56c438119c9f4a7e591b9

See more details on using hashes here.

File details

Details for the file cascade_sdk-0.2.0b23-py3-none-any.whl.

File metadata

  • Download URL: cascade_sdk-0.2.0b23-py3-none-any.whl
  • Upload date:
  • Size: 66.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for cascade_sdk-0.2.0b23-py3-none-any.whl
Algorithm Hash digest
SHA256 6ba11b5e340f97986f5f54fe0a74a96a9401962cab06ae15e22838c2c7592ae8
MD5 9f22a6ae81b475944c99a0c0adebfa31
BLAKE2b-256 84ccb42143d234a70df88fe9c9c8d583eb5c8cee4af326c4ec721148d678dbde

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page