From 5e50a2918da5e6e45540b3cdf145d0ecc8dc10b8 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 17 Apr 2025 16:30:57 +0000 Subject: [PATCH] I don't think this can hurt to prioritize summaries of content --- .../context_extractors/vector_search_tool.ts | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/services/llm/context_extractors/vector_search_tool.ts b/src/services/llm/context_extractors/vector_search_tool.ts index 81e0f4d07..a9f962e8f 100644 --- a/src/services/llm/context_extractors/vector_search_tool.ts +++ b/src/services/llm/context_extractors/vector_search_tool.ts @@ -100,9 +100,13 @@ export class VectorSearchTool { noteId: note.noteId, title: note.title, contentPreview: note.content - ? note.content.length > 200 - ? note.content.substring(0, 200) + '...' - : note.content + ? (options.summarizeContent + // Don't truncate already summarized content + ? note.content + // Only truncate non-summarized content + : (note.content.length > 200 + ? note.content.substring(0, 200) + '...' + : note.content)) : 'No content available', similarity: note.similarity, parentId: note.parentId @@ -144,10 +148,14 @@ export class VectorSearchTool { return results.map(result => ({ noteId: result.noteId, title: result.title, - contentPreview: result.content ? - (result.content.length > 200 ? - result.content.substring(0, 200) + '...' : - result.content) + contentPreview: result.content + ? (summarize + // Don't truncate already summarized content + ? result.content + // Only truncate non-summarized content + : (result.content.length > 200 + ? result.content.substring(0, 200) + '...' + : result.content)) : 'No content available', similarity: result.similarity, parentId: result.parentId