> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/relay/llms.txt.
> For full documentation content, see https://docs.nvidia.com/nemo/relay/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server.

# Struct Prediction Trie Builder

> Builds a `PredictionTrieNode` tree from `RunRecord`s via incremental accumulator merge.

Generated from `cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi`.

```rust
pub struct PredictionTrieBuilder { /* private fields */ }
```

Builds a [`PredictionTrieNode`](/reference/api/rust-library-reference/nemo-relay-adaptive/trie/data_models/struct-predictiontrienode) tree from [`RunRecord`](/reference/api/rust-library-reference/nemo-relay-adaptive/types/records/struct-runrecord)s via incremental accumulator merge.

## Usage

```rust
let mut builder = PredictionTrieBuilder::new(Some(SensitivityConfig::default()));
builder.add_run(&run1);
builder.add_run(&run2);
let trie = builder.build();
```

## Implementations

### `impl PredictionTrieBuilder`

<pre />

#### `new`

<pre />

Creates a new builder with optional sensitivity scoring.

#### `with_accumulators`

<pre />

Creates a builder seeded with pre-existing accumulators.

Used by the learner pipeline to resume incremental learning from a stored [`AccumulatorState`](/reference/api/rust-library-reference/nemo-relay-adaptive/trie/accumulator/struct-accumulatorstate).

#### `add_run`

<pre />

Processes a single [`RunRecord`](/reference/api/rust-library-reference/nemo-relay-adaptive/types/records/struct-runrecord) and updates accumulators.

Extracts LLM call contexts, optionally computes sensitivity scores, and updates accumulators at every node along each call's path.

#### `build`

<pre />

Constructs the prediction trie from accumulated data.

Iterates all accumulated nodes, navigates/creates the trie path, and populates predictions from the accumulators.

#### `accumulators`

<pre />

Returns a reference to the underlying accumulator state.