Feature/knowledge box#13
Conversation
- Rename project and project_key to scope across all modules - Replace hex/hashed project IDs with human-readable scope strings - Implement derive_scope with git remote and local path fallbacks - Update MemoryManager and MemoryProvider to utilize scope - Update storage schema, indexing, and predicates to use scope - Add global flag to memorize tool for cross-project storage - Implement specialized tool schemas for different lock states - Sanitize scope strings for filesystem compatibility and markers - Remove sha2 dependency from storage module BREAKING CHANGE: The --project CLI flag and tool parameters are replaced by --scope. MemoryManager::new now requires scope instead of project_key.
- Move stale reference cleanup and sleep consolidation to tokio tasks - Change MemoryManager methods to take &self instead of &mut self - Prevent background maintenance from blocking manager initialization
- Add git-backed knowledge box management via CLI and MCP - Implement BoxRegistry for remote subscription and shallow cloning - Introduce box:// URI scheme for tracking sourced knowledge - Add scoped visibility and filtering for search and match queries - Implement automatic project discovery and background sync for .box dirs - Add recursive filesystem walking and hash-based smart reindexing - Migrate database schema with scope column and bitmap indexing - Update store_chunks and search signatures to support scope parameters BREAKING CHANGE: updated store_chunks and search method signatures to include scope parameters
- Pin alloc-stdlib to 0.2.2 and brotli-decompressor to 5.0.1 - Prevent alloc-no-stdlib version mismatch between 2.x and 3.x - Resolve E0277 trait implementation conflict for StandardAlloc - Bump fastembed, wasm-bindgen, and zeroize dependencies
Octomind — developer:brief (octohub:glm)Now I have a thorough understanding of the changes. Let me compile the brief. 📦 Brief: Knowledge boxes (git-backed scoped knowledge bundles) + scope refactor + background init + dep pinsOverall risk: 🟡 MEDIUM · Cards: 4
Card 1/4: Knowledge boxes — git-backed scoped knowledge bundles · 🟡 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS
RISK QUESTIONS
DIVERGENCE
📎 Source
Card 2/4: Knowledge scope column + visibility filter + migration · 🟡 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS
RISK 📎 Source
Card 3/4: Memory manager background init + &mut self → &self refactor · 🟢 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS
RISK 📎 Source
Card 4/4: MCP session schema reshuffle + global flag + box sync on init · 🟢 · ●●○INTENT WHAT CHANGED
IMPACT RADIUS
RISK 📎 Source
📂 Files changed (14 files, ~1219 insertions, ~216 deletions)
{tokens:315497,cost:0.32664000000000004} |
Octomind — developer:brief (octohub:glm){} |
- Expand scalar predicate to match project or empty scope - Reformat search calls in knowledge store tests
Octomind — developer:brief (octohub:glm)Now I have all the evidence I need. Let me produce the brief. 📦 Brief: Two targeted fixes — session scope assignment bug + empty-scope predicate filterOverall risk: 🟢 LOW · Cards: 2
Card 1/2: MCP session scope assignment used wrong variable · 🟢 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS RISK 📎 Source
Card 2/2: Scope predicate now includes empty-scope (global) memories · 🟢 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS RISK 📎 Source
📂 Files changed (3 files, ~30 lines)
{tokens:116070,cost:0.12176800000000002} |
The parent/child chunker embeds a small focused child for matching but stores the full section as parent_content so the consumer gets rich context. The CLI honored this; the MCP search path (what agents actually use) rendered only a 300-char slice of the *child*, defeating the design for the primary consumer. Return parent_content (falling back to the child when the section was already small) and raise the per-hit cap to 1500 chars. Parent is already bounded to 4*chunk_size at write time, so the cap stays token-safe. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
MemoryQuery already supported created_after/created_before (pushed down
to the created_at BTree index) and min_relevance, but the remember MCP
tool never populated them — the capability was built and dead. Temporal
scoping is worth a meaningful recall lift on time-anchored questions
("what did I decide last week"), which LongMemEval measures directly.
- Add created_after/created_before (ISO-8601 date or RFC3339 datetime)
and wire the already-advertised min_relevance into the query.
- parse_iso_datetime accepts a bare date (→ midnight UTC) or a full
timestamp; unparseable/absent input simply skips the filter.
- Tool description tells the agent to compute the window itself (it knows
the current date) — no brittle in-tool natural-language date parsing.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two read-side ranking improvements, both no-LLM and reusing existing infrastructure. remember_multi: replace the keep-max-score + flat 10%-per-extra-match heuristic with Reciprocal Rank Fusion (same k=60 the in-store hybrid fusion uses). The old merge mixed per-query weighted-sum scores computed on incomparable scales and discarded a memory ranked solidly across all queries in favor of a one-off top hit. RRF is rank-based and scale-free, so query decomposition actually pays off. rrf_fuse is a pure function with unit tests. Supersedes: the relationship type was defined, parsed from related_to, and stored — but never read at retrieval. suppress_superseded() now soft-down-ranks (×0.1, never deletes) any result an active "X Supersedes M" edge marks as outdated, so the current fact outranks the stale one on knowledge-update queries while history stays queryable. Edges are only honored, never auto-created (detecting a genuine contradiction needs semantic judgment, which octobrain deliberately keeps off the hot path). Best-effort: a relationship-lookup failure leaves the result untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…RF guard Four isolated correctness fixes in the hot retrieval path. 1. Reranker honored a fixed final_top_k instead of the caller's limit, so a limit=5 request returned up to 10 and limit=20 returned only 10. Pass the caller's limit through; fall back to final_top_k only when unset. Also degrade gracefully: a reranker timeout/outage now falls back to the hybrid ranking (capped to the limit) instead of failing the whole search. 2. RRF fusion normalized by 2/k (assumes rank-0 in BOTH vector and BM25), which capped a paraphrased memory that only the dense leg finds at 0.5 — demoting it below mediocre both-list hits. Normalize by 1/k so any rank-0 hit reaches ~1.0; the absolute scale is preserved (weak queries still score low, so min_relevance/abstention keep working). Same fix mirrored in the knowledge store. 3. build_scalar_predicate never filtered on state, so Archived tombstones could surface in relevance search. Exclude state='archived' unconditionally; Working + Consolidated stay retrievable for multi-granularity recall. 4. HyDE/Rocchio PRF expanded the query from a single neighbor's embedding, dragging it toward one (often noisy) doc — classic drift, worst on the sparse queries PRF should help. Require >=2 neighbors before expanding. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The retrieval side now honors Supersedes edges (down-ranks the stale fact), but that only fires if agents actually create the edges. Tell the memorize tool, in concrete terms, to link a replacing fact to the one it supersedes — activating the read-side mechanic in real usage. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… into retrieval Both SearchConfig fields were parsed, defaulted, and documented but never read by any search path (MCP, CLI, or the store) — pure dead config. Now they drive behavior: - similarity_threshold becomes the default relevance floor for SEMANTIC (text) queries. Filter-only listings (recent, by-type, by-tags, for-files — no query_text) keep a 0.0 floor so they are never silently truncated by score. A per-call min_relevance still overrides it. - search.max_results is now the hard ceiling enforced in BOTH the vector and hybrid paths (hybrid previously never capped an explicit caller limit). memory.max_search_results stays as the default page size when a caller gives no limit — the two are now distinct, documented roles. Template comments clarified to match. No schema change; existing configs parse unchanged (no deny_unknown_fields). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Octomind — developer:brief (octohub:glm)Now I have full context. Let me write the brief. 📦 Brief: Six commits activating dead config/capabilities and fixing four correctness bugs in the memory retrieval hot pathOverall risk: 🟡 MEDIUM · Cards: 5
Card 1/5: Reranker respects caller limit and degrades gracefully on failure · 🟢 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS
RISK 📎 Source
Card 2/5: RRF normalization, archived exclusion, and HyDE PRF guard — three hot-path correctness fixes · 🟡 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS
RISK QUESTIONS
📎 Source
Card 3/5: Multi-query retrieval uses RRF fusion; Supersedes edges now down-rank stale facts · 🟡 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS
RISK DIVERGENCE 📎 Source
Card 4/5: MCP remember wires temporal/relevance filters; knowledge search returns full parent sections · 🟡 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS
RISK 📎 Source
Card 5/5: Dead config activated — similarity_threshold and max_results now drive retrieval · 🟡 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS
RISK QUESTIONS
📎 Source
📂 Files changed (11 files, ~333 lines)
{tokens:150356,cost:0.1675908} |
- Add beir_bench binary for evaluating vector and hybrid search - Implement nDCG@10, Recall@10/100, and MRR@10 metrics - Add run_retrieval.sh for automated dataset evaluation and reporting - Implement cross-encoder reranking for search results - Add bulk_store and open_at for high-performance data loading - Introduce ChunkedDocument struct to unify ingestion pipeline - Add embed_and_store helper to deduplicate ingestion logic - Optimize search to fetch larger candidate sets for reranking - Update Cargo.toml and documentation for new benchmarking features
Octomind — developer:brief (octohub:glm)📦 Brief: BEIR retrieval benchmarking harness + cross-encoder reranking for knowledge search + ingestion refactorOverall risk: 🟡 MEDIUM · Cards: 4
Card 1/4: BEIR retrieval benchmark harness · 🟢 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS RISK DIVERGENCE 📎 Source
Card 2/4: Cross-encoder reranking added to knowledge search · 🟡 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS RISK QUESTIONS 📎 Source
Card 3/4: Ingestion pipeline unified via ChunkedDocument + embed_and_store · 🟢 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS RISK 📎 Source
Card 4/4: [search.hyde] config section now required · 🟡 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS RISK QUESTIONS 📎 Source
📂 Files changed (10 files, ~932 lines)
{tokens:523572,cost:0.5597224000000001} |
Octomind — developer:brief (octohub:glm)The evidence from the tool output was: [evidence: shell grep of My earlier quote used {tokens:698635,cost:0.7076153999999998} |
- upgrade syn to 2.0.118 - upgrade quote to 1.0.46 - upgrade safetensors to 0.8.0 - upgrade fastembed to 5.17.2 - remove unused wasm and wit-bindgen versions - update miscellaneous crate versions
Octomind — developer:brief (octohub:glm)📦 Brief: Cargo.lock dependency bump — version upgrades + removal of unused wasm/wit-bindgen treeOverall risk: 🟢 LOW · Cards: 1
Card 1/1: Lockfile dependency bump — no source changes, two version splits introduced · 🟢 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS RISK QUESTIONS 📎 Source
📂 Files changed (1 file, ~467 lines)
{tokens:4678555,cost:4.7127496} |
No description provided.