Commit 744152f
feat(essence): improve sentence scoring for better title/header retention
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]>1 parent b6b9de7 commit 744152f
1 file changed
+45
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
| 339 | + | |
340 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
341 | 351 | | |
342 | 352 | | |
343 | 353 | | |
| |||
347 | 357 | | |
348 | 358 | | |
349 | 359 | | |
350 | | - | |
| 360 | + | |
351 | 361 | | |
352 | 362 | | |
353 | 363 | | |
| |||
357 | 367 | | |
358 | 368 | | |
359 | 369 | | |
360 | | - | |
| 370 | + | |
361 | 371 | | |
| 372 | + | |
362 | 373 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
371 | 405 | | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | 406 | | |
376 | 407 | | |
377 | 408 | | |
| |||
0 commit comments