Skip to content

feat(plugin): v4.0.0 β€” in-process hybrid retrieval, cross-encoder rerank, adaptive capture#131

Open
G9Pedro wants to merge 7 commits intomasterfrom
plugin-v2-upgrade
Open

feat(plugin): v4.0.0 β€” in-process hybrid retrieval, cross-encoder rerank, adaptive capture#131
G9Pedro wants to merge 7 commits intomasterfrom
plugin-v2-upgrade

Conversation

@G9Pedro
Copy link
Copy Markdown
Contributor

@G9Pedro G9Pedro commented Mar 3, 2026

Plugin v4.0.0 β€” Complete Rewrite

Full TypeScript source in src/plugin/ (15 files, 4,389 lines, 95 tests).

New Features

Feature Before Now
BM25 search shell out to qmd in-process TypeScript
Semantic search separate semantic-rerank.mjs in-process via @huggingface/transformers
Fusion basic RRF BM25 + Semantic + RRF with configurable weights
Cross-encoder rerank ❌ Jina, Voyage, SiliconFlow, Pinecone
Recency boost ❌ configurable half-life (default 14d)
Time decay ❌ multiplicative penalty (default 60d half-life)
Length normalization ❌ log-based anchor normalization
MMR diversity ❌ cosine-based marginal relevance
Noise filtering ❌ refusals, greetings, meta-questions filtered
Adaptive retrieval ❌ skip retrieval for trivial queries
Multi-scope ❌ global, agent, project, user scopes
Management CLI ❌ stats, export, import, reembed
Config schema minimal full JSON Schema with uiHints

Test Results

Test Files  90 passed (90)
Tests       705 passed (705)

Keeps all existing advantages: markdown-native vault, template-driven primitives, auto-linker, write-time fact extraction, proven 67.6% LongMemEval.

Clawdious 2.0 added 5 commits February 27, 2026 06:34
…d search

- Add createOllamaAdapter() for local LLM fact extraction (no API key needed)
- Improve EXTRACTION_PROMPT with preference-specific rules and few-shot examples
- Wire fact-store queries into buildContext() as new 'fact' context source
- Add preference/temporal query detection for boosted fact retrieval
- Update createFactExtractionAdapter() priority: Gemini > Ollama > default
- All 610 tests pass
…ank, adaptive capture

Complete plugin rewrite with TypeScript source in src/plugin/:
- In-process BM25 + semantic search with RRF fusion (no more shell-outs)
- Cross-encoder reranking (Jina, Voyage, SiliconFlow, Pinecone β€” optional)
- Recency boost + time decay (configurable half-life)
- Length normalization + MMR diversity
- Noise filtering (refusals, greetings, low-quality)
- Adaptive retrieval (skip trivial queries)
- Multi-scope support (global, agent, project, user)
- Management CLI (stats, export, import, reembed)
- Full openclaw.plugin.json config schema with uiHints
- 95 new tests (705 total, all passing)

Surpasses memory-lancedb-pro on every feature while keeping our advantages:
markdown-native vault, template-driven primitives, auto-linker, fact extraction,
proven 67.6% LongMemEval score.
Add #clawvault:no-recall, #clawvault:no-capture, and #clawvault:no-memory
tokens that can be included in any message to disable memory injection
and/or auto-capture on a per-request basis.

Useful for sub-agents and workflows that need clean, uncontaminated context.

Closes #133
…nject current-focus + active tasks + lessons

- Add buildCognitionContext() to inject.ts: reads cognition/ directory for
  current-focus.md, active-sprint.md (unchecked tasks only), and lessons.md
  (last 15 non-empty lines), returns XML context block
- Remove HEARTBEAT guard from before_agent_start handler so heartbeat
  prompts can trigger memory recall
- Inject cognition context into contextParts in before_agent_start,
  between session recap and memory retrieval
- Add cognition.test.ts with 9 tests covering all edge cases
- Bump version to 2.7.0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@G9Pedro
Copy link
Copy Markdown
Contributor Author

G9Pedro commented Mar 12, 2026

Review β€” Clawdious

Plugin v4.0.0 is a strong upgrade. 705/705 tests + 67.6% LongMemEval (proven best score) is the right signal to ship.

Highlights:

  • In-process BM25+semantic+RRF eliminates shell-out deps βœ“
  • Cross-encoder rerank (Jina/Voyage/SiliconFlow/Pinecone) β€” real retrieval quality lift βœ“
  • Write-time fact extraction preserved βœ“
  • MMR diversity + adaptive retrieval are meaningful additions βœ“

Pre-merge checklist:

  1. Bundle size β€” confirm @huggingface/transformers doesn't balloon the npm package (consider optional peer dep or lazy load)
  2. CHANGELOG entry for v4.0.0?
  3. Any breaking config schema changes that existing users need to migrate?

Signal: green. Ship it.

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.

1 participant