# `Nous.Decisions.Node`
[🔗](https://github.com/nyo16/nous/blob/v0.17.1/lib/nous/decisions/node.ex#L1)

A node in the decision graph.

Nodes represent discrete elements of an agent's decision-making process:
goals, decisions, options, actions, outcomes, observations, and revisits.

## Architecture

Nodes are plain structs with auto-generated IDs and timestamps. They are
stored in a `Nous.Decisions.Store` backend and connected by `Nous.Decisions.Edge`
structs to form a directed graph.

## Quick Start

    node = Nous.Decisions.Node.new(%{
      type: :goal,
      label: "Implement authentication",
      confidence: 0.9
    })

## Fields

| Field | Type | Description |
|-------|------|-------------|
| `id` | `String.t()` | Unique identifier (auto-generated) |
| `type` | `node_type()` | Category of this node |
| `label` | `String.t()` | Human-readable description |
| `status` | `status()` | Current lifecycle status |
| `confidence` | `float() \| nil` | Agent's confidence level 0.0-1.0 |
| `metadata` | `map()` | Arbitrary key-value data |
| `rationale` | `String.t() \| nil` | Explanation for this node's existence or state |
| `created_at` | `DateTime.t()` | When the node was created |
| `updated_at` | `DateTime.t()` | When the node was last modified |

# `node_type`

```elixir
@type node_type() ::
  :goal | :decision | :option | :action | :outcome | :observation | :revisit
```

# `status`

```elixir
@type status() :: :active | :completed | :superseded | :rejected
```

# `t`

```elixir
@type t() :: %Nous.Decisions.Node{
  confidence: float() | nil,
  created_at: DateTime.t(),
  id: String.t(),
  label: String.t(),
  metadata: map(),
  rationale: String.t() | nil,
  status: status(),
  type: node_type(),
  updated_at: DateTime.t()
}
```

# `new`

```elixir
@spec new(map()) :: t()
```

Create a new node with auto-generated ID and timestamps.

## Options

All fields except `:id`, `:created_at`, and `:updated_at` can be provided.
Required: `:type` and `:label`.

## Examples

    iex> node = Nous.Decisions.Node.new(%{type: :goal, label: "Ship v1.0"})
    iex> node.type
    :goal
    iex> node.status
    :active
    iex> is_binary(node.id)
    true

---

*Consult [api-reference.md](api-reference.md) for complete listing*
