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

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

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: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.0a2.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.0a2-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: debrix-0.1.0a2.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.0a2.tar.gz
Algorithm Hash digest
SHA256 0b6c656cd5381e6586f7b49485fa487414aaa4f4ea45cf601b096e5b33d71315
MD5 c5a3143c4b7412913f7aace569277d27
BLAKE2b-256 cd84193742cf45b8443d4839a94d20243ec92d3c7ed53c35ddb07edccf423f53

See more details on using hashes here.

File details

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

File metadata

  • Download URL: debrix-0.1.0a2-py3-none-any.whl
  • Upload date:
  • Size: 14.5 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.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 223c3e4c8ffee20b7ee51887fca23e99a9d965807c02ba0f9118ccfe827c6d07
MD5 0f892a8051606c20887bad7bd3e87736
BLAKE2b-256 4e79d78010f12e61fdfa45f3353d9a0ee4a3d8bf7342ed0900ba099ae7e17c59

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