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

Builds a text summary of the decision graph for system prompt injection.

Queries the decision store for active goals and recent decisions, then
formats them into a human-readable string suitable for inclusion in an
agent's system prompt.

## Architecture

The context builder is a pure function module -- it reads from the store
but does not modify it. It is called by `Nous.Plugins.Decisions` during
the `system_prompt/2` and `before_request/3` callbacks.

## Quick Start

    {:ok, state} = Nous.Decisions.Store.ETS.init([])
    # ... add nodes and edges ...
    text = Nous.Decisions.ContextBuilder.build(Nous.Decisions.Store.ETS, state)

# `build`

```elixir
@spec build(module(), term(), keyword()) :: String.t() | nil
```

Build a context string from active goals and recent decisions.

## Options

  * `:decision_limit` - max recent decisions to include (default: 5)

## Examples

    text = ContextBuilder.build(Store.ETS, state)
    # "## Active Goals\n- [abc123] Implement auth (confidence: 0.8, status: active)\n..."

Returns `nil` if there are no goals or decisions to display.

---

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