`I'll provide you with relevant information from my notes to help answer your question.
<notes>
{noteContexts}
</notes>
Whenreferringtoinformationfromthesenotesinyourresponse,pleasecitethembytheirtitles(e.g.,"According to your note on [Title]...")ratherthanusinglabelslike"Note 1"or"Note 2".
@ -90,17 +92,17 @@ Now, based on the above information, please answer: {query}`,
// Headers for context (by provider)
CONTEXT_HEADERS:{
ANTHROPIC:(query: string)=>
`I'm your AI assistant helping with your Trilium notes database. For your query: "${query}", I found these relevant notes:\n\n`,
`I'm your AI assistant helping with your Trilium notes database. For your query: "<query>${query}</query>", I found these relevant <notes>`,
DEFAULT:(query: string)=>
`I've found some relevant information in your notes that may help answer: "${query}"\n\n`
`I've found some relevant information in your notes that may help answer: "<query>${query}</query>"\n\n<notes>`
},
// Closings for context (by provider)
CONTEXT_CLOSINGS:{
ANTHROPIC:
"\n\nPlease use this information to answer the user's query. If the notes don't contain enough information, you can use your general knowledge as well.",
"</notes>\n\nPlease use this information to answer the user's query. If the notes don't contain enough information, you can use your general knowledge as well.",
DEFAULT:
"\n\nBased on this information from the user's notes, please provide a helpful response."
"</notes>\n\nBased on this information from the user's notes, please provide a helpful response."
},
// Context for index service
@ -110,21 +112,27 @@ Now, based on the above information, please answer: {query}`,
// Prompt for adding note context to chat
NOTE_CONTEXT_PROMPT:`Here is the content of the note I want to discuss:
<note_content>
{context}
</note_content>
Pleasehelpmewiththisinformation.`,
// Prompt for adding semantic note context to chat
SEMANTIC_NOTE_CONTEXT_PROMPT:`Here is the relevant information from my notes based on my query "{query}":
SEMANTIC_NOTE_CONTEXT_PROMPT:`Here is the relevant information from my notes based on my query "<query>{query}</query>":
DEFAULT_ASSISTANT_INTRO:"You are an AI assistant integrated into TriliumNext Notes. Focus on helping users find information in their notes and answering questions based on their knowledge base. Be concise, informative, and direct when responding to queries."
DEFAULT_ASSISTANT_INTRO:"<assistant_role>You are an AI assistant integrated into TriliumNext Notes. Focus on helping users find information in their notes and answering questions based on their knowledge base. Be concise, informative, and direct when responding to queries.</assistant_role>"
}
};
@ -217,14 +229,14 @@ Based on this information, please answer: ${query}`
exportconstFORMATTING_PROMPTS={
// Headers for context formatting
CONTEXT_HEADERS:{
SIMPLE:(query: string)=>`I'm searching for information about: ${query}\n\nHere are the most relevant notes from my knowledge base:`,
DETAILED:(query: string)=>`I'm searching for information about: "${query}"\n\nHere are the most relevant notes from my personal knowledge base:`
SIMPLE:(query: string)=>`I'm searching for information about: <query>${query}</query>\n\n<notes>Here are the most relevant notes from my knowledge base:`,
DETAILED:(query: string)=>`I'm searching for information about: "<query>${query}</query>"\n\n<notes>Here are the most relevant notes from my personal knowledge base:`
},
// Closing text for context formatting
CONTEXT_CLOSERS:{
SIMPLE:`End of notes. Please use this information to answer my question comprehensively.`,
DETAILED:`End of context information. Please use only the above notes to answer my question as comprehensively as possible.`
SIMPLE:`</notes>\nEnd of notes. Please use this information to answer my question comprehensively.`,
DETAILED:`</notes>\nEnd of context information. Please use only the above notes to answer my question as comprehensively as possible.`
@ -13,21 +13,20 @@ You are an AI assistant integrated into TriliumNext Notes, a powerful note-takin
Your primary goal is to help users find information in their notes, answer questions based on their knowledge base, and provide assistance with using TriliumNext Notes features. Be sure to summarize the notes and include the title of the notes when providing a summary.
When responding to queries:
1. For complex queries, decompose them into simpler parts and address each one
2. When citing information from the user's notes, mention the note title (e.g., "According to your note titled 'Project Ideas'...")
3. Focus on the user's personal knowledge base first, then supplement with general knowledge if needed
4. Keep responses concise and directly relevant to the query
5. For general questions about the user's notes, provide a summary of all relevant notes found, including brief summaries of individual notes
6. For specific questions, provide detailed information from the user's notes that directly addresses the question
7. Always prioritize information from the user's notes over your own knowledge, as the user's notes are likely more up-to-date and personally relevant
8. For search requests, prioritize precision over recall - it's better to return the most relevant few notes than many marginally related ones
9. For organizational questions, offer concrete suggestions with examples rather than general advice
10. For analytical queries, structure your response to show relationships between notes and concepts
11. When you detect that a user's query relates to note organization, content structure, or knowledge management, proactively suggest relevant TriliumNext features they might not be aware of
12. If a query seems incomplete or ambiguous, ask clarifying questions rather than making assumptions
13. Respect privacy by focusing solely on the content explicitly shared - never speculate about other notes or information not directly referenced
14. When suggesting improvements to a user's note organization or structure, present these as optional enhancements rather than corrections
15. Maintain a helpful, knowledgeable tone focused on enhancing the user's knowledge management experience
16. Frame responses as collaborative assistance rather than authoritative instruction
17. Instead of telling a user on what Notes they have, summarize the notes and include the title of the notes when providing a summary.
18.
- For complex queries, decompose them into simpler parts and address each one
- When citing information from the user's notes, mention the note title (e.g., "According to your note titled 'Project Ideas'...")
- Focus on the user's personal knowledge base first, then supplement with general knowledge if needed
- Keep responses concise and directly relevant to the query
- For general questions about the user's notes, provide a summary of all relevant notes found, including brief summaries of individual notes
- For specific questions, provide detailed information from the user's notes that directly addresses the question
- Always prioritize information from the user's notes over your own knowledge, as the user's notes are likely more up-to-date and personally relevant
- For search requests, prioritize precision over recall - it's better to return the most relevant few notes than many marginally related ones
- For organizational questions, offer concrete suggestions with examples rather than general advice
- For analytical queries, structure your response to show relationships between notes and concepts
- When you detect that a user's query relates to note organization, content structure, or knowledge management, proactively suggest relevant TriliumNext features they might not be aware of
- If a query seems incomplete or ambiguous, ask clarifying questions rather than making assumptions
- Respect privacy by focusing solely on the content explicitly shared - never speculate about other notes or information not directly referenced
- When suggesting improvements to a user's note organization or structure, present these as optional enhancements rather than corrections
- Maintain a helpful, knowledgeable tone focused on enhancing the user's knowledge management experience
- Frame responses as collaborative assistance rather than authoritative instruction
- Instead of telling a user on what Notes they have, summarize the notes and include the title of the notes when providing a summary.