diff --git a/assistant/system-prompts.ts b/assistant/system-prompts.ts index c36d3a3..b0283ff 100644 --- a/assistant/system-prompts.ts +++ b/assistant/system-prompts.ts @@ -4,6 +4,7 @@ import { OpenAI } from "openai"; import { return_current_events } from "../tools/events"; import { memory_manager_guide } from "../tools/memory-manager"; import { searchFilesByTagWithCache } from "../tools/notes"; +import { semantic_search_notes } from "../tools/notes-vectors"; const replaceTemplateStrings = ( template: string, @@ -30,10 +31,19 @@ export async function buildSystemPrompts( desc: event.description, })); + const potentially_relavent_files = await semantic_search_notes( + context_message.content, + 4 + ); + const potentially_relavent_files_paths = potentially_relavent_files.map( + (f) => f.metadata.filename + ); + const data = { memory_guide: memory_manager_guide("self", context_message.author.id), events, user_id: context_message.author.id, + relavent_files: potentially_relavent_files_paths, model, }; diff --git a/tools/notes-vectors.ts b/tools/notes-vectors.ts index 6bd62e7..1c98dd2 100644 --- a/tools/notes-vectors.ts +++ b/tools/notes-vectors.ts @@ -41,6 +41,7 @@ async function getAllFiles( file.type === "file" && !file.basename.startsWith(".") && !file.filename.includes("/.obsidian/") && + !file.filename.includes("prompts/") && (file.filename.endsWith(".txt") || file.filename.endsWith(".md")) ) { const content = await webdavClient.getFileContents(file.filename, {