fix(memory): pass queryText to searchVector for snippet extraction
This commit is contained in:
parent
6cb5cae6cf
commit
11c02404e4
@ -88,6 +88,7 @@ export async function searchVector(params: {
|
||||
vectorTable: string;
|
||||
providerModel: string;
|
||||
queryVec: number[];
|
||||
queryText: string;
|
||||
limit: number;
|
||||
snippetMaxChars: number;
|
||||
ensureVectorReady: (dimensions: number) => Promise<boolean>;
|
||||
|
||||
@ -327,7 +327,7 @@ export class MemoryIndexManager extends MemoryManagerEmbeddingOps implements Mem
|
||||
const queryVec = await this.embedQueryWithTimeout(cleaned);
|
||||
const hasVector = queryVec.some((v) => v !== 0);
|
||||
const vectorResults = hasVector
|
||||
? await this.searchVector(queryVec, candidates).catch(() => [])
|
||||
? await this.searchVector(queryVec, cleaned, candidates).catch(() => [])
|
||||
: [];
|
||||
|
||||
if (!hybrid.enabled || !this.fts.enabled || !this.fts.available) {
|
||||
@ -368,6 +368,7 @@ export class MemoryIndexManager extends MemoryManagerEmbeddingOps implements Mem
|
||||
|
||||
private async searchVector(
|
||||
queryVec: number[],
|
||||
queryText: string,
|
||||
limit: number,
|
||||
): Promise<Array<MemorySearchResult & { id: string }>> {
|
||||
// This method should never be called without a provider
|
||||
@ -379,6 +380,7 @@ export class MemoryIndexManager extends MemoryManagerEmbeddingOps implements Mem
|
||||
vectorTable: VECTOR_TABLE,
|
||||
providerModel: this.provider.model,
|
||||
queryVec,
|
||||
queryText,
|
||||
limit,
|
||||
snippetMaxChars: SNIPPET_MAX_CHARS,
|
||||
ensureVectorReady: async (dimensions) => await this.ensureVectorReady(dimensions),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user