feat(recall): recallMulti() for multi-query recall + pluggable taskQueryBuilder - #101
Open
evilh2019 wants to merge 1 commit into
Open
feat(recall): recallMulti() for multi-query recall + pluggable taskQueryBuilder#101evilh2019 wants to merge 1 commit into
evilh2019 wants to merge 1 commit into
Conversation
… query builder - Recaller: add recallMulti(queries, options) that runs each query in parallel and merges results via mergeMany(). Extract static merge() from private mergeResults() so callers can merge externally. - dsh.ts: capture skill-catalog events and build task-oriented recall queries from skills relevant to the current user message. The query builder is configurable via taskQueryBuilder; the default is a bigram-overlap relevance filter that excludes lark-* infrastructure skills and caps at 500 characters. Multi-query recall lets the host augment the primary user-message query with task-domain queries (e.g. skill descriptions), improving recall of procedural knowledge that the user message alone would miss.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two new capabilities to improve recall quality:
1.
recallMulti(queries, options)— multi-query recallThe
Recallerclass now supports running multiple independent queries in parallel and merging the results. This is a natural generalization of the existing single-queryrecall()— each query runs its own precise + generalized path internally, and results are merged with dedup via the newmergeMany()static method.API added:
recaller.recallMulti(queries: string[], options?)— parallel multi-query recallRecaller.merge(a, b)— merge two results (static, was previously privatemergeResults)Recaller.mergeMany(results[])— merge any number of results2. Pluggable
taskQueryBuilder— configurable query constructionThe DSH integration now captures skill-catalog events (
user/messagewithsource.kind === "skill-catalog") and passes them to a configurabletaskQueryBuilderthat can produce additional recall queries from skill descriptions relevant to the current user message.Default builder:
bigramRelevanceFilterlark-*infrastructure skillsundefinedwhen no skills match (no additional queries)Config:
Custom builders can use embedding similarity, keyword expansion, or LLM-based skill selection — the interface is intentionally minimal and host-agnostic.
Motivation
Single-query recall only searches the user message ("what is the user talking about"), which misses procedural knowledge ("how to do the task"). For example, when a user says "send a task to mama1", the user query finds workflow nodes like
dispatch-task-to-mama1-correctlybut missesmama1-executor-json-command-send(JSON format requirement that previously caused rejected tasks). The task-oriented query from relevant skill descriptions fills this gap.Testing
pro-dsh.test.tsdue to missing@deepseek-ai/dsh-typert-protocoldependency, unrelated)Files changed
src/recaller/recall.tsrecallMulti(), +static merge(), +static mergeMany(), extractmergeResultsImpldsh.tsskillEntriescapture, +taskQueryBuilderconfig, +bigramRelevanceFilterdefault, dual-recall insystem-prompt/assembledist/