Skip to main content

Open-source instrumentation SDK for Debrix — local-first AI Agent DevTools

Project description

debrix

Open-source instrumentation SDK for Debrix — local-first AI Agent DevTools.

Status: alpha (0.1.0a3). APIs may change.

Requires the Debrix desktop app running locally to receive traces (OTLP/HTTP on localhost:17418).

Public source: goyal-prateek/debrix-sdk
(developed in the Debrix monorepo at packages/sdk-python, synced via scripts/publish-sdk.sh)

Install

pip install debrix

Quick start

from debrix import configure, force_flush, trace_agent, trace_tool, trace_span, SpanKind

configure(batch=False)  # OTLP/HTTP → http://127.0.0.1:17418

@trace_agent
def run_agent(query: str) -> str:
    return research(query)

@trace_tool(name="search")
def research(query: str) -> str:
    with trace_span("complete", kind=SpanKind.LLM) as span:
        span.record_messages([
            {"role": "system", "content": "You are helpful."},
            {"role": "user", "content": query},
        ])
        answer = "..."
        span.record_response({
            "content": answer,
            "usage": {"input_tokens": 10, "output_tokens": 5},
        })
        return answer

run_agent("hello")
force_flush()  # flush OTLP *and* conversation payload uploads before exit

Decorators also work as context managers:

with trace_agent("planner") as span:
    with trace_tool("lookup"):
        ...

Public API

Symbol Purpose
configure() Install OTLP/HTTP exporter to Debrix (:17418)
force_flush() Flush OTLP spans + pending /v1/payloads uploads (call before short scripts exit)
trace_agent Agent boundary (decorator or with trace_agent("name"))
trace_tool Tool call span; decorator records debrix.replay.input / output
trace_span Generic / LLM / custom span context manager
DebrixSpan.record_messages(...) Opt-in message payloads
DebrixSpan.record_response(...) Opt-in model output / tokens
SpanKind, Attr Semantic convention constants

Nested calls propagate via OpenTelemetry context. On exception, spans are marked ERROR with debrix.error.summary.

Develop

# from monorepo
cd packages/sdk-python
uv sync --group dev
uv run pytest

License

MIT

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

debrix-0.1.0a3.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

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

debrix-0.1.0a3-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file debrix-0.1.0a3.tar.gz.

File metadata

  • Download URL: debrix-0.1.0a3.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for debrix-0.1.0a3.tar.gz
Algorithm Hash digest
SHA256 9added072a7734fc11acf4c51995798a9c7c7df4aded1a59e0f875ca74c700a3
MD5 9d7e6e6598dd8e8b1eaa5ecdfda77e81
BLAKE2b-256 46cd5ab43e8f025a32a6945071b681158fca19bb31f32dfc164e34bde8f3162d

See more details on using hashes here.

File details

Details for the file debrix-0.1.0a3-py3-none-any.whl.

File metadata

  • Download URL: debrix-0.1.0a3-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for debrix-0.1.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 a04792249e132510ec84f4f8637f48ae021641f8634d5ec99187d4c5a95769bc
MD5 57af4c6d4ff0fa23cae67138e58e3c18
BLAKE2b-256 6b3c9c73c213f24d4b204b0e5b84148dd43582365c4de103df2123f95854c647

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