Skip to main content

Decisions

The decision store records every evaluation that Memintel performs — triggered or not. Each record is immutable: written once, never modified. Calibrations, guardrails updates, and task changes all create new versions — historical decisions are untouched.


List Decisions

GET /decisions

Returns a paginated list of decision records. Filter by entity, condition, outcome, or time range.

Query Parameters

ParameterTypeRequiredDescription
entity_idstringOptionalFilter to decisions for a specific entity.
condition_idstringOptionalFilter to decisions for a specific condition.
condition_versionstringOptionalFilter to a specific condition version. Requires condition_id.
outcomeenumOptionaltriggered | not_triggered.
fromdatetimeOptionalISO 8601 UTC. Start of time range (inclusive).
todatetimeOptionalISO 8601 UTC. End of time range (inclusive).
limitintegerOptionalDefault 50. Maximum 200.
cursorstringOptionalPagination cursor from previous response.

Response

ParameterTypeDescription
itemsarrayArray of decision records. See Decision Record below.
has_morebooleanWhether more results are available.
next_cursorstring | nullPass as cursor on the next request.

Response Codes

StatusDescription
200Decision list.
400Invalid filter parameters.
401Unauthorised.

TypeScript Example

// All triggered decisions for an account in the last 30 days
const decisions = await client.decisions.list({
entityId: "account_xyz789",
outcome: "triggered",
from: "2025-10-01T00:00:00Z",
to: "2025-10-31T23:59:59Z",
});

decisions.items.forEach(d => {
console.log(d.decision_id, d.outcome, d.evaluated_at);
});

Get Decision

GET /decisions/{decision_id}

Returns the full decision record for a specific decision.

Path Parameters

ParameterTypeRequiredDescription
decision_idstringRequiredUnique decision identifier.

Response — Decision Record

ParameterTypeDescription
decision_idstringUnique identifier for this decision.
condition_idstringThe condition that evaluated this decision.
condition_versionstringThe specific condition version that was active.
concept_resultobjectThe computed concept value that was evaluated (value, type).
input_primitivesobjectThe raw primitive values that drove the concept, keyed by primitive ID.
signal_errorsarrayWhich signal fetches failed during evaluation, with error details — distinguishes connector failure from legitimate null.
threshold_appliednumber | nullThe exact parameter value in effect at decision time. null for equals and composite strategies.
strategystringThe strategy type applied (threshold, percentile, z_score, change, equals, composite).
outcomeenumtriggered | not_triggered.
action_idstring | nullThe action that was taken (if triggered).
entity_idstringThe entity this decision relates to (pseudonymised).
evaluated_atdatetimeISO 8601 UTC timestamp of evaluation.
ir_hashstringSHA-256 hash of the execution graph — machine-verifiable proof that the logic was unchanged.

Response Codes

StatusDescription
200Decision record.
401Unauthorised.
404Decision not found.

TypeScript Example

const decision = await client.decisions.get("dec_abc123");

console.log(decision.outcome); // "triggered"
console.log(decision.threshold_applied); // 0.35
console.log(decision.input_primitives); // { "account.active_user_rate_30d": 0.29, ... }
console.log(decision.ir_hash); // "sha256:7f3a9c..."

Explain Decision

POST /decisions/explain

Returns a plain-English explanation of a specific decision: the Result (Rₜ) that was evaluated, the strategy and parameters applied, whether the condition fired, and the contribution of each input signal.

This endpoint is grounded entirely in the stored decision record — it does not re-evaluate anything. The explanation is safe to include in audit documentation.

Boolean strategies (threshold, percentile, change, z_score, composite): decision is true/false. threshold_applied contains the numeric cutoff compared against the Result (Rₜ).

Equals strategy: decision is the matched label string. label_matched contains it explicitly. threshold_applied is null.

Request Body

ParameterTypeRequiredDescription
condition_idstringRequiredFully qualified condition identifier.
condition_versionstringRequiredExplicit condition version.
entitystringRequiredEntity the Decision (Aₜ) was made for.
timestampdatetimeRequiredISO 8601 UTC. Retrieves the stored Decision (Aₜ) at this timestamp.

Response — DecisionExplanation

ParameterTypeRequiredDescription
decision_typeenumAlwaysboolean | categorical.
decisionboolean|stringAlwaysDecision (Aₜ) value: true/false or matched label.
concept_valuenumber|stringAlwaysThe Result (Rₜ) that was evaluated.
strategy_typeenumAlwaysthreshold | percentile | change | z_score | equals | composite.
threshold_appliednumberConditionalNumeric cutoff. Present for threshold, percentile, change, z_score. null for equals, composite.
label_matchedstringConditionalMatched label for equals strategy. null if no match.
driversarrayAlwayssignal, contribution, value per input signal.

Response Codes

StatusDescription
200DecisionExplanation.
401Unauthorised.
404Decision not found.

TypeScript Example

// Boolean decision
const exp = await client.decisions.explain({
conditionId: "org.high_churn",
conditionVersion: "1.0",
entity: "user_abc123",
timestamp: "2024-03-15T09:00:00Z",
});

console.log(exp.decision_type); // "boolean"
console.log(exp.decision); // true (Aₜ)
console.log(exp.concept_value); // 0.87 (Rₜ)
console.log(exp.threshold_applied); // 0.8

// Categorical decision (equals strategy)
const cat = await client.decisions.explain({
conditionId: "org.segment_check",
conditionVersion: "1.0",
entity: "user_abc123",
timestamp: "2024-03-15T09:00:00Z",
});

console.log(cat.decision_type); // "categorical"
console.log(cat.decision); // "high_risk"
console.log(cat.threshold_applied); // null