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

# TrajectoryRetriever

> Step-example retrieval helper

## Constructor

```python theme={null}
TrajectoryRetriever(database: TrajectoryDatabase, k: int = 2)
```

## Methods

```python theme={null}
retriever.retrieve_for_plan(goal, k=None)
retriever.retrieve_for_step(goal, plan, observation, k=None)
retriever.get_retrieved_ids()
retriever.clear_retrieved()
retriever.record_episode_result(success)
```

`record_episode_result` forwards success/failure feedback to DB curation metadata.
