KnowledgeIndex.openSnapshot constructor

KnowledgeIndex.openSnapshot({
  1. required KnowledgeSnapshot snapshot,
  2. required BaseStore store,
  3. BaseEmbedder? embedder,
  4. bool includeContext = false,
})

Opens the snapshot and store from the same completed index generation.

The caller verifies snapshot/configuration identity and owns the store and embedder. No synchronization, token fitting or document encoding occurs. Semantic search checks that every eligible passage has a compatible vector.

Implementation

factory KnowledgeIndex.openSnapshot({
  required KnowledgeSnapshot snapshot,
  required BaseStore store,
  BaseEmbedder? embedder,
  bool includeContext = false,
}) => KnowledgeIndex(
  store: store,
  embedder: embedder,
  includeContext: includeContext,
).._snapshot = snapshot;