NeoSigma tracing SDK — wrap your agents, emit OpenTelemetry spans to NeoSigma
Project description
neosigma-sdk
Trace your AI agents and ship the results to NeoSigma. Add a few lines, run your agents as usual, and every run's model calls, tool calls, and token usage lands in NeoSigma as a structured OpenTelemetry trace.
- Dark by default: with no API key (and
NEOSIGMA_CONSOLE_EXPORT=false) the SDK is a complete no-op and never touches your application's own OpenTelemetry setup, so it's safe to leave in place. - Provider-agnostic: a small core with thin adapters that wrap the agent framework you already use, with no hard dependency on any provider SDK.
Install
pip install neosigma-sdk
# or: uv add neosigma-sdk
Quickstart
import neosigma_sdk as neosigma
neosigma.init() # reads NEOSIGMA_API_KEY from the environment
# ... wrap your agent client with the adapter for your framework and run as usual ...
neosigma.shutdown() # flush before exit (long-running servers flush in the background)
Anthropic Managed Agents is supported today, with more frameworks on the way. See the documentation for per-adapter setup and the full API.
Example: Anthropic Managed Agents
import anthropic
import neosigma_sdk as neosigma
neosigma.init()
client = neosigma.wrap_managed_agents(anthropic.Anthropic())
# Build and run a Managed Agents session as you normally would. Streaming the
# session produces one NeoSigma trace: model calls, tool calls, and token usage.
session = client.beta.sessions.create(agent=agent, environment_id=environment.id)
with client.beta.sessions.events.stream(session_id=session.id) as stream:
for event in stream:
...
neosigma.shutdown()
AsyncAnthropic works the same way (async with / async for).
Configuration
Common settings read from a NEOSIGMA_* environment variable, or can be passed to
init(...):
| Variable | Default | Purpose |
|---|---|---|
NEOSIGMA_API_KEY |
(none) | Your ns_live_... key. Required to export, without it the SDK stays dark. |
NEOSIGMA_PROJECT |
default |
Logical project name, attached to every trace. |
NEOSIGMA_OTEL_ENDPOINT |
NeoSigma cloud | OTLP/HTTP endpoint. Override to target another environment. |
NEOSIGMA_CONSOLE_EXPORT |
false |
Also print spans to stdout, for local debugging. |
See the NeoSigma documentation for the complete configuration reference and API docs.
License
Released under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file neosigma_sdk-0.1.0.tar.gz.
File metadata
- Download URL: neosigma_sdk-0.1.0.tar.gz
- Upload date:
- Size: 25.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3df75b0c12cbbad1bac91ad67299e70ced6eff5f5a94d3359b951eaee0792804
|
|
| MD5 |
08f7cbad315d2592163bc030aa60ddbc
|
|
| BLAKE2b-256 |
3110e85670e1c6306dda9137e21da900981aa26700817cb2053fa2b56561a285
|
File details
Details for the file neosigma_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: neosigma_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
add0ffb7d067d8bebdd4c6ce67b28c36fd01443c18d87050577660d5aeb315f4
|
|
| MD5 |
6fb8868b6ddbe8305c8d591533d1b36d
|
|
| BLAKE2b-256 |
62581dd7d203b1c3d7abd4b9f2eb642b011e69b3e10825136f415bd3ecff55cc
|