> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentium.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Decision Log

> An audit trail of what the agent decided, why, and how it turned out.

# Decision Log

## In plain terms

The **Decision Log** records the choices the agent makes — what it decided, the reasoning, the alternatives it weighed, and (optionally) how it turned out. It's the agent's paper trail.

> **The analogy:** the meeting minutes that capture "we decided X because Y." Months later, anyone can see *why* a call was made.

## When to use it

* **Compliance & auditing** — regulated industries (finance, healthcare) need a record of *why* an automated decision was made. This is your [GDPR Article 22](https://gdpr-info.eu/art-22-gdpr/) / SOC 2 evidence trail.
* **Consistency** — an approval or negotiation agent that should not contradict its own recent rulings.
* **Learning from outcomes** — log a decision, record whether it worked, and analyze quality over time.

```typescript theme={null}
memory: { storage, decisions: true }
```

## When NOT to use it

* Simple chat agents with no consequential decisions — there's nothing meaningful to log.
* If you only need raw conversation history, [Sessions](/memory/sessions) already capture it; the Decision Log is specifically for *structured, queryable* decision records.

## Configuration

| Property              | Type     | Default | What it controls                                             |
| --------------------- | -------- | ------- | ------------------------------------------------------------ |
| `maxContextDecisions` | `number` | `5`     | How many recent decisions are reminded to the agent each run |

```typescript theme={null}
memory: { storage, decisions: true }                       // remind of last 5
memory: { storage, decisions: { maxContextDecisions: 10 } } // high-continuity agent
```

**Understanding `maxContextDecisions`:** every decision is stored **permanently** and is fully searchable via the `search_decisions` tool. This setting only controls how many of the **most recent** decisions are automatically shown to the agent at the start of each run, so it stays consistent with itself.

* Lower it (`3`) to save tokens or when past decisions aren't relevant to the next one.
* Raise it (`10`) for agents that must avoid contradicting their recent rulings.
* It does **not** limit storage — only what's surfaced in context.

## What gets stored

```json theme={null}
{
  "decision": "Approved refund of $49.99 for ORD-7421",
  "reasoning": "Order was delayed 7 days, exceeding the 5-day SLA",
  "decisionType": "approval",
  "alternatives": ["Deny", "Partial refund"],
  "confidence": 0.9,
  "outcome": "Customer confirmed satisfaction",
  "outcomeQuality": "good"
}
```

Scoped by agent + session, so two users of the same agent never see each other's decisions, while the agent-wide log remains useful for aggregate auditing.

## Tools

| Tool               | What it does                                      |
| ------------------ | ------------------------------------------------- |
| `log_decision`     | Record a decision with reasoning and alternatives |
| `record_outcome`   | Attach how a past decision turned out             |
| `search_decisions` | Search the full decision history by keyword       |

## Cross-references

* [Compliance](/compliance/overview) — audit logs and PII handling for regulated industries
* [Memory Overview](/memory/overview) — the full memory lifecycle
* [Reflection](/agents/reflection) — agents that critique their own decisions
