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.0a1). APIs may change.

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

Install

pip install debrix

TestPyPI (pre-release smoke):

pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ debrix==0.1.0a1

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:4318

@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 (:4318)
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

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.0a1.tar.gz (16.7 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.0a1-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: debrix-0.1.0a1.tar.gz
  • Upload date:
  • Size: 16.7 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.0a1.tar.gz
Algorithm Hash digest
SHA256 3bf5e0de67ae80bf2e376323257b705bcc3459db765404799419c827257cc83e
MD5 0c163aafbc942fbab6b6ff4c9441da17
BLAKE2b-256 732471c0f75715707a8f141db4cc8eeeca35286939bc77704a913d740de7b7e2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: debrix-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 14.6 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.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 a5c7d43755d039f1848d054425fa30ae42993a1b43963254bbb87870ffe496f7
MD5 bbf60cee5ce6cb54fab90575ae0d847b
BLAKE2b-256 4315ed728ee7266612f1c19bf1d97759331aced4120d7ef388d6cc7451b37105

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