Install
Set your API key
Instrument your pipeline
Add@span decorators from aevyra_witness.runtime to the functions you want
Origin to reason about. Each decorated function becomes a node in the execution
trace:
optimize=True and prompt_id= flags on answer tell Origin (and
downstream Reflex) that this span’s behaviour is controlled by a prompt that can
be rewritten. Spans without these flags — tools, retrievers, routers — can still
be diagnosed; their fix_type just won’t be "prompt".
Run the diagnosis
diagnose_pipeline handles everything: runs your agent under a Witness tracer,
captures the trace, scores it with your judge, and runs all three attribution
methods. No separate tracing step, no pre-captured trace file needed.
Read the output
- severity — whether this span was the primary cause or a contributing factor
- confidence — how certain Origin is (0.0–1.0)
- fix_type — where the repair effort belongs
fix=retrieval) and a
routing misclassification (fix=routing). Rewriting the answer prompt
won’t help much — fixing the retriever will.
Without a Verdict judge
Pass anyCallable[[AgentTrace], float] as judge=:
Using a pre-captured trace
Already have a trace? Use the raw on-ramp:Routing results to Reflex
result.by_prompt() rolls span-level blame up to the prompt level — one entry
per prompt_id, with mean confidence and max severity across all call sites:
fix_type="prompt" culprits are meaningful inputs to Reflex — if Origin
says fix=retrieval, update the index rather than the prompt.
Next steps
Tutorial
Full walkthrough of a plan-act-respond agent
Methods
When to use critic, decomposition, and ablation
API reference
Full Attribution and NodeAttribution reference
Reflex
Automatically rewrite culprit prompts