try using XML tags in sending to LLM, so it can more easily pick out information

This commit is contained in:
perf3ct
2025-04-02 18:57:04 +00:00
parent 6e8ab373d8
commit caada309ec
5 changed files with 119 additions and 55 deletions

View File

@@ -631,8 +631,8 @@ function buildContextFromNotes(sources: NoteSource[], query: string): string {
const noteContexts = sources
.filter(source => source.content) // Only include sources with content
.map((source) => {
// Format each note with its title as a natural heading
return `### ${source.title}\n${source.content || 'No content available'}`;
// Format each note with its title as a natural heading and wrap in <note> tags
return `<note>\n### ${source.title}\n${source.content || 'No content available'}\n</note>`;
})
.join('\n\n');