Skip to main content
Copy this into your agent. No new dependencies, no pip install.
import httpx
import threading

MUSTER_URL = "https://app.getmuster.io"

def muster_emit(job_id: str, agent_id: str, checks: list, **kwargs):
    """Fire-and-forget quality signal. Never blocks, never raises."""
    def _send():
        try:
            httpx.post(
                f"{MUSTER_URL}/api/v1/jobs/{job_id}/quality",
                json={"agent_id": agent_id, "job_id": job_id,
                      "overall_passed": all(c.get("passed", True) for c in checks),
                      "checks": checks, **kwargs},
                timeout=2.0,
            )
        except Exception:
            pass
    threading.Thread(target=_send, daemon=True).start()
Use it after every job:
muster_emit(
    job_id=job_id,
    agent_id="invoice-processor-v2",
    checks=[
        {"check_id": "output_not_empty",    "severity": "HIGH", "passed": bool(output)},
        {"check_id": "subtotal_arithmetic", "severity": "HIGH",
         "passed": abs(computed - declared) < 0.01,
         "expected": str(declared), "actual": str(computed)},
    ],
    token_input=1247,
    token_output=312,
    model="gpt-4o",
    latency_ms=1840,
)
That’s it. Drop it anywhere in your codebase — no framework, no setup.

Optional: muster-sdk pip package

If you’d rather use a pip package:
pip install muster-sdk
from muster_sdk import beacon, quality

beacon.register(agent_id="invoice-processor-v2")

quality.emit(
    job_id=job_id,
    checks=[
        quality.Check("output_not_empty",    "HIGH", bool(output)),
        quality.Check("subtotal_arithmetic", "HIGH",
                      abs(computed - declared) < 0.01,
                      expected=str(declared), actual=str(computed)),
    ],
    token_input=1247,
    token_output=312,
    model="gpt-4o",
)
The SDK does the same thing as the snippet above — it’s a convenience wrapper, not a requirement.

Check reference

FieldRequiredDescription
check_idYesSnake_case identifier, e.g. subtotal_arithmetic
severityYesHIGH, MEDIUM, or LOW
passedYesTrue or False
expectedNoWhat the correct value should be
actualNoWhat the agent actually produced
deltaNoNumeric difference (for math checks)
messageNoFree-text explanation

Universal

check_idseverity
output_not_emptyHIGH
no_refusal_in_outputMEDIUM
latency_within_slaMEDIUM

Finance / invoice agents

check_idseverity
subtotal_arithmeticHIGH
tax_calculationHIGH
required_fields_presentHIGH
output_schema_validHIGH

Classification agents

check_idseverity
decision_is_valid_enumHIGH
decision_has_rationaleHIGH
classification_confidenceMEDIUM

Document review agents

check_idseverity
clause_identificationHIGH
risk_flag_presentHIGH
source_citedHIGH