diff --git a/src/ui.js b/src/ui.js index 6ddd025..28fb386 100644 --- a/src/ui.js +++ b/src/ui.js @@ -1361,17 +1361,23 @@ async function openHermesModalNew() { const pageContent = extractWebpageContent(); const pageTitle = document.title || window.location.hostname; - // Generate contextual intro message using Hermes - const contextPrompt = `You are Hermes AI, embedded on a webpage. Generate a warm, welcoming 3-paragraph introduction message that: + // Generate contextual intro message using Hermes with full page context + const contextPrompt = `You are Hermes AI, powered by Nous Research, embedded on this specific webpage. You have full access to analyze and discuss the page content. -1. First paragraph: Introduce yourself as Hermes AI (powered by Nous Research) and acknowledge the specific page/content the user is viewing -2. Second paragraph: Explain how you can help with this specific page content and related topics -3. Third paragraph: Invite questions and explain your capabilities +PAGE INFORMATION: +Title: "${pageTitle}" +URL: ${window.location.href} -Page title: "${pageTitle}" -Page content preview: "${pageContent.substring(0, 1000)}..." +FULL PAGE CONTENT: +${pageContent} -Keep it conversational, helpful, and specific to this page context. Use a friendly tone and make it clear you understand what page they're on.`; +INSTRUCTIONS: +1. Generate a warm, welcoming 3-paragraph introduction that shows you understand this specific page +2. Reference specific details from the content (names, topics, projects mentioned) +3. Explain how you can help with this page's content and related topics +4. Keep this context in mind for all future questions in this conversation + +Remember: You have access to the full page content above, so you can answer detailed questions about anything mentioned on this page, including specific people, projects, or concepts discussed.`; let response = ''; for await (const chunk of sendMessage(contextPrompt)) {