KnowledgeIndex class

Synchronizes one bundle and searches an explicit eligible concept set.

The caller owns the store and optional embedder. Synchronization must not overlap searches on this instance. Separate instances should coordinate writes to the same bundle. Dense scoring is exact after eligibility filtering; ObjectBox supplies indexed vector reads rather than a post-filtered ANN pool.

Constructors

KnowledgeIndex({required BaseStore store, BaseEmbedder? embedder, bool includeContext = false, Future<int> countTokens(String)?, int? maxTokens})
KnowledgeIndex.openSnapshot({required KnowledgeSnapshot snapshot, required BaseStore store, BaseEmbedder? embedder, bool includeContext = false})
Opens the snapshot and store from the same completed index generation.
factory

Properties

countTokens Future<int> Function(String)?
final
embedder BaseEmbedder?
final
embeddingModelName String?
no setter
hashCode int
The hash code for this object.
no setterinherited
includeContext bool
final
maxTokens int?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
store BaseStore
final

Methods

contextForMatches(Iterable<SearchResult> ranked, {KnowledgeSearchPolicy? policy, int limit = 5, int? contextLimit}) KnowledgeSearchResponse
Applies the same eligibility and context policy to externally ranked hits. Unknown or excluded chunk IDs are ignored. Scores do not establish authority.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
synchronize(KnowledgeSnapshot input) Future<({int embeddedChunks, int removedChunks, int writtenChunks})>
Embeds missing/changed inputs before one atomic replacement. Failed loads or inference leave the prior store/index usable. Other bundles are retained.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited