Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

convergent-sdk

Records the runs of your Python AI agents as OpenTelemetry spans and sends them to your Convergent workspace.

Install

pip install convergent-sdk

Set your key

Mint an ingestion key at app.convergent.dev/workspace/settings.

export CONVERGENT_API_KEY="cvk_xxxxxxxxxxxxxxxx"
export GIT_SHA=$(git rev-parse --short HEAD)

CONVERGENT_API_KEY is the only environment variable the SDK requires. The export is the local form. In a deployment the key belongs in your secrets manager or your platform's environment configuration.

GIT_SHA is this page's way of naming a release: init(release=...) below takes it, and it ties every trace to the version of your code that produced it. Any string that names a version works: a git sha, a build id, an image tag, a date.

Instrument with a coding agent

If you use Claude Code, Cursor, or another coding agent, hand it the skill in the repository. Clone the repository, copy the skill into your project, and ask the agent to add Convergent tracing to your agent:

git clone https://github.com/convergent-technologies/convergent-sdk
cp -r convergent-sdk/skills/instrument /path/to/your/project/.claude/skills/instrument

The skill has the agent list what one run touches, confirm that list with you, wrap each part, and then read the recorded spans back against the list. The section below is the same work done by hand.

Trace a run

Call init() once at startup, and put agent() on the function that handles one request. The model call inside it is the one your app already makes, and this one is the OpenAI client. Save it as app.py.

import os

from openai import OpenAI

import convergent

convergent.init(release=os.environ["GIT_SHA"])

client = OpenAI()
MODEL = "gpt-5.5"


@convergent.agent(name="support-agent")
def answer(question: str) -> str:
    with convergent.span(name=MODEL, operation="model_call") as call:
        call.set_input({"question": question})
        completion = client.chat.completions.create(
            model=MODEL,
            messages=[{"role": "user", "content": question}],
        )
        reply = completion.choices[0].message.content
        call.set_output({"answer": reply})
        call.set_attribute("gen_ai.request.model", MODEL)
        call.set_attribute("gen_ai.usage.input_tokens", completion.usage.prompt_tokens)
        call.set_attribute("gen_ai.usage.output_tokens", completion.usage.completion_tokens)
    return reply


print(answer("Where is my invoice?"))
convergent.flush()
pip install openai
export OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxx
GIT_SHA=$(git rev-parse --short HEAD) python app.py

That records one agent run with one model call inside it, carrying the prompt, the answer, the model, and the token counts. Any other model client goes in the same place, and the trace keeps the same shape.

Documentation

This README is the companion document to github.com/convergent-technologies/convergent-sdk, and everything past this point lives there.

git clone https://github.com/convergent-technologies/convergent-sdk

The full documentation is under python/docs/: confirming a run arrived with check(), instrumenting your agent by hand, attaching to an existing OpenTelemetry setup, the integration packages, configuration, the API reference, the attribute spellings Convergent reads, and troubleshooting.

skills/instrument/ is the skill from the coding-agent section above.

python/examples/ holds runnable examples: the run above as a self-contained file that needs no OpenAI key, and one trace recorded across a dispatcher and three worker processes.

Metadata

Release files for convergent-sdk 0.0.5b1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for convergent-sdk 0.0.5b1
File Size Uploaded Provenance
convergent_sdk-0.0.5b1.tar.gz 58.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for convergent-sdk 0.0.5b1
File Interpreter ABI Platform
convergent_sdk-0.0.5b1-py3-none-any.whl Python 3 none any Details

Total release size: 126.4 kB

Release files / convergent_sdk-0.0.5b1.tar.gz

Download URL convergent_sdk-0.0.5b1.tar.gz
Size 58.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e76190af31ce63db2ef55c22afe5c0c51852e1e3fd1207936be34d41708833d5
BLAKE2b-256 checksum
How to use checksums
59408fb08f12edf1d4aa18d50e45dcdd812d844cd0375bd84f560d405344f379
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / convergent_sdk-0.0.5b1-py3-none-any.whl

Download URL convergent_sdk-0.0.5b1-py3-none-any.whl
Size 67.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b814d1adf9101932e8cabfe5db067f2b3e3e14746297d962e38f2981c20bdcf
BLAKE2b-256 checksum
How to use checksums
c6fe995f20ded4b5fa1f430136ead23a3450510be4b6c7b2a25c542aaf35dc0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for convergent-sdk 0.0.5b1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page