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

# Context & Memory

> Per-execution context and persistent memory

The Agentic Framework distinguishes per-execution **context** from persistent **memory**.

## Execution context (per-execution)

Owned by for the duration of a single execution. Holds:

| Field                      | Notes                                                     |                                                                                               |
| :------------------------- | :-------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `inputValues`              | Frozen — provided at execution start                      |                                                                                               |
| `stateValues`              | Mutable — initialized from `state_variables` + defaults   |                                                                                               |
| `outputValues`             | Set on `end` node                                         |                                                                                               |
| `nodeOutputs`              | Map of `nodeId → output`                                  |                                                                                               |
| `executionTrace[]`         | Append-only audit log of node starts / completes / errors |                                                                                               |
| `currentNodeId`            | Current node                                              |                                                                                               |
| `status`                   | `pending` / `running` / `completed` / `failed` / `paused` |                                                                                               |
| `startedAt`, `completedAt` | ISO timestamps                                            | Resolution is via `resolveVariable(expression)`: e.g. `{{nodes.intake_1.output.transcript}}`. |

## Memory (persistent)

Persistent agent memory is stored under the tenant scope. Memory survives across executions and contexts and is read by agents that bundle the `Memory Expert` (see [`/agentic/experts/memory`](/agentic/experts/memory)).

| Scope     | Lifetime                                       |
| :-------- | :--------------------------------------------- |
| `thread`  | Until context ends                             |
| `patient` | Until patient deletion                         |
| `tenant`  | Indefinite (subject to HIPAA 6-year retention) |
