Skip to content

Conversation

@amihos
Copy link
Contributor

@amihos amihos commented Nov 29, 2025

Summary

  • Add first sentence bonus (+10) to preserve titles/headers during essence extraction
  • Add markdown header detection and label-style headers (PROBLEM:, SOLUTION:)
  • Add ISO date format detection (2025-11-29)
  • Add more action verbs for better extraction (fixed, implemented, created, etc.)
  • Ensure first sentence is always included if under 50% of max_len

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:

2025-11-29: MUNygo Matching Algorithm - Product Thinking Session

PROBLEM: The matching logic was unclear
SOLUTION: Implemented asymmetric scoring...

Would have the title dropped entirely because it didn't contain action verbs, measurements, or other high-scoring patterns.

Test Plan

  • Verify memories with titles/headers now retain their first sentence
  • Verify markdown headers get high scores
  • Verify label-style headers (PROBLEM:, SOLUTION:) get high scores
  • Verify ISO dates (2025-11-29) get high scores
  • Verify backwards compatibility - memories without headers still work

🤖 Generated with Claude Code

…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 <[email protected]>
Copy link
Member

@nullure nullure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nullure nullure merged commit ebfe8b1 into CaviraOSS:main Nov 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants