| <div id="memoryAnalysisPanel" style="display:none; padding: 20px;"> | |
| <h2>Memory Analysis</h2> | |
| <label for="agentSelect">Select Agent:</label> | |
| <input type="text" id="agentSelect" placeholder="Enter Agent Name" /> | |
| <button onclick="runMemoryAnalysis()">Run Analysis</button> | |
| <button onclick="showDIGSPrompt()">DIGS Prompt</button> | |
| <h3>Segment Report</h3> | |
| <pre id="memoryReport" style="background:#111; color:#fff; padding:10px; border-radius:5px; max-height:400px; overflow-y:auto;"></pre> | |
| <h3>Add Custom Memory (AI Formatted)</h3> | |
| <textarea id="customMemoryInput" rows="6" style="width:100%;"></textarea> | |
| <button onclick="downloadDIGSPrompt()">Download DIGS Prompt</button> | |
| </div> | |
| <script> | |
| function toggleMemoryPanel() { | |
| const panel = document.getElementById('memoryAnalysisPanel'); | |
| panel.style.display = panel.style.display === 'none' ? 'block' : 'none'; | |
| } | |
| function runMemoryAnalysis() { | |
| const agent = document.getElementById('agentSelect').value.trim(); | |
| if (!agent) return alert("Please enter an agent name."); | |
| fetch(`/digs/analyze/${agent}`) | |
| .then(res => res.json()) | |
| .then(data => { | |
| document.getElementById('memoryReport').textContent = data.message; | |
| }); | |
| } | |
| function showDIGSPrompt() { | |
| const promptText = `You are acting as a Memory Engineer for an Agentic AI system using the DIGS protocol (Digestive Information Grouping System). | |
| Your role is to help the user clean and structure input information so that it can be processed as part of an agent’s long-term memory. | |
| Process the input using the following steps: | |
| 1. Segment the content into digestible 2,000-character max chunks. | |
| 2. For each segment, apply DIGS parallel analysis paths: | |
| - Literal Summary | |
| - Conceptual Extraction | |
| - Terminology Indexing | |
| - Structural Mapping | |
| - Data Analysis | |
| - Comparative Analysis | |
| - Practical Application | |
| - Cross-Referencing | |
| 3. Output the result as a table or structured list, ready for insertion into a CSV. | |
| Ensure clarity, conciseness, and contextual integrity. Do not alter the meaning of the content. | |
| If part of the user’s message is unclear, insert a placeholder and return a warning for user clarification.`; | |
| alert(promptText); | |
| } | |
| function downloadDIGSPrompt() { | |
| window.open('/static/DIGS_Cleaner_Prompt_v1.txt', '_blank'); | |
| } | |
| </script> | |