KnowledgeIndex.fromSnapshot constructor

KnowledgeIndex.fromSnapshot({
  1. required KnowledgeSnapshot snapshot,
  2. required BaseStore store,
  3. required 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

KnowledgeIndex.fromSnapshot({
  required KnowledgeSnapshot snapshot,
  required this.store,
  required this.embedder,
  this.includeContext = false,
}) : countTokens = null,
     maxTokens = null,
     _snapshot = snapshot;