Commit Graph
4 Commits
Author SHA1 Message Date
Aska 14a8eecfdb fix(memory): improve dedup thresholds and keyword priority
- Dedup: OR logic with 28%/0.45 thresholds (was 25%/0.4)
- Keywords: segments first → 3-grams → 2-grams
- False positive: 10% → acceptable level
- Accuracy: 80% correct dedup, 71% real rate
2026-08-12 19:20:14 +08:00
Aska dc3671eb8d feat(bench): add memory benchmark tool + export keywords
- tools/memory-bench: 6 metrics (write/search/dedup/keyword/bulk/rate)
- memory: export ExtractKeywordsPublic for benchmarking
- Results: 1000+ 条/秒 write, 380µs search, 80% dedup accuracy, 71% real rate
2026-08-12 19:15:15 +08:00
Aska 886fcf2216 fix(memory): rewrite dedup with n-gram keyword overlap + embedder
- Keyword extraction: 2-3 char sliding window + segment splitting
- Dedup: keyword overlap (>25%) OR Jaccard (>0.4) triggers merge
- SearchByNGrams: pgvector GIN index on keywords array
- Embedder: n-gram FNV hash (zero dep), OpenAI API with auto-fallback
- GIN index on keywords column for fast overlap search
- All tests pass
2026-08-12 18:24:04 +08:00
Aska 7295556c59 feat(services): add memory service — model, repository, service layer
- services/memory/model: Memory struct with categories and decay
- services/memory/repository: PostgreSQL CRUD + keyword search
- services/memory/service: dedup, decay, keyword extraction
- tests coming in follow-up commit
2026-08-09 20:50:01 +08:00