When ReasonBlocks determines that the agent needs steering, it queries the pattern store and retrieves one or moreDocumentation Index
Fetch the complete documentation index at: https://reasonblocks.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
ETrace objects. Each ETrace represents a stored pattern — an instance-level memory, an abstracted failure signature, or a universal heuristic — ranked by similarity to the current trace context. The SDK then formats and injects the best-matching patterns into the system prompt before the next LLM call.
ETrace objects surface in StepAssessment.e1_match (the single best instance-level match) and StepAssessment.e2_matches (a list of pattern-level matches). You do not typically construct ETrace instances yourself; they are produced by the middleware during step assessment.
Fields
The tier of the retrieved pattern. One of:
"e1"— Instance-level. A record from a specific prior agent run (or the current run) that closely matches the current trace context. The most specific form of guidance."e2"— Pattern-level. An abstracted failure pattern derived from multiple instances. Less specific thane1but broader in applicability."e3"— Universal. A general heuristic or best-practice rule that applies regardless of the specific trace. Retrieved when no strong instance or pattern match is found.
Cosine similarity score in the range
[0.0, 1.0] indicating how closely this pattern matches the current trace context. Higher is a better match. The SDK uses recall_threshold (default 0.25) to filter out low-quality matches before returning results. A score of 1.0 means an exact vector match.Unique identifier for this pattern in the ReasonBlocks pattern store. You can use
pattern_id to look up or reference the pattern in the dashboard. Empty string if the pattern was not persisted (e.g., transient monitor-generated guidance).Raw pattern payload from the store. The exact keys depend on the pattern type, but typically include fields like
title, guidance, example, and tags. The middleware uses this dict when assembling the injection text. Inspect it if you need to understand the raw content of a retrieved pattern.Categorical failure label assigned by the server monitor during evaluation — for example
"loop", "hedge", "edit_revert", or "test_repeat". None if the pattern was not associated with a specific monitor failure. Useful for understanding what class of problem the injected guidance addresses.The model family this pattern was originally recorded against, e.g.
"claude-3", "gpt-4o", or "gemini-1.5". An empty string means the pattern is model-agnostic. The SDK uses this field when filtering patterns for model-specific guidance.Legacy alias for
tier, kept for compatibility with older callers. New code should read tier instead. Both fields carry the same value ("e1", "e2", or "e3").The
run_id of the agent run this pattern was originally recorded from, if applicable. For e1 patterns this is typically the trace that produced the matched memory. None for e3 universal patterns and for patterns inserted manually into the store.Where ETrace appears
ETrace objects are embedded in StepAssessment, which the middleware produces internally after each step:
The single highest-similarity
e1 match for this step, or None if no instance-level pattern cleared the similarity threshold.All
e2 (and e3) matches that cleared the similarity threshold, sorted by similarity descending. May be empty.Example
This example shows how to read retrieved pattern metadata from a completed run. Note thatStepAssessment objects are produced internally; you access the injected content via StepRecord and the full TraceState.