# Function curateContext

- curateContext(
  items: readonly CuratedContextItem[],
  filter: ContextFilter,
  nowMs?: number,
  ): CurationResult

  Curate context items according to a context filter.

  Pipeline: filter by history → filter by relevance → rank by strategy → trim to budget.

  #### Parameters

  - items: readonly CuratedContextItem[]

    All available context items

  - filter: ContextFilter

    Context filter configuration from ICTM config

  - `Optional` nowMs: number

    Current timestamp in ms (defaults to Date.now())

  #### Returns CurationResult

  Curated result with selected items and stats

  - Defined in packages/nexus-agents/src/agents/ictm/context-curator.ts:152