Implement hybrid prompt flow system with enhanced memory storage and retrieval

- Introduced a new hierarchical memory format for observations, including title, subtitle, facts, narrative, concepts, and files.
- Updated session start, tool execution, and session end prompts to reflect new structure and guidance.
- Replaced bash command execution with XML parsing for observation storage, improving reliability and reducing complexity.
- Established clear criteria for what to store and skip, eliminating ambiguous language and tool-type bias.
- Enhanced database schema to support new observation fields and relationships, ensuring data integrity.
- Added comprehensive session summaries at the end of each session, capturing key insights and next steps.
- Improved retrieval patterns for observations, allowing for granular searches by concept and file.
- Outlined future enhancements for semantic search and cross-session memory linking.
This commit is contained in:
Alex Newman
2025-10-17 16:56:12 -04:00
parent 015b38c763
commit a11199a527
7 changed files with 1703 additions and 54 deletions
+1 -16
View File
@@ -380,22 +380,7 @@ class WorkerService {
db.close();
if (dbSession) {
const summarizePrompt = `You have been processing tool observations for this session. Please generate a summary of what you've learned from prompt #${message.prompt_number}.
Use this XML format:
<session_summary>
<request>What was the user trying to accomplish in this prompt?</request>
<investigated>What code/systems did you explore?</investigated>
<learned>What did you learn about the codebase?</learned>
<completed>What was done or determined?</completed>
<next_steps>What should happen next?</next_steps>
<files_read>["file1.ts", "file2.ts"]</files_read>
<files_edited>["file3.ts"]</files_edited>
<notes>Any additional context or insights</notes>
</session_summary>
Respond ONLY with the XML block. Be concise and specific.`;
const summarizePrompt = buildFinalizePrompt(dbSession);
console.log(`[WorkerService] Yielding summarize prompt:\n${summarizePrompt}`);