4 Tools

Decision Tools

Log, track, and learn from decisions. Build precedent libraries, trace decision lineage, and improve outcomes over time.

Decision Intelligence Workflow
Recommended workflow for tracking decisions
1

Search Precedents

Use find_precedent to check for similar past decisions

2

Recall Context

Use recall to gather relevant memories

3

Log Decision

Use log_decision with memoriesConsidered

4

Update Outcome

Use update_decision_outcome when result is known

log_decision
Log a decision with full context for Decision Intelligence

Parameters

NameTypeRequiredDescription
actionstringRequiredDecision action identifier in snake_case (e.g., approved_discount, denied_refund)
contextstringRequiredFull context of the decision situation (10-2000 chars)
rationalestringRequiredReasoning behind this decision - explain WHY (10-1000 chars)
memoriesConsideredarrayOptionalMemory IDs that informed this decision (from recall results)
querystringOptionalOriginal user query that triggered this decision
alternativesConsideredarrayOptionalOther options that were considered but not chosen
isExceptionbooleanOptionalTrue if this deviates from standard policy
exceptionTypestringOptionalType of exception (required if isException=true)
setsPrecedentbooleanOptionalTrue if this should guide future similar decisions
policyAppliedstringOptionalPolicy or rule identifier that was applied
confidencenumberOptionalConfidence level 0.0-1.0 (default: 0.8)
outcomestringOptionalCurrent status: pending, successful, failed, unknown
outcomeNotesstringOptionalNotes about the decision outcome (max 2000 chars). For pending decisions, use update_decision_outcome later.
domainstringOptionalLife domain: work, finance, projects, goals, etc.
importancenumberOptionalImportance 1-10 (default: 7 for decisions)
supersedesDecisionIdstringOptionalMemory ID of decision this replaces
revisitAfterstringOptionalISO date when to revisit this decision
revisitReasonstringOptionalWhy this decision needs revisiting
participantsarrayOptionalWho was involved (e.g., ["@alice", "engineering-team"])
approvedBystringOptionalWho approved this decision
userIdstringOptionalUser identifier

Example Usage

{
  "action": "approved_20pct_discount",
  "context": "Customer requested discount on annual subscription. They've been a customer for 3 years with no support issues. Revenue at risk: $2,400/year.",
  "rationale": "Long-term customer loyalty justifies retention discount within guidelines. Customer lifetime value significantly exceeds discount cost.",
  "memoriesConsidered": ["mem_abc123", "mem_def456"],
  "policyApplied": "retention_discount_policy",
  "setsPrecedent": true,
  "confidence": 0.9,
  "outcome": "pending"
}

Example Response

Decision logged: approved_20pct_discount [precedent, policy: retention_discount_policy]
ID: mem_1735638400000_xyz789
Links: informed_by:mem_abc123, informed_by:mem_def456

Tips & Best Practices

  • Use recall first to get memory IDs for memoriesConsidered
  • The returned ID can be used with update_decision_outcome later
  • Set setsPrecedent=true for decisions that should guide future choices
  • Auto-creates INFORMED_BY links to memoriesConsidered
  • Use supersedesDecisionId when reversing or updating a past decision
find_precedent
Search for similar past decisions that can inform the current situation

Parameters

NameTypeRequiredDescription
situationstringRequiredDescribe the current situation you need precedent for (10-2000 chars)
outcomeWantedstringOptionalFilter by outcome: successful, failed, or any (default: any)
includeExceptionsbooleanOptionalInclude policy exceptions in results (default: true)
domainstringOptionalFilter by life domain
includeChainbooleanOptionalInclude chain of related memories (default: false)
topKnumberOptionalNumber of precedents to return (default: 5, max: 20)
userIdstringOptionalUser identifier

Example Usage

{
  "situation": "Customer requesting refund after 60 days. They claim they never received the product, but tracking shows delivered.",
  "outcomeWanted": "successful",
  "includeExceptions": true,
  "topK": 5
}

Example Response

Found 3 relevant precedents:

### 1. approved_partial_refund
Similarity: 87%
Flags: Precedent | Successful

**Context:** Customer claimed non-delivery after 45 days. Investigation showed package left at door...
**Rationale:** Partial refund appropriate when delivery confirmed but customer experience poor
**Policy:** refund_policy_v2

ID: mem_abc123
---

### 2. denied_refund_late_claim
Similarity: 72%
Flags: Precedent | Successful

**Context:** Refund request 90 days post-delivery with confirmed signature...
**Rationale:** Beyond policy window with verified delivery

ID: mem_def456
---

Tips & Best Practices

  • Use the returned memory IDs in log_decision.memoriesConsidered to cite precedents
  • Filter by outcomeWanted='successful' to find decisions that worked well
  • Use get_decision_context on any result for deeper analysis
  • Novel situations may have no precedents - consider setting a precedent
get_decision_context
Get the full context of a past decision including lineage

Parameters

NameTypeRequiredDescription
decisionIdstringRequiredMemory ID (mem_* format) of the decision to analyze
includeChainbooleanOptionalInclude full chain of related memories (default: true)
includeReplaybooleanOptionalShow what was known at decision time (default: false)
userIdstringOptionalUser identifier for replay context

Example Usage

{
  "decisionId": "mem_abc123def456",
  "includeChain": true,
  "includeReplay": true
}

Example Response

# Decision Context: approved_20pct_discount

## Decision Details
**ID:** mem_abc123def456
**Action:** approved_20pct_discount
**Outcome:** successful
**Domain:** work
**Importance:** 8/10
**Created:** 2024-12-30
**Flags:** Sets Precedent | Policy: retention_discount_policy

## Context
Customer requested discount on annual subscription. They've been a customer for 3 years...

## Informed By
This decision was informed by 2 memories:

- **INFORMED_BY:** Customer has been loyal since 2021...
  ID: mem_customer_history
- **INFORMED_BY:** Previous discount approved for similar case...
  ID: mem_prior_discount

## Led To
This decision led to 1 subsequent memory:

- **RESULTED_IN:** Customer renewed subscription at discounted rate...
  ID: mem_renewal_confirmed

## Related Entities
@customer_12345, retention-team, annual-subscription

## Timeline
- 12/30/2024: [INFORMED_BY] Customer loyalty history reviewed...
- 12/30/2024: [DECISION] Approved 20% discount...
- 12/31/2024: [RESULTED_IN] Customer accepted and renewed...

Tips & Best Practices

  • Get decisionId from find_precedent or recall with decisionsOnly=true
  • Timeline shows the chronological flow of related events
  • Use includeReplay to understand what was known at decision time
  • Related entities help identify patterns across decisions
update_decision_outcome
Update the outcome of a previously logged decision

Parameters

NameTypeRequiredDescription
decisionIdstringRequiredMemory ID (mem_* format) of the decision to update
outcomestringRequiredNew status: pending, successful, failed, or unknown
outcomeNotesstringOptionalNotes about what happened (max 2000 chars)
outcomeMetricsobjectOptionalQuantitative metrics (e.g., { "revenue_retained": 2400 })
userIdstringOptionalUser identifier

Example Usage

{
  "decisionId": "mem_abc123def456",
  "outcome": "successful",
  "outcomeNotes": "Customer accepted the 20% discount and renewed their annual subscription. They also referred two new customers.",
  "outcomeMetrics": {
    "revenue_retained": 2400,
    "customer_ltv_years": 4,
    "referrals_generated": 2
  }
}

Example Response

Decision outcome updated: successful
ID: mem_abc123def456
Notes: Customer accepted the 20% discount and renewed their annual subscription...
Metrics: {"revenue_retained":2400,"customer_ltv_years":4,"referrals_generated":2}

Tips & Best Practices

  • ALWAYS include outcomeNotes explaining what happened
  • Outcome metrics help build quantitative precedent data
  • Future agents can filter by successful/failed outcomes
  • This closes the feedback loop for decision learning