Commit Graph

477 Commits

Author SHA1 Message Date
Tarun Sukhani
fff48a146d memory-neo4j: add auto-recall filtering, assistant capture, importance scoring, conflict detection
Five high-impact improvements to the memory system:

1. Min RRF score threshold on auto-recall (default 0.25) — filters low-relevance
   results before injecting into context
2. Deduplicate auto-recall against core memories already present in context
3. Capture assistant messages (decisions, recommendations, synthesized facts)
   with stricter attention gating and "auto-capture-assistant" source type
4. LLM-judged importance scoring at capture time (0.1-1.0) with 5s timeout
   fallback to 0.5, replacing the flat 0.5 default
5. Conflict detection in sleep cycle (Phase 1b) — finds contradictory memories
   sharing entities, uses LLM to resolve, invalidates the loser

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 17:56:38 +08:00
Tarun Sukhani
9f6372241c hooks: fire session_end on /new and /reset so plugins clear bootstrap state 2026-02-16 17:56:38 +08:00
Tarun Sukhani
9cfb56696f memory-neo4j: extract stripMessageWrappers helper, use in cleanup for accurate gating 2026-02-16 17:56:38 +08:00
Tarun Sukhani
6747967b83 memory-neo4j: strip channel metadata wrappers, reject system infra messages in attention gate 2026-02-16 17:56:38 +08:00
Tarun Sukhani
7674fa8c15 memory-neo4j: cleanup targets auto-capture only, trust explicit memory_store 2026-02-16 17:56:38 +08:00
Tarun Sukhani
91efe2e432 memory-neo4j: tighten attention gate, add gate to memory_store, add cleanup command 2026-02-16 17:56:38 +08:00
Tarun Sukhani
ae1d35aab3 fix: remove unnecessary type assertion in neo4j config 2026-02-16 17:56:38 +08:00
Tarun Sukhani
bcbeba400e memory-neo4j: strip injected context blocks, add core category, widen embeddings context 2026-02-16 17:56:38 +08:00
Tarun Sukhani
b0a9eb9407 memory-neo4j: drop entity vector embeddings (use fulltext search) 2026-02-16 17:56:38 +08:00
Tarun Sukhani
f1f32d5723 feat(memory-neo4j): log auto-capture at info level even when 0 stored 2026-02-16 17:56:38 +08:00
Tarun Sukhani
370adb0f4b memory-neo4j: add 'openclaw memory neo4j index' reindex command
Adds a CLI command to re-embed all Memory and Entity nodes after
changing the embedding model or provider. Drops old vector indexes,
re-embeds in batches via the configured provider, and recreates
indexes with the correct dimensions.
2026-02-16 17:56:38 +08:00
Tarun Sukhani
50f095ecb0 chore: fix lint curly brace in embeddings.ts 2026-02-16 17:56:38 +08:00
Tarun Sukhani
8e5fe5fc14 memory-neo4j: add context-length-aware embedding truncation 2026-02-16 17:56:38 +08:00
Tarun Sukhani
d096055a4b chore: fix lint errors in memory-neo4j 2026-02-16 17:56:38 +08:00
Tarun Sukhani
3082c53a76 memory-neo4j: harden error handling, concurrency safety, config validation + add tests 2026-02-16 17:56:38 +08:00
Tarun Sukhani
c1371b639e memory-neo4j: configurable extraction model + sleep cycle optimizations
- Add extraction config section (apiKey, model, baseUrl) to plugin schema
  with env-var fallback and Ollama/local LLM support (no API key required)
- Add category classification to extraction prompt; update memories from
  'other' to LLM-assigned category
- Reorder sleep phases: extraction before decay
- Parallelize extraction (3 concurrent via Promise.allSettled)
- Pre-compute effective scores once and reuse for promotion/demotion
- Replace O(n²) Cartesian dedup with per-memory HNSW vector index queries
- Use mentionCount for orphan entity detection instead of subquery
- Remove dead auto-capture code (evaluateAutoCapture, CaptureItem, etc.)
2026-02-16 17:56:38 +08:00
Tarun Sukhani
66f9f972b2 chore: remove unused imports in mid-session-refresh test
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 17:56:38 +08:00
Tarun Sukhani
1e4ffdcec8 memory-neo4j: implement mid-session core memory refresh
Add `coreMemory.refreshAtContextPercent` config option to re-inject
core memories when context usage exceeds a threshold. This counters
the "lost in the middle" phenomenon documented by Liu et al. (2023).

Implementation:
- Extend before_agent_start hook event with context usage info
- Pass contextWindowTokens and estimatedUsedTokens to hooks
- Track mid-session refresh per session to prevent over-refreshing
- Clear refresh tracking on compaction
- Add comprehensive tests

Based on research: Liu et al., "Lost in the Middle: How Language
Models Use Long Contexts" (Stanford, 2023)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 17:56:38 +08:00
Tarun Sukhani
e7ac300b7e memory-neo4j: add Pareto-based memory ecosystem with retrieval tracking
Implement retrieval tracking and Pareto-based memory consolidation:

- Track retrievalCount and lastRetrievedAt on every search
- Effective importance formula: importance × freq_boost × recency_factor
- Seven-phase sleep cycle: dedup, pareto scoring, promotion, demotion,
  decay/pruning, extraction, cleanup
- Bidirectional mobility between core (≤20%) and regular memory tiers
- Core memories ranked by pure usage (no importance multiplier)

Based on ACT-R memory model and Ebbinghaus forgetting curve research.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 17:56:38 +08:00
Tarun Sukhani
e65d1deedd Sync adabot changes on top of origin/main
Includes:
- memory-neo4j: four-phase sleep cycle (dedup, decay, extraction, cleanup)
- memory-neo4j: full plugin implementation with hybrid search
- memory-lancedb: updates and benchmarks
- OpenSpec workflow skills and commands
- Session memory hooks
- Various CLI and config improvements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 17:56:38 +08:00
Peter Steinberger
39fa81dc96 chore: bump version to 2026.2.16 2026-02-16 06:08:47 +01:00
Peter Steinberger
702b94fe8f style(line): format files to unblock ci check 2026-02-16 03:39:41 +00:00
Vignesh Natarajan
c7bc7249c3 test (security/line): cover missing webhook auth startup paths 2026-02-15 19:25:33 -08:00
Vignesh Natarajan
beb77229c0 fix (security/line): fail closed when webhook auth is missing 2026-02-15 19:25:33 -08:00
Shadow
a61c2dc4bd Discord: add component v2 UI tool support (#17419) 2026-02-15 21:19:25 -06:00
Peter Steinberger
59c0b2bb37 refactor(auth): reuse oauth auth result helper 2026-02-15 19:37:40 +00:00
Peter Steinberger
342e9cac03 refactor(status): reuse plugin-sdk status helpers 2026-02-15 19:37:40 +00:00
Peter Steinberger
bdfa2b490b refactor(media): reuse buildAgentMediaPayload 2026-02-15 19:37:40 +00:00
Peter Steinberger
00e63da336 refactor(webhooks): reuse plugin-sdk webhook path helpers 2026-02-15 19:37:40 +00:00
Peter Steinberger
88548784ce fix(bluebubbles): use Buffer for multipart body 2026-02-15 19:25:11 +00:00
Peter Steinberger
719280d737 refactor(bluebubbles): share multipart helpers 2026-02-15 19:24:03 +00:00
Peter Steinberger
de103773c7 refactor(tlon): share urbit poke/scry ops 2026-02-15 19:21:42 +00:00
Peter Steinberger
0653e8d2ec refactor(matrix): dedupe group config resolution 2026-02-15 19:21:37 +00:00
Peter Steinberger
699136f89a refactor(msteams): share credential prompt 2026-02-15 19:21:31 +00:00
Shadow
c6b3736fe7 fix: dedupe probe/token base types (#16986) (thanks @iyoda) 2026-02-15 11:36:54 -06:00
Peter Steinberger
379b445582 chore: bump version to 2026.2.15 2026-02-15 04:50:31 +01:00
Peter Steinberger
fef86e475b refactor: dedupe shared helpers across ui/gateway/extensions 2026-02-15 03:34:14 +00:00
Vignesh Natarajan
ed7d83bcfc fix (memory/lancedb): require explicit opt-in for auto-capture 2026-02-14 18:20:48 -08:00
Vignesh Natarajan
61725fb37e fix (memory/lancedb): harden memory recall and auto-capture 2026-02-14 18:19:56 -08:00
Peter Steinberger
1ff15e60d3 chore(release): bump versions to 2026.2.14 2026-02-15 02:53:35 +01:00
Peter Steinberger
451deb066f refactor(plugin-sdk): reuse dedupe cache 2026-02-15 01:46:52 +00:00
Peter Steinberger
65aac6494a refactor(feishu): share download buffer reader 2026-02-15 01:46:52 +00:00
Peter Steinberger
b78bfd5213 fix(test): mock whatsapp outbound target resolver 2026-02-15 01:26:25 +00:00
Peter Steinberger
811e0c5797 refactor(bluebubbles): share send helpers 2026-02-15 01:15:43 +00:00
Peter Steinberger
5e205030ed refactor(telegram): share outbound param parsing 2026-02-15 01:15:43 +00:00
Peter Steinberger
461ead8ceb refactor(imessage): share target parsing helpers 2026-02-15 01:15:43 +00:00
Peter Steinberger
f835eb32f3 refactor(slack): share message action helpers 2026-02-15 01:15:43 +00:00
Peter Steinberger
eccd4d8c39 refactor(whatsapp): share target resolver 2026-02-15 01:15:43 +00:00
Peter Steinberger
56bc9b5058 refactor(zalo): share outbound chunker 2026-02-15 01:15:43 +00:00
Peter Steinberger
0d0ebd0e20 refactor(onboarding): share promptAccountId helper 2026-02-15 01:15:43 +00:00