Skip to content

Build your personal knowledge base with Trilium Notes

feat(llm): mention child notes directly in system prompt

Elian Doran54a5c3fac0d1
diff --git a/apps/server/src/services/llm/tools/helpers.ts b/apps/server/src/services/llm/tools/helpers.ts
index 1b52bad93b..7e3ec39cdf 100644
--- a/apps/server/src/services/llm/tools/helpers.ts
+++ b/apps/server/src/services/llm/tools/helpers.ts
@@ -109,7 +109,10 @@ export function getNoteMeta(note: BNote) {
utcDateCreated: note.utcDateCreated,
utcDateModified: note.utcDateModified,
parentNoteIds: note.getParentNotes().map((p) => p.noteId),
- childNoteIds: note.getChildNotes().map((ch) => ch.noteId),
+ childNotes: note.getChildNotes().map((ch) => ({
+ noteId: ch.noteId,
+ title: ch.getTitleOrProtected()
+ })),
parentBranchIds: note.getParentBranches().map((p) => p.branchId),
childBranchIds: note.getChildBranches().map((ch) => ch.branchId),
attributes: note.getAttributes().map((attr) => ({