feat(essence): improve sentence scoring for better title/header retention#72
Merged
nullure merged 1 commit intoCaviraOSS:mainfrom Nov 29, 2025
Merged
Conversation
…tion Problem: The extract_essence() function was dropping important context like titles, headers, and section markers because they didn't score highly in the sentence scoring algorithm. This caused memories to lose critical retrieval context. Changes: - Add first sentence bonus (+10) to preserve titles/headers - Add second sentence bonus (+5) for key context - Add markdown header detection (## / ###) with +8 bonus - Add label-style header detection (PROBLEM:, SOLUTION:) with +6 bonus - Add ISO date format detection (2025-11-29) with +7 bonus - Add more action verbs (fixed, implemented, created, updated, etc.) - Ensure first sentence is always included if under 50% of max_len This improves memory retrieval by preserving the semantic context that helps users and AI agents find relevant memories. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
The
extract_essence()function was dropping important context like titles, headers, and section markers because they didn't score highly in the sentence scoring algorithm. This caused memories to lose critical retrieval context.For example, a memory like:
Would have the title dropped entirely because it didn't contain action verbs, measurements, or other high-scoring patterns.
Test Plan
🤖 Generated with Claude Code