KBSearchEngine class
Searches the knowledge base by tags, text, or entity type.
Constructors
- KBSearchEngine(KbStorage storage, {LlmProvider? provider, Duration llmTimeout = defaultSearchLlmTimeout})
- KBSearchEngine.file(dynamic kbDir, {LlmProvider? provider, Duration llmTimeout = defaultSearchLlmTimeout})
-
Creates a search engine for the classic Markdown file backend.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- llmTimeout → Duration
-
Timeout applied to each optional LLM call (tag generation, rerank).
final
- provider → LlmProvider?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storage → KbStorage
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
searchByKeywords(
String query, {List< String> ? entityTypes}) → Future<List< KBSearchResult> > - Keyword-only search over record text. Works without an LLM provider — used as the fallback when searchByText cannot generate tags.
-
searchByTags(
List< String> tags, {bool matchAll = true, List<String> ? entityTypes}) → Future<List< KBSearchResult> > - Returns records whose tags contain all (matchAll=true) or any (matchAll=false) of the requested tags.
-
searchByText(
String query, {bool matchAll = false, List< String> ? entityTypes, int maxGeneratedTags = 5, int rerankTopN = 10, Duration? llmTimeout}) → Future<KBTextSearchResult> -
Generates tags from
queryusing the configured LLM provider, runs a tag-based search, and augments it with a keyword search over record text. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited