Tracify Python SDK
Observability and tracing for AI agents. Gain full visibility into your agent's decision-making process, tool usage, and LLM costs.
Installation
pip install tracify-sdk
Quickstart
- Get your API Key from the Tracify Dashboard.
- Set it as an environment variable:
export TRACIFY_API_KEY=your_sk_live_...
- Instrument your agent:
from tracify import trace_agent, llm_call, tool_call
@trace_agent()
async def my_agent(query: str):
# LLM Call
llm_call(
input_data=query,
output_data="Thinking...",
model_id="gpt-4o",
cost_usd=0.002,
latency_ms=800
)
# Tool Use
tool_call(
tool_name="web_search",
input_data={"q": query},
output_data="Found results...",
latency_ms=1200
)
return "Final Answer"
Features
- @trace_agent Decorator: Automatically captures run lifecycle and errors.
- Granular Spans: Manually record LLMs, tools, and custom decisions.
- Cost Tracking: Monitor your infrastructure spend in real-time.
- Asynchronous & Synchronous Support: Works with
async/awaitor standard functions. - Session context: Attach
session_id,end_user_id,environment,release, andtagsto connect related traces.
Feedback and evaluation scores
Pass project_id when constructing the client to attach end-user feedback and typed scores to traces:
client = TracifyClient(project_id="your-project-id")
client.feedback(run_id, True, kind="thumb", comment="Helpful answer")
client.score(run_id, "answer_quality", 0.92, data_type="numeric")
Feedback and scores use the same API key as ingestion and do not interrupt the agent when delivery fails.
Prompt deployment
Resolve a deployed prompt without shipping a new application build:
deployed = client.get_prompt("support-agent", "production")
client.ingest(spanType="llm", input=question, output=answer, promptVersionId=deployed["version"]["id"])
Prompt responses are cached for 60 seconds by default. Use cache_ttl_seconds=0 or provide a fallback for development and guaranteed-availability behavior.
License
MIT
Metadata
Release files for tracify-sdk 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| tracify_sdk-0.2.0.tar.gz | 11.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tracify_sdk-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.4 kB
Release files / tracify_sdk-0.2.0.tar.gz
| Download URL | tracify_sdk-0.2.0.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3eb620451db336327260ccfdc414a758b6fc9c9a4874591c6816b138d3d5383e
|
|
BLAKE2b-256 checksum How to use checksums |
abe8f78ddf4e3a0691b77fd1a68c3dea4f8a4a6218dd0e833edaa0d779483033
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / tracify_sdk-0.2.0-py3-none-any.whl
| Download URL | tracify_sdk-0.2.0-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a73d06fadeab5346a059f5ede9a4bb81bee25d64af27d68f295d7c5434e5dad2
|
|
BLAKE2b-256 checksum How to use checksums |
b56cbe85ae7c18d62fae4ba9e800e33e558ed5ef5c572ba99147813542615d83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Security for tracify-sdk 0.2.0
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.