2026-01-26 01:31:58 -06:00
//! Unified Search Tool
//!
//! Merges recall, semantic_search, and hybrid_search into a single `search` tool.
//! Always uses hybrid search internally (keyword + semantic + RRF fusion).
//! Implements Testing Effect (Roediger & Karpicke 2006) by auto-strengthening memories on access.
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
//!
//! v1.5.0: Enhanced 7-stage cognitive pipeline:
//! 1. Reranker (over-fetch 3x, rerank down)
//! 2. Temporal boosting (recency + validity)
//! 3. Memory state accessibility filtering
//! 4. Context matching (topic overlap)
//! 5. Spreading activation associations
//! 6. Predictive memory recording
//! 7. Reconsolidation (mark labile)
use chrono ::Utc ;
2026-01-26 01:31:58 -06:00
use serde ::Deserialize ;
use serde_json ::Value ;
use std ::sync ::Arc ;
use tokio ::sync ::Mutex ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
use crate ::cognitive ::CognitiveEngine ;
use vestige_core ::{
CompetitionCandidate , EncodingContext , MemoryLifecycle , MemorySnapshot , MemoryState , Storage ,
TopicalContext ,
} ;
2026-01-26 01:31:58 -06:00
/// Input schema for unified search tool
pub fn schema ( ) -> Value {
serde_json ::json! ( {
" type " : " object " ,
" properties " : {
" query " : {
" type " : " string " ,
" description " : " Search query "
} ,
" limit " : {
" type " : " integer " ,
" description " : " Maximum number of results (default: 10) " ,
" default " : 10 ,
" minimum " : 1 ,
" maximum " : 100
} ,
" min_retention " : {
" type " : " number " ,
" description " : " Minimum retention strength (0.0-1.0, default: 0.0) " ,
" default " : 0.0 ,
" minimum " : 0.0 ,
" maximum " : 1.0
} ,
" min_similarity " : {
" type " : " number " ,
" description " : " Minimum similarity threshold (0.0-1.0, default: 0.5) " ,
" default " : 0.5 ,
" minimum " : 0.0 ,
" maximum " : 1.0
feat: Vestige v1.2.0 — dashboard, temporal tools, maintenance tools, detail levels
Add web dashboard (axum) on port 3927 with memory browser, search, and
system stats. New MCP tools: memory_timeline, memory_changelog,
health_check, consolidate, stats, backup, export, gc. Search now supports
detail_level (brief/summary/full) to control token usage. Add backup_to()
and get_recent_state_transitions() to storage layer. Bump to v1.2.0.
2026-02-12 04:33:05 -06:00
} ,
" detail_level " : {
" type " : " string " ,
" description " : " Level of detail in results. 'brief' = id/type/tags/score only (saves tokens). 'summary' = default 8-field response. 'full' = all fields including FSRS state and timestamps. " ,
" enum " : [ " brief " , " summary " , " full " ] ,
" default " : " summary "
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
} ,
" context_topics " : {
" type " : " array " ,
" items " : { " type " : " string " } ,
" description " : " Optional topics for context-dependent retrieval boosting "
feat: Vestige v1.9.1 AUTONOMIC — self-regulating memory with graph visualization
Retention Target System: auto-GC low-retention memories during consolidation
(VESTIGE_RETENTION_TARGET env var, default 0.8). Auto-Promote: memories
accessed 3+ times in 24h get frequency-dependent potentiation. Waking SWR
Tagging: promoted memories get preferential 70/30 dream replay. Improved
Consolidation Scheduler: triggers on 6h staleness or 2h active use.
New tools: memory_health (retention dashboard with distribution buckets,
trend tracking, recommendations) and memory_graph (subgraph export with
Fruchterman-Reingold force-directed layout, up to 200 nodes).
Dream connections now persist to database via save_connection(), enabling
memory_graph traversal. Schema Migration V8 adds waking_tag, utility_score,
times_retrieved/useful columns and retention_snapshots table. 21 MCP tools.
v1.9.1 fixes: ConnectionRecord export, UTF-8 safe truncation, link_type
normalization, utility_score clamping, only-new-connections persistence,
70/30 split capacity fill, nonexistent center_id error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:02:06 -06:00
} ,
2026-04-07 15:32:28 -05:00
" exclude_types " : {
" type " : " array " ,
" items " : { " type " : " string " } ,
" description " : " Node types to exclude from results (e.g., ['reflection']). Reflections are excluded by default to prevent polluting factual queries. "
} ,
" include_types " : {
" type " : " array " ,
" items " : { " type " : " string " } ,
" description " : " If set, only return nodes of these types. Overrides exclude_types. "
} ,
feat: Vestige v1.9.1 AUTONOMIC — self-regulating memory with graph visualization
Retention Target System: auto-GC low-retention memories during consolidation
(VESTIGE_RETENTION_TARGET env var, default 0.8). Auto-Promote: memories
accessed 3+ times in 24h get frequency-dependent potentiation. Waking SWR
Tagging: promoted memories get preferential 70/30 dream replay. Improved
Consolidation Scheduler: triggers on 6h staleness or 2h active use.
New tools: memory_health (retention dashboard with distribution buckets,
trend tracking, recommendations) and memory_graph (subgraph export with
Fruchterman-Reingold force-directed layout, up to 200 nodes).
Dream connections now persist to database via save_connection(), enabling
memory_graph traversal. Schema Migration V8 adds waking_tag, utility_score,
times_retrieved/useful columns and retention_snapshots table. 21 MCP tools.
v1.9.1 fixes: ConnectionRecord export, UTF-8 safe truncation, link_type
normalization, utility_score clamping, only-new-connections persistence,
70/30 split capacity fill, nonexistent center_id error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:02:06 -06:00
" token_budget " : {
" type " : " integer " ,
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
" description " : " Max tokens for response. Server truncates content to fit budget. Use memory(action='get') for full content of specific IDs. With 1M context models, budgets up to 100K are practical. " ,
feat: Vestige v1.9.1 AUTONOMIC — self-regulating memory with graph visualization
Retention Target System: auto-GC low-retention memories during consolidation
(VESTIGE_RETENTION_TARGET env var, default 0.8). Auto-Promote: memories
accessed 3+ times in 24h get frequency-dependent potentiation. Waking SWR
Tagging: promoted memories get preferential 70/30 dream replay. Improved
Consolidation Scheduler: triggers on 6h staleness or 2h active use.
New tools: memory_health (retention dashboard with distribution buckets,
trend tracking, recommendations) and memory_graph (subgraph export with
Fruchterman-Reingold force-directed layout, up to 200 nodes).
Dream connections now persist to database via save_connection(), enabling
memory_graph traversal. Schema Migration V8 adds waking_tag, utility_score,
times_retrieved/useful columns and retention_snapshots table. 21 MCP tools.
v1.9.1 fixes: ConnectionRecord export, UTF-8 safe truncation, link_type
normalization, utility_score clamping, only-new-connections persistence,
70/30 split capacity fill, nonexistent center_id error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:02:06 -06:00
" minimum " : 100 ,
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
" maximum " : 100000
} ,
" retrieval_mode " : {
" type " : " string " ,
" description " : " precise: top results only (fast, token-efficient, skips activation/competition). balanced: full 7-stage cognitive pipeline (default). exhaustive: maximum recall with 5x overfetch, deep graph traversal, no competition suppression. " ,
" enum " : [ " precise " , " balanced " , " exhaustive " ] ,
" default " : " balanced "
2026-01-26 01:31:58 -06:00
}
} ,
" required " : [ " query " ]
} )
}
#[ derive(Debug, Deserialize) ]
#[ serde(rename_all = " camelCase " ) ]
struct SearchArgs {
query : String ,
limit : Option < i32 > ,
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
#[ serde(alias = " min_retention " ) ]
2026-01-26 01:31:58 -06:00
min_retention : Option < f64 > ,
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
#[ serde(alias = " min_similarity " ) ]
2026-01-26 01:31:58 -06:00
min_similarity : Option < f32 > ,
feat: Vestige v1.2.0 — dashboard, temporal tools, maintenance tools, detail levels
Add web dashboard (axum) on port 3927 with memory browser, search, and
system stats. New MCP tools: memory_timeline, memory_changelog,
health_check, consolidate, stats, backup, export, gc. Search now supports
detail_level (brief/summary/full) to control token usage. Add backup_to()
and get_recent_state_transitions() to storage layer. Bump to v1.2.0.
2026-02-12 04:33:05 -06:00
#[ serde(alias = " detail_level " ) ]
detail_level : Option < String > ,
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
#[ serde(alias = " context_topics " ) ]
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
context_topics : Option < Vec < String > > ,
2026-04-07 15:32:28 -05:00
#[ serde(alias = " exclude_types " ) ]
exclude_types : Option < Vec < String > > ,
#[ serde(alias = " include_types " ) ]
include_types : Option < Vec < String > > ,
feat: Vestige v1.9.1 AUTONOMIC — self-regulating memory with graph visualization
Retention Target System: auto-GC low-retention memories during consolidation
(VESTIGE_RETENTION_TARGET env var, default 0.8). Auto-Promote: memories
accessed 3+ times in 24h get frequency-dependent potentiation. Waking SWR
Tagging: promoted memories get preferential 70/30 dream replay. Improved
Consolidation Scheduler: triggers on 6h staleness or 2h active use.
New tools: memory_health (retention dashboard with distribution buckets,
trend tracking, recommendations) and memory_graph (subgraph export with
Fruchterman-Reingold force-directed layout, up to 200 nodes).
Dream connections now persist to database via save_connection(), enabling
memory_graph traversal. Schema Migration V8 adds waking_tag, utility_score,
times_retrieved/useful columns and retention_snapshots table. 21 MCP tools.
v1.9.1 fixes: ConnectionRecord export, UTF-8 safe truncation, link_type
normalization, utility_score clamping, only-new-connections persistence,
70/30 split capacity fill, nonexistent center_id error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:02:06 -06:00
#[ serde(alias = " token_budget " ) ]
token_budget : Option < i32 > ,
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
#[ serde(alias = " retrieval_mode " ) ]
retrieval_mode : Option < String > ,
2026-01-26 01:31:58 -06:00
}
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
/// Execute unified search with 7-stage cognitive pipeline.
2026-01-26 01:31:58 -06:00
///
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
/// Pipeline:
/// 1. Hybrid search (keyword + semantic + RRF) with 3x over-fetch
/// 2. Reranker (BM25-like rescoring, trim to limit)
/// 3. Temporal boosting (recency + validity windows)
/// 4. Memory state accessibility filtering (Active/Dormant/Silent/Unavailable)
/// 5. Context matching (topic overlap boosting)
/// 6. Spreading activation (find associated memories)
/// 7. Side effects: predictive memory recording + reconsolidation labile marking
///
/// Also applies Testing Effect (Roediger & Karpicke 2006) by auto-strengthening on access.
2026-01-26 01:31:58 -06:00
pub async fn execute (
feat: Vestige v1.9.1 AUTONOMIC — self-regulating memory with graph visualization
Retention Target System: auto-GC low-retention memories during consolidation
(VESTIGE_RETENTION_TARGET env var, default 0.8). Auto-Promote: memories
accessed 3+ times in 24h get frequency-dependent potentiation. Waking SWR
Tagging: promoted memories get preferential 70/30 dream replay. Improved
Consolidation Scheduler: triggers on 6h staleness or 2h active use.
New tools: memory_health (retention dashboard with distribution buckets,
trend tracking, recommendations) and memory_graph (subgraph export with
Fruchterman-Reingold force-directed layout, up to 200 nodes).
Dream connections now persist to database via save_connection(), enabling
memory_graph traversal. Schema Migration V8 adds waking_tag, utility_score,
times_retrieved/useful columns and retention_snapshots table. 21 MCP tools.
v1.9.1 fixes: ConnectionRecord export, UTF-8 safe truncation, link_type
normalization, utility_score clamping, only-new-connections persistence,
70/30 split capacity fill, nonexistent center_id error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:02:06 -06:00
storage : & Arc < Storage > ,
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
cognitive : & Arc < Mutex < CognitiveEngine > > ,
2026-01-26 01:31:58 -06:00
args : Option < Value > ,
) -> Result < Value , String > {
let args : SearchArgs = match args {
Some ( v ) = > serde_json ::from_value ( v ) . map_err ( | e | format! ( " Invalid arguments: {} " , e ) ) ? ,
None = > return Err ( " Missing arguments " . to_string ( ) ) ,
} ;
if args . query . trim ( ) . is_empty ( ) {
return Err ( " Query cannot be empty " . to_string ( ) ) ;
}
feat: Vestige v1.2.0 — dashboard, temporal tools, maintenance tools, detail levels
Add web dashboard (axum) on port 3927 with memory browser, search, and
system stats. New MCP tools: memory_timeline, memory_changelog,
health_check, consolidate, stats, backup, export, gc. Search now supports
detail_level (brief/summary/full) to control token usage. Add backup_to()
and get_recent_state_transitions() to storage layer. Bump to v1.2.0.
2026-02-12 04:33:05 -06:00
// Validate detail_level
let detail_level = match args . detail_level . as_deref ( ) {
Some ( " brief " ) = > " brief " ,
Some ( " full " ) = > " full " ,
Some ( " summary " ) | None = > " summary " ,
Some ( invalid ) = > {
return Err ( format! (
" Invalid detail_level '{}'. Must be 'brief', 'summary', or 'full'. " ,
invalid
) ) ;
}
} ;
2026-01-26 01:31:58 -06:00
// Clamp all parameters to valid ranges
let limit = args . limit . unwrap_or ( 10 ) . clamp ( 1 , 100 ) ;
let min_retention = args . min_retention . unwrap_or ( 0.0 ) . clamp ( 0.0 , 1.0 ) ;
let min_similarity = args . min_similarity . unwrap_or ( 0.5 ) . clamp ( 0.0 , 1.0 ) ;
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
// Validate retrieval_mode
let retrieval_mode = match args . retrieval_mode . as_deref ( ) {
Some ( " precise " ) = > " precise " ,
Some ( " exhaustive " ) = > " exhaustive " ,
Some ( " balanced " ) | None = > " balanced " ,
Some ( invalid ) = > {
return Err ( format! (
" Invalid retrieval_mode '{}'. Must be 'precise', 'balanced', or 'exhaustive'. " ,
invalid
) ) ;
}
} ;
2026-02-19 01:09:39 -06:00
// Favor semantic search — research shows 0.3/0.7 outperforms equal weights
let keyword_weight = 0.3_ f32 ;
let semantic_weight = 0.7_ f32 ;
2026-01-26 01:31:58 -06:00
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
// ====================================================================
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
// STAGE 1: Hybrid search with Nx over-fetch for reranking pool
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
// ====================================================================
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
let overfetch_multiplier = match retrieval_mode {
" precise " = > 1 , // No overfetch — return exactly what's asked
" exhaustive " = > 5 , // Deep overfetch for maximum recall
_ = > 3 , // Balanced default
} ;
let overfetch_limit = ( limit * overfetch_multiplier ) . min ( 100 ) ; // Cap at 100 to avoid excessive DB load
2026-01-26 01:31:58 -06:00
feat: Vestige v1.9.1 AUTONOMIC — self-regulating memory with graph visualization
Retention Target System: auto-GC low-retention memories during consolidation
(VESTIGE_RETENTION_TARGET env var, default 0.8). Auto-Promote: memories
accessed 3+ times in 24h get frequency-dependent potentiation. Waking SWR
Tagging: promoted memories get preferential 70/30 dream replay. Improved
Consolidation Scheduler: triggers on 6h staleness or 2h active use.
New tools: memory_health (retention dashboard with distribution buckets,
trend tracking, recommendations) and memory_graph (subgraph export with
Fruchterman-Reingold force-directed layout, up to 200 nodes).
Dream connections now persist to database via save_connection(), enabling
memory_graph traversal. Schema Migration V8 adds waking_tag, utility_score,
times_retrieved/useful columns and retention_snapshots table. 21 MCP tools.
v1.9.1 fixes: ConnectionRecord export, UTF-8 safe truncation, link_type
normalization, utility_score clamping, only-new-connections persistence,
70/30 split capacity fill, nonexistent center_id error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:02:06 -06:00
let results = storage
2026-04-07 15:32:28 -05:00
. hybrid_search_filtered (
& args . query ,
overfetch_limit ,
keyword_weight ,
semantic_weight ,
args . include_types . as_deref ( ) ,
args . exclude_types . as_deref ( ) ,
)
2026-01-26 01:31:58 -06:00
. map_err ( | e | e . to_string ( ) ) ? ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
// Filter by min_retention and min_similarity first (cheap filters)
let mut filtered_results : Vec < _ > = results
2026-01-26 01:31:58 -06:00
. into_iter ( )
. filter ( | r | {
if r . node . retention_strength < min_retention {
return false ;
}
feat: Vestige v1.2.0 — dashboard, temporal tools, maintenance tools, detail levels
Add web dashboard (axum) on port 3927 with memory browser, search, and
system stats. New MCP tools: memory_timeline, memory_changelog,
health_check, consolidate, stats, backup, export, gc. Search now supports
detail_level (brief/summary/full) to control token usage. Add backup_to()
and get_recent_state_transitions() to storage layer. Bump to v1.2.0.
2026-02-12 04:33:05 -06:00
if let Some ( sem_score ) = r . semantic_score
& & sem_score < min_similarity
{
return false ;
2026-01-26 01:31:58 -06:00
}
true
} )
. collect ( ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
// ====================================================================
// STAGE 2: Reranker (BM25-like rescoring, trim to requested limit)
// ====================================================================
2026-02-19 01:09:39 -06:00
if let Ok ( mut cog ) = cognitive . try_lock ( ) {
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let candidates : Vec < _ > = filtered_results
. iter ( )
. map ( | r | ( r . clone ( ) , r . node . content . clone ( ) ) )
. collect ( ) ;
if let Ok ( reranked ) = cog . reranker . rerank ( & args . query , candidates , Some ( limit as usize ) ) {
// Replace filtered_results with reranked items (preserves original SearchResult)
filtered_results = reranked . into_iter ( ) . map ( | rr | rr . item ) . collect ( ) ;
} else {
// Reranker failed — fall back to original order, just truncate
filtered_results . truncate ( limit as usize ) ;
}
} else {
// Couldn't acquire cognitive lock — truncate to limit
filtered_results . truncate ( limit as usize ) ;
}
// ====================================================================
// STAGE 3: Temporal boosting (recency + validity windows)
// ====================================================================
if let Ok ( cog ) = cognitive . try_lock ( ) {
for result in & mut filtered_results {
let recency = cog . temporal_searcher . recency_boost ( result . node . created_at ) ;
let validity = cog . temporal_searcher . validity_boost (
result . node . valid_from ,
result . node . valid_until ,
None ,
) ;
// Blend: 85% relevance + 15% temporal signal
let temporal_factor = recency * validity ;
result . combined_score =
result . combined_score * 0.85 + ( result . combined_score * temporal_factor as f32 ) * 0.15 ;
}
}
// ====================================================================
// STAGE 4: Memory state accessibility filtering
// ====================================================================
if let Ok ( cog ) = cognitive . try_lock ( ) {
for result in & mut filtered_results {
// Build a MemoryLifecycle from node data for the calculator
let mut lifecycle = MemoryLifecycle ::new ( ) ;
lifecycle . last_access = result . node . last_accessed ;
lifecycle . access_count = result . node . reps as u32 ;
// Determine state from retention strength
lifecycle . state = if result . node . retention_strength > 0.7 {
MemoryState ::Active
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
} else if result . node . retention_strength > 0.4 {
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
MemoryState ::Dormant
} else if result . node . retention_strength > 0.1 {
MemoryState ::Silent
} else {
MemoryState ::Unavailable
} ;
let adjusted = cog
. accessibility_calc
. calculate ( & lifecycle , result . combined_score as f64 ) ;
result . combined_score = adjusted as f32 ;
}
}
// ====================================================================
// STAGE 5: Context matching (Tulving 1973 encoding specificity)
// ====================================================================
chore: license AGPL-3.0, zero clippy warnings, CHANGELOG through v1.6.0
License:
- Replace MIT/Apache-2.0 with AGPL-3.0-only across all crates and npm packages
- Replace LICENSE file with official GNU AGPL-3.0 text
- Remove LICENSE-MIT and LICENSE-APACHE
Code quality:
- Fix all 44 clippy warnings (zero remaining)
- Collapsible if statements, redundant closures, manual Option::map
- Remove duplicate #[allow(dead_code)] attributes in deprecated tool modules
- Add Default impl for CognitiveEngine
- Replace manual sort_by with sort_by_key
Documentation:
- Update CHANGELOG with v1.2.0, v1.3.0, v1.5.0, v1.6.0 entries
- Update README with v1.6.0 highlights and accurate stats (52K lines, 1100+ tests)
- Add fastembed-rs/ to .gitignore
- Add fastembed-rs to workspace exclude
1115 tests passing, zero warnings, RUSTFLAGS="-Dwarnings" clean.
2026-02-19 03:00:39 -06:00
if let Some ( ref topics ) = args . context_topics
& & ! topics . is_empty ( )
{
let retrieval_ctx = EncodingContext ::new ( )
. with_topical ( TopicalContext ::with_topics ( topics . clone ( ) ) ) ;
if let Ok ( cog ) = cognitive . try_lock ( ) {
for result in & mut filtered_results {
// Build encoding context from memory's tags
let encoding_ctx = EncodingContext ::new ( )
. with_topical ( TopicalContext ::with_topics ( result . node . tags . clone ( ) ) ) ;
let context_score = cog . context_matcher . match_contexts ( & encoding_ctx , & retrieval_ctx ) ;
// Blend: context match boosts relevance up to +30%
result . combined_score * = 1.0 + ( context_score as f32 * 0.3 ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
}
}
}
// Context reinstatement for top result (helps Claude understand WHY this memory matched)
let reinstatement_info : Option < Value > = if let Ok ( cog ) = cognitive . try_lock ( ) {
if let Some ( first ) = filtered_results . first ( ) {
let current_ctx = if let Some ( ref topics ) = args . context_topics {
EncodingContext ::new ( ) . with_topical ( TopicalContext ::with_topics ( topics . clone ( ) ) )
} else {
EncodingContext ::new ( )
} ;
let reinstatement = cog . context_matcher . reinstate_context ( & first . node . id , & current_ctx ) ;
Some ( serde_json ::json! ( {
" memoryId " : reinstatement . memory_id ,
" temporalHint " : reinstatement . temporal_hint ,
" topicalHint " : reinstatement . topical_hint ,
" sessionHint " : reinstatement . session_hint ,
" relatedMemories " : reinstatement . related_memories ,
} ) )
} else {
None
}
} else {
None
} ;
// ====================================================================
// STAGE 5B: Retrieval competition (Anderson et al. 1994)
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
// Skipped in precise mode (no need) and exhaustive mode (want all results)
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
// ====================================================================
let mut suppressed_count = 0_ usize ;
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
if retrieval_mode = = " balanced "
& & filtered_results . len ( ) > 1
chore: license AGPL-3.0, zero clippy warnings, CHANGELOG through v1.6.0
License:
- Replace MIT/Apache-2.0 with AGPL-3.0-only across all crates and npm packages
- Replace LICENSE file with official GNU AGPL-3.0 text
- Remove LICENSE-MIT and LICENSE-APACHE
Code quality:
- Fix all 44 clippy warnings (zero remaining)
- Collapsible if statements, redundant closures, manual Option::map
- Remove duplicate #[allow(dead_code)] attributes in deprecated tool modules
- Add Default impl for CognitiveEngine
- Replace manual sort_by with sort_by_key
Documentation:
- Update CHANGELOG with v1.2.0, v1.3.0, v1.5.0, v1.6.0 entries
- Update README with v1.6.0 highlights and accurate stats (52K lines, 1100+ tests)
- Add fastembed-rs/ to .gitignore
- Add fastembed-rs to workspace exclude
1115 tests passing, zero warnings, RUSTFLAGS="-Dwarnings" clean.
2026-02-19 03:00:39 -06:00
& & let Ok ( mut cog ) = cognitive . try_lock ( )
{
let candidates : Vec < CompetitionCandidate > = filtered_results
. iter ( )
. map ( | r | CompetitionCandidate {
memory_id : r . node . id . clone ( ) ,
relevance_score : r . combined_score as f64 ,
similarity_to_query : r . semantic_score . unwrap_or ( 0.0 ) as f64 ,
} )
. collect ( ) ;
if let Some ( result ) = cog . competition_mgr . run_competition ( & candidates , 0.7 ) {
// Apply suppression: losers get penalized
for suppressed_id in & result . suppressed_ids {
if let Some ( r ) = filtered_results . iter_mut ( ) . find ( | r | & r . node . id = = suppressed_id ) {
r . combined_score * = 0.85 ; // 15% suppression penalty
suppressed_count + = 1 ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
}
}
}
}
feat: Vestige v2.0.0 "Cognitive Leap" — 3D dashboard, HyDE search, WebSocket events
The biggest release in Vestige history. Complete visual and cognitive overhaul.
Dashboard:
- SvelteKit 2 + Three.js 3D neural visualization at localhost:3927/dashboard
- 7 interactive pages: Graph, Memories, Timeline, Feed, Explore, Intentions, Stats
- WebSocket event bus with 16 event types, real-time 3D animations
- Bloom post-processing, GPU instanced rendering, force-directed layout
- Dream visualization mode, FSRS retention curves, command palette (Cmd+K)
- Keyboard shortcuts, responsive mobile layout, PWA installable
- Single binary deployment via include_dir! (22MB)
Engine:
- HyDE query expansion (intent classification + 3-5 semantic variants + centroid)
- fastembed 5.11 with optional Nomic v2 MoE + Qwen3 reranker + Metal GPU
- Emotional memory module (#29)
- Criterion benchmark suite
Backend:
- Axum WebSocket at /ws with heartbeat + event broadcast
- 7 new REST endpoints for cognitive operations
- Event emission from MCP tools via shared broadcast channel
- CORS for SvelteKit dev mode
Distribution:
- GitHub issue templates (bug report, feature request)
- CHANGELOG with comprehensive v2.0 release notes
- README updated with dashboard docs, architecture diagram, comparison table
734 tests passing, zero warnings, 22MB release binary.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 03:07:25 -06:00
// ====================================================================
// STAGE 5C: Utility-based ranking (MemRL-inspired)
// Memories that proved useful in past sessions get a retrieval boost.
// utility_score = times_useful / times_retrieved (0.0 to 1.0)
// ====================================================================
for result in & mut filtered_results {
let utility = result . node . utility_score . unwrap_or ( 0.0 ) as f32 ;
if utility > 0.0 {
// Utility boost: up to +15% for memories with utility_score = 1.0
result . combined_score * = 1.0 + ( utility * 0.15 ) ;
}
}
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
// Re-sort by adjusted combined_score (descending) after all score modifications
filtered_results . sort_by ( | a , b | {
b . combined_score
. partial_cmp ( & a . combined_score )
. unwrap_or ( std ::cmp ::Ordering ::Equal )
} ) ;
// ====================================================================
// STAGE 6: Spreading activation (find associated memories)
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
// Skipped in precise mode. Deeper (5 results) in exhaustive mode.
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
// ====================================================================
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
let activation_take = match retrieval_mode {
" precise " = > 0 , // Skip entirely
" exhaustive " = > 5 , // Deeper graph traversal
_ = > 3 , // Balanced default
} ;
let associations : Vec < Value > = if activation_take > 0 {
if let Ok ( mut cog ) = cognitive . try_lock ( ) {
if let Some ( first ) = filtered_results . first ( ) {
let activated = cog . activation_network . activate ( & first . node . id , 1.0 ) ;
activated
. iter ( )
. take ( activation_take )
. map ( | a | {
serde_json ::json! ( {
" memoryId " : a . memory_id ,
" activation " : a . activation ,
" distance " : a . distance ,
} )
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
} )
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
. collect ( )
} else {
vec! [ ]
}
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
} else {
vec! [ ]
}
} else {
vec! [ ]
} ;
// ====================================================================
// Auto-strengthen on access (Testing Effect)
// ====================================================================
2026-01-26 01:31:58 -06:00
let ids : Vec < & str > = filtered_results . iter ( ) . map ( | r | r . node . id . as_str ( ) ) . collect ( ) ;
feat: Vestige v1.9.1 AUTONOMIC — self-regulating memory with graph visualization
Retention Target System: auto-GC low-retention memories during consolidation
(VESTIGE_RETENTION_TARGET env var, default 0.8). Auto-Promote: memories
accessed 3+ times in 24h get frequency-dependent potentiation. Waking SWR
Tagging: promoted memories get preferential 70/30 dream replay. Improved
Consolidation Scheduler: triggers on 6h staleness or 2h active use.
New tools: memory_health (retention dashboard with distribution buckets,
trend tracking, recommendations) and memory_graph (subgraph export with
Fruchterman-Reingold force-directed layout, up to 200 nodes).
Dream connections now persist to database via save_connection(), enabling
memory_graph traversal. Schema Migration V8 adds waking_tag, utility_score,
times_retrieved/useful columns and retention_snapshots table. 21 MCP tools.
v1.9.1 fixes: ConnectionRecord export, UTF-8 safe truncation, link_type
normalization, utility_score clamping, only-new-connections persistence,
70/30 split capacity fill, nonexistent center_id error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:02:06 -06:00
let _ = storage . strengthen_batch_on_access ( & ids ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
// Drop storage lock before acquiring cognitive for side effects
// ====================================================================
// STAGE 7: Side effects — predictive memory + reconsolidation
// ====================================================================
if let Ok ( mut cog ) = cognitive . try_lock ( ) {
// 7A. Record query for predictive memory
let _ = cog . predictive_memory . record_query ( & args . query , & [ ] ) ;
// 7B. Record each accessed memory for predictive/speculative models
for result in & filtered_results {
let _ = cog . predictive_memory . record_memory_access (
& result . node . id ,
& result . node . content . chars ( ) . take ( 100 ) . collect ::< String > ( ) ,
& result . node . tags ,
) ;
cog . speculative_retriever . record_access (
& result . node . id ,
None , // file_context
Some ( args . query . as_str ( ) ) , // query_context
None , // was_helpful (unknown yet)
) ;
// 7C. Mark labile for reconsolidation window (5 min)
let snapshot = MemorySnapshot {
content : result . node . content . clone ( ) ,
tags : result . node . tags . clone ( ) ,
retention_strength : result . node . retention_strength ,
storage_strength : result . node . storage_strength ,
retrieval_strength : result . node . retrieval_strength ,
connection_ids : vec ! [ ] ,
captured_at : Utc ::now ( ) ,
} ;
cog . reconsolidation . mark_labile ( & result . node . id , snapshot ) ;
}
}
2026-01-26 01:31:58 -06:00
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
// ====================================================================
// Format and return
// ====================================================================
feat: Vestige v1.9.1 AUTONOMIC — self-regulating memory with graph visualization
Retention Target System: auto-GC low-retention memories during consolidation
(VESTIGE_RETENTION_TARGET env var, default 0.8). Auto-Promote: memories
accessed 3+ times in 24h get frequency-dependent potentiation. Waking SWR
Tagging: promoted memories get preferential 70/30 dream replay. Improved
Consolidation Scheduler: triggers on 6h staleness or 2h active use.
New tools: memory_health (retention dashboard with distribution buckets,
trend tracking, recommendations) and memory_graph (subgraph export with
Fruchterman-Reingold force-directed layout, up to 200 nodes).
Dream connections now persist to database via save_connection(), enabling
memory_graph traversal. Schema Migration V8 adds waking_tag, utility_score,
times_retrieved/useful columns and retention_snapshots table. 21 MCP tools.
v1.9.1 fixes: ConnectionRecord export, UTF-8 safe truncation, link_type
normalization, utility_score clamping, only-new-connections persistence,
70/30 split capacity fill, nonexistent center_id error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:02:06 -06:00
let mut formatted : Vec < Value > = filtered_results
2026-01-26 01:31:58 -06:00
. iter ( )
feat: Vestige v1.2.0 — dashboard, temporal tools, maintenance tools, detail levels
Add web dashboard (axum) on port 3927 with memory browser, search, and
system stats. New MCP tools: memory_timeline, memory_changelog,
health_check, consolidate, stats, backup, export, gc. Search now supports
detail_level (brief/summary/full) to control token usage. Add backup_to()
and get_recent_state_transitions() to storage layer. Bump to v1.2.0.
2026-02-12 04:33:05 -06:00
. map ( | r | format_search_result ( r , detail_level ) )
2026-01-26 01:31:58 -06:00
. collect ( ) ;
feat: Vestige v1.9.1 AUTONOMIC — self-regulating memory with graph visualization
Retention Target System: auto-GC low-retention memories during consolidation
(VESTIGE_RETENTION_TARGET env var, default 0.8). Auto-Promote: memories
accessed 3+ times in 24h get frequency-dependent potentiation. Waking SWR
Tagging: promoted memories get preferential 70/30 dream replay. Improved
Consolidation Scheduler: triggers on 6h staleness or 2h active use.
New tools: memory_health (retention dashboard with distribution buckets,
trend tracking, recommendations) and memory_graph (subgraph export with
Fruchterman-Reingold force-directed layout, up to 200 nodes).
Dream connections now persist to database via save_connection(), enabling
memory_graph traversal. Schema Migration V8 adds waking_tag, utility_score,
times_retrieved/useful columns and retention_snapshots table. 21 MCP tools.
v1.9.1 fixes: ConnectionRecord export, UTF-8 safe truncation, link_type
normalization, utility_score clamping, only-new-connections persistence,
70/30 split capacity fill, nonexistent center_id error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:02:06 -06:00
// ====================================================================
// Token budget enforcement (v1.8.0)
// ====================================================================
let mut budget_expandable : Vec < String > = Vec ::new ( ) ;
let mut budget_tokens_used : Option < usize > = None ;
if let Some ( budget ) = args . token_budget {
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
let budget = budget . clamp ( 100 , 100000 ) as usize ;
feat: Vestige v1.9.1 AUTONOMIC — self-regulating memory with graph visualization
Retention Target System: auto-GC low-retention memories during consolidation
(VESTIGE_RETENTION_TARGET env var, default 0.8). Auto-Promote: memories
accessed 3+ times in 24h get frequency-dependent potentiation. Waking SWR
Tagging: promoted memories get preferential 70/30 dream replay. Improved
Consolidation Scheduler: triggers on 6h staleness or 2h active use.
New tools: memory_health (retention dashboard with distribution buckets,
trend tracking, recommendations) and memory_graph (subgraph export with
Fruchterman-Reingold force-directed layout, up to 200 nodes).
Dream connections now persist to database via save_connection(), enabling
memory_graph traversal. Schema Migration V8 adds waking_tag, utility_score,
times_retrieved/useful columns and retention_snapshots table. 21 MCP tools.
v1.9.1 fixes: ConnectionRecord export, UTF-8 safe truncation, link_type
normalization, utility_score clamping, only-new-connections persistence,
70/30 split capacity fill, nonexistent center_id error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:02:06 -06:00
let budget_chars = budget * 4 ;
let mut used = 0 ;
let mut budgeted = Vec ::new ( ) ;
for result in & formatted {
let size = serde_json ::to_string ( result ) . unwrap_or_default ( ) . len ( ) ;
if used + size > budget_chars {
if let Some ( id ) = result . get ( " id " ) . and_then ( | v | v . as_str ( ) ) {
budget_expandable . push ( id . to_string ( ) ) ;
}
continue ;
}
used + = size ;
budgeted . push ( result . clone ( ) ) ;
}
budget_tokens_used = Some ( used / 4 ) ;
formatted = budgeted ;
}
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
// Check learning mode via attention signal
let learning_mode = cognitive . try_lock ( ) . ok ( ) . map ( | cog | cog . attention_signal . is_learning_mode ( ) ) . unwrap_or ( false ) ;
let mut response = serde_json ::json! ( {
2026-01-26 01:31:58 -06:00
" query " : args . query ,
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
" method " : " hybrid+cognitive " ,
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
" retrievalMode " : retrieval_mode ,
feat: Vestige v1.2.0 — dashboard, temporal tools, maintenance tools, detail levels
Add web dashboard (axum) on port 3927 with memory browser, search, and
system stats. New MCP tools: memory_timeline, memory_changelog,
health_check, consolidate, stats, backup, export, gc. Search now supports
detail_level (brief/summary/full) to control token usage. Add backup_to()
and get_recent_state_transitions() to storage layer. Bump to v1.2.0.
2026-02-12 04:33:05 -06:00
" detailLevel " : detail_level ,
2026-01-26 01:31:58 -06:00
" total " : formatted . len ( ) ,
" results " : formatted ,
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
} ) ;
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
// Helpful hint when no results found
if formatted . is_empty ( ) {
response [ " hint " ] = serde_json ::json! ( " No memories found. Use smart_ingest to add memories, or try a broader query. " ) ;
}
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
// Include associations if any were found
if ! associations . is_empty ( ) {
response [ " associations " ] = serde_json ::json! ( associations ) ;
}
// Include context reinstatement if computed
if let Some ( ri ) = reinstatement_info {
response [ " contextReinstatement " ] = ri ;
}
// Include competition stats
if suppressed_count > 0 {
response [ " competitionSuppressed " ] = serde_json ::json! ( suppressed_count ) ;
}
// Include learning mode detection
if learning_mode {
response [ " learningModeDetected " ] = serde_json ::json! ( true ) ;
}
feat: Vestige v1.9.1 AUTONOMIC — self-regulating memory with graph visualization
Retention Target System: auto-GC low-retention memories during consolidation
(VESTIGE_RETENTION_TARGET env var, default 0.8). Auto-Promote: memories
accessed 3+ times in 24h get frequency-dependent potentiation. Waking SWR
Tagging: promoted memories get preferential 70/30 dream replay. Improved
Consolidation Scheduler: triggers on 6h staleness or 2h active use.
New tools: memory_health (retention dashboard with distribution buckets,
trend tracking, recommendations) and memory_graph (subgraph export with
Fruchterman-Reingold force-directed layout, up to 200 nodes).
Dream connections now persist to database via save_connection(), enabling
memory_graph traversal. Schema Migration V8 adds waking_tag, utility_score,
times_retrieved/useful columns and retention_snapshots table. 21 MCP tools.
v1.9.1 fixes: ConnectionRecord export, UTF-8 safe truncation, link_type
normalization, utility_score clamping, only-new-connections persistence,
70/30 split capacity fill, nonexistent center_id error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:02:06 -06:00
// Include token budget info (v1.8.0)
if ! budget_expandable . is_empty ( ) {
response [ " expandable " ] = serde_json ::json! ( budget_expandable ) ;
}
if let Some ( budget ) = args . token_budget {
response [ " tokenBudget " ] = serde_json ::json! ( budget ) ;
}
if let Some ( used ) = budget_tokens_used {
response [ " tokensUsed " ] = serde_json ::json! ( used ) ;
}
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
Ok ( response )
2026-01-26 01:31:58 -06:00
}
feat: Vestige v1.2.0 — dashboard, temporal tools, maintenance tools, detail levels
Add web dashboard (axum) on port 3927 with memory browser, search, and
system stats. New MCP tools: memory_timeline, memory_changelog,
health_check, consolidate, stats, backup, export, gc. Search now supports
detail_level (brief/summary/full) to control token usage. Add backup_to()
and get_recent_state_transitions() to storage layer. Bump to v1.2.0.
2026-02-12 04:33:05 -06:00
/// Format a search result based on the requested detail level.
fn format_search_result ( r : & vestige_core ::SearchResult , detail_level : & str ) -> Value {
match detail_level {
" brief " = > serde_json ::json! ( {
" id " : r . node . id ,
" nodeType " : r . node . node_type ,
" tags " : r . node . tags ,
" retentionStrength " : r . node . retention_strength ,
" combinedScore " : r . combined_score ,
} ) ,
" full " = > serde_json ::json! ( {
" id " : r . node . id ,
" content " : r . node . content ,
" combinedScore " : r . combined_score ,
" keywordScore " : r . keyword_score ,
" semanticScore " : r . semantic_score ,
" nodeType " : r . node . node_type ,
" tags " : r . node . tags ,
" retentionStrength " : r . node . retention_strength ,
" storageStrength " : r . node . storage_strength ,
" retrievalStrength " : r . node . retrieval_strength ,
" source " : r . node . source ,
" sentimentScore " : r . node . sentiment_score ,
" sentimentMagnitude " : r . node . sentiment_magnitude ,
" createdAt " : r . node . created_at . to_rfc3339 ( ) ,
" updatedAt " : r . node . updated_at . to_rfc3339 ( ) ,
" lastAccessed " : r . node . last_accessed . to_rfc3339 ( ) ,
" nextReview " : r . node . next_review . map ( | dt | dt . to_rfc3339 ( ) ) ,
" stability " : r . node . stability ,
" difficulty " : r . node . difficulty ,
" reps " : r . node . reps ,
" lapses " : r . node . lapses ,
" validFrom " : r . node . valid_from . map ( | dt | dt . to_rfc3339 ( ) ) ,
" validUntil " : r . node . valid_until . map ( | dt | dt . to_rfc3339 ( ) ) ,
" matchType " : format ! ( " {:?} " , r . match_type ) ,
} ) ,
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
// "summary" (default) — includes dates so AI never has to guess when a memory is from
feat: Vestige v1.2.0 — dashboard, temporal tools, maintenance tools, detail levels
Add web dashboard (axum) on port 3927 with memory browser, search, and
system stats. New MCP tools: memory_timeline, memory_changelog,
health_check, consolidate, stats, backup, export, gc. Search now supports
detail_level (brief/summary/full) to control token usage. Add backup_to()
and get_recent_state_transitions() to storage layer. Bump to v1.2.0.
2026-02-12 04:33:05 -06:00
_ = > serde_json ::json! ( {
" id " : r . node . id ,
" content " : r . node . content ,
" combinedScore " : r . combined_score ,
" keywordScore " : r . keyword_score ,
" semanticScore " : r . semantic_score ,
" nodeType " : r . node . node_type ,
" tags " : r . node . tags ,
" retentionStrength " : r . node . retention_strength ,
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
" createdAt " : r . node . created_at . to_rfc3339 ( ) ,
" updatedAt " : r . node . updated_at . to_rfc3339 ( ) ,
feat: Vestige v1.2.0 — dashboard, temporal tools, maintenance tools, detail levels
Add web dashboard (axum) on port 3927 with memory browser, search, and
system stats. New MCP tools: memory_timeline, memory_changelog,
health_check, consolidate, stats, backup, export, gc. Search now supports
detail_level (brief/summary/full) to control token usage. Add backup_to()
and get_recent_state_transitions() to storage layer. Bump to v1.2.0.
2026-02-12 04:33:05 -06:00
} ) ,
}
}
/// Format a KnowledgeNode based on the requested detail level.
/// Reusable across search, timeline, and other tools.
pub fn format_node ( node : & vestige_core ::KnowledgeNode , detail_level : & str ) -> Value {
match detail_level {
" brief " = > serde_json ::json! ( {
" id " : node . id ,
" nodeType " : node . node_type ,
" tags " : node . tags ,
" retentionStrength " : node . retention_strength ,
} ) ,
" full " = > serde_json ::json! ( {
" id " : node . id ,
" content " : node . content ,
" nodeType " : node . node_type ,
" tags " : node . tags ,
" retentionStrength " : node . retention_strength ,
" storageStrength " : node . storage_strength ,
" retrievalStrength " : node . retrieval_strength ,
" source " : node . source ,
" sentimentScore " : node . sentiment_score ,
" sentimentMagnitude " : node . sentiment_magnitude ,
" createdAt " : node . created_at . to_rfc3339 ( ) ,
" updatedAt " : node . updated_at . to_rfc3339 ( ) ,
" lastAccessed " : node . last_accessed . to_rfc3339 ( ) ,
" nextReview " : node . next_review . map ( | dt | dt . to_rfc3339 ( ) ) ,
" stability " : node . stability ,
" difficulty " : node . difficulty ,
" reps " : node . reps ,
" lapses " : node . lapses ,
" validFrom " : node . valid_from . map ( | dt | dt . to_rfc3339 ( ) ) ,
" validUntil " : node . valid_until . map ( | dt | dt . to_rfc3339 ( ) ) ,
} ) ,
// "summary" (default)
_ = > serde_json ::json! ( {
" id " : node . id ,
" content " : node . content ,
" nodeType " : node . node_type ,
" tags " : node . tags ,
" retentionStrength " : node . retention_strength ,
} ) ,
}
}
2026-01-26 01:31:58 -06:00
// ============================================================================
// TESTS
// ============================================================================
#[ cfg(test) ]
mod tests {
use super ::* ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
use crate ::cognitive ::CognitiveEngine ;
2026-01-26 01:31:58 -06:00
use tempfile ::TempDir ;
use vestige_core ::IngestInput ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
fn test_cognitive ( ) -> Arc < Mutex < CognitiveEngine > > {
Arc ::new ( Mutex ::new ( CognitiveEngine ::new ( ) ) )
}
2026-01-26 01:31:58 -06:00
/// Create a test storage instance with a temporary database
feat: Vestige v1.9.1 AUTONOMIC — self-regulating memory with graph visualization
Retention Target System: auto-GC low-retention memories during consolidation
(VESTIGE_RETENTION_TARGET env var, default 0.8). Auto-Promote: memories
accessed 3+ times in 24h get frequency-dependent potentiation. Waking SWR
Tagging: promoted memories get preferential 70/30 dream replay. Improved
Consolidation Scheduler: triggers on 6h staleness or 2h active use.
New tools: memory_health (retention dashboard with distribution buckets,
trend tracking, recommendations) and memory_graph (subgraph export with
Fruchterman-Reingold force-directed layout, up to 200 nodes).
Dream connections now persist to database via save_connection(), enabling
memory_graph traversal. Schema Migration V8 adds waking_tag, utility_score,
times_retrieved/useful columns and retention_snapshots table. 21 MCP tools.
v1.9.1 fixes: ConnectionRecord export, UTF-8 safe truncation, link_type
normalization, utility_score clamping, only-new-connections persistence,
70/30 split capacity fill, nonexistent center_id error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:02:06 -06:00
async fn test_storage ( ) -> ( Arc < Storage > , TempDir ) {
2026-01-26 01:31:58 -06:00
let dir = TempDir ::new ( ) . unwrap ( ) ;
let storage = Storage ::new ( Some ( dir . path ( ) . join ( " test.db " ) ) ) . unwrap ( ) ;
feat: Vestige v1.9.1 AUTONOMIC — self-regulating memory with graph visualization
Retention Target System: auto-GC low-retention memories during consolidation
(VESTIGE_RETENTION_TARGET env var, default 0.8). Auto-Promote: memories
accessed 3+ times in 24h get frequency-dependent potentiation. Waking SWR
Tagging: promoted memories get preferential 70/30 dream replay. Improved
Consolidation Scheduler: triggers on 6h staleness or 2h active use.
New tools: memory_health (retention dashboard with distribution buckets,
trend tracking, recommendations) and memory_graph (subgraph export with
Fruchterman-Reingold force-directed layout, up to 200 nodes).
Dream connections now persist to database via save_connection(), enabling
memory_graph traversal. Schema Migration V8 adds waking_tag, utility_score,
times_retrieved/useful columns and retention_snapshots table. 21 MCP tools.
v1.9.1 fixes: ConnectionRecord export, UTF-8 safe truncation, link_type
normalization, utility_score clamping, only-new-connections persistence,
70/30 split capacity fill, nonexistent center_id error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:02:06 -06:00
( Arc ::new ( storage ) , dir )
2026-01-26 01:31:58 -06:00
}
/// Helper to ingest test content
feat: Vestige v1.9.1 AUTONOMIC — self-regulating memory with graph visualization
Retention Target System: auto-GC low-retention memories during consolidation
(VESTIGE_RETENTION_TARGET env var, default 0.8). Auto-Promote: memories
accessed 3+ times in 24h get frequency-dependent potentiation. Waking SWR
Tagging: promoted memories get preferential 70/30 dream replay. Improved
Consolidation Scheduler: triggers on 6h staleness or 2h active use.
New tools: memory_health (retention dashboard with distribution buckets,
trend tracking, recommendations) and memory_graph (subgraph export with
Fruchterman-Reingold force-directed layout, up to 200 nodes).
Dream connections now persist to database via save_connection(), enabling
memory_graph traversal. Schema Migration V8 adds waking_tag, utility_score,
times_retrieved/useful columns and retention_snapshots table. 21 MCP tools.
v1.9.1 fixes: ConnectionRecord export, UTF-8 safe truncation, link_type
normalization, utility_score clamping, only-new-connections persistence,
70/30 split capacity fill, nonexistent center_id error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:02:06 -06:00
async fn ingest_test_content ( storage : & Arc < Storage > , content : & str ) -> String {
2026-01-26 01:31:58 -06:00
let input = IngestInput {
content : content . to_string ( ) ,
node_type : " fact " . to_string ( ) ,
source : None ,
sentiment_score : 0.0 ,
sentiment_magnitude : 0.0 ,
tags : vec ! [ ] ,
valid_from : None ,
valid_until : None ,
} ;
feat: Vestige v1.9.1 AUTONOMIC — self-regulating memory with graph visualization
Retention Target System: auto-GC low-retention memories during consolidation
(VESTIGE_RETENTION_TARGET env var, default 0.8). Auto-Promote: memories
accessed 3+ times in 24h get frequency-dependent potentiation. Waking SWR
Tagging: promoted memories get preferential 70/30 dream replay. Improved
Consolidation Scheduler: triggers on 6h staleness or 2h active use.
New tools: memory_health (retention dashboard with distribution buckets,
trend tracking, recommendations) and memory_graph (subgraph export with
Fruchterman-Reingold force-directed layout, up to 200 nodes).
Dream connections now persist to database via save_connection(), enabling
memory_graph traversal. Schema Migration V8 adds waking_tag, utility_score,
times_retrieved/useful columns and retention_snapshots table. 21 MCP tools.
v1.9.1 fixes: ConnectionRecord export, UTF-8 safe truncation, link_type
normalization, utility_score clamping, only-new-connections persistence,
70/30 split capacity fill, nonexistent center_id error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:02:06 -06:00
let node = storage . ingest ( input ) . unwrap ( ) ;
2026-01-26 01:31:58 -06:00
node . id
}
// ========================================================================
// QUERY VALIDATION TESTS
// ========================================================================
#[ tokio::test ]
async fn test_search_empty_query_fails ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
let args = serde_json ::json! ( { " query " : " " } ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
2026-01-26 01:31:58 -06:00
assert! ( result . is_err ( ) ) ;
assert! ( result . unwrap_err ( ) . contains ( " empty " ) ) ;
}
#[ tokio::test ]
async fn test_search_whitespace_only_query_fails ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
let args = serde_json ::json! ( { " query " : " \t \n " } ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
2026-01-26 01:31:58 -06:00
assert! ( result . is_err ( ) ) ;
assert! ( result . unwrap_err ( ) . contains ( " empty " ) ) ;
}
#[ tokio::test ]
async fn test_search_missing_arguments_fails ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , None ) . await ;
2026-01-26 01:31:58 -06:00
assert! ( result . is_err ( ) ) ;
assert! ( result . unwrap_err ( ) . contains ( " Missing arguments " ) ) ;
}
#[ tokio::test ]
async fn test_search_missing_query_field_fails ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
let args = serde_json ::json! ( { " limit " : 10 } ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
2026-01-26 01:31:58 -06:00
assert! ( result . is_err ( ) ) ;
assert! ( result . unwrap_err ( ) . contains ( " Invalid arguments " ) ) ;
}
// ========================================================================
// LIMIT CLAMPING TESTS
// ========================================================================
#[ tokio::test ]
async fn test_search_limit_clamped_to_minimum ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
ingest_test_content ( & storage , " Test content for limit clamping " ) . await ;
// Try with limit 0 - should clamp to 1
let args = serde_json ::json! ( {
" query " : " test " ,
" limit " : 0
} ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
2026-01-26 01:31:58 -06:00
assert! ( result . is_ok ( ) ) ;
}
#[ tokio::test ]
async fn test_search_limit_clamped_to_maximum ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
ingest_test_content ( & storage , " Test content for max limit " ) . await ;
// Try with limit 1000 - should clamp to 100
let args = serde_json ::json! ( {
" query " : " test " ,
" limit " : 1000
} ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
2026-01-26 01:31:58 -06:00
assert! ( result . is_ok ( ) ) ;
}
#[ tokio::test ]
async fn test_search_negative_limit_clamped ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
ingest_test_content ( & storage , " Test content for negative limit " ) . await ;
let args = serde_json ::json! ( {
" query " : " test " ,
" limit " : - 5
} ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
2026-01-26 01:31:58 -06:00
assert! ( result . is_ok ( ) ) ;
}
// ========================================================================
// MIN_RETENTION CLAMPING TESTS
// ========================================================================
#[ tokio::test ]
async fn test_search_min_retention_clamped_to_zero ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
ingest_test_content ( & storage , " Test content for retention clamping " ) . await ;
let args = serde_json ::json! ( {
" query " : " test " ,
" min_retention " : - 0.5
} ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
2026-01-26 01:31:58 -06:00
assert! ( result . is_ok ( ) ) ;
}
#[ tokio::test ]
async fn test_search_min_retention_clamped_to_one ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
ingest_test_content ( & storage , " Test content for max retention " ) . await ;
let args = serde_json ::json! ( {
" query " : " test " ,
" min_retention " : 1.5
} ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
2026-01-26 01:31:58 -06:00
// Should succeed but may return no results (retention > 1.0 clamped to 1.0)
assert! ( result . is_ok ( ) ) ;
}
// ========================================================================
// MIN_SIMILARITY CLAMPING TESTS
// ========================================================================
#[ tokio::test ]
async fn test_search_min_similarity_clamped_to_zero ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
ingest_test_content ( & storage , " Test content for similarity clamping " ) . await ;
let args = serde_json ::json! ( {
" query " : " test " ,
" min_similarity " : - 0.5
} ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
2026-01-26 01:31:58 -06:00
assert! ( result . is_ok ( ) ) ;
}
#[ tokio::test ]
async fn test_search_min_similarity_clamped_to_one ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
ingest_test_content ( & storage , " Test content for max similarity " ) . await ;
let args = serde_json ::json! ( {
" query " : " test " ,
" min_similarity " : 1.5
} ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
2026-01-26 01:31:58 -06:00
// Should succeed but may return no results
assert! ( result . is_ok ( ) ) ;
}
// ========================================================================
// SUCCESSFUL SEARCH TESTS
// ========================================================================
#[ tokio::test ]
async fn test_search_basic_query_succeeds ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
ingest_test_content ( & storage , " The Rust programming language is memory safe. " ) . await ;
let args = serde_json ::json! ( { " query " : " rust " } ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
2026-01-26 01:31:58 -06:00
assert! ( result . is_ok ( ) ) ;
let value = result . unwrap ( ) ;
assert_eq! ( value [ " query " ] , " rust " ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
assert_eq! ( value [ " method " ] , " hybrid+cognitive " ) ;
2026-01-26 01:31:58 -06:00
assert! ( value [ " total " ] . is_number ( ) ) ;
assert! ( value [ " results " ] . is_array ( ) ) ;
}
#[ tokio::test ]
async fn test_search_returns_matching_content ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
let node_id =
ingest_test_content ( & storage , " Python is a dynamic programming language. " ) . await ;
let args = serde_json ::json! ( {
" query " : " python " ,
" min_similarity " : 0.0
} ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
2026-01-26 01:31:58 -06:00
assert! ( result . is_ok ( ) ) ;
let value = result . unwrap ( ) ;
let results = value [ " results " ] . as_array ( ) . unwrap ( ) ;
assert! ( ! results . is_empty ( ) ) ;
assert_eq! ( results [ 0 ] [ " id " ] , node_id ) ;
}
#[ tokio::test ]
async fn test_search_with_limit ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
// Ingest multiple items
ingest_test_content ( & storage , " Testing content one " ) . await ;
ingest_test_content ( & storage , " Testing content two " ) . await ;
ingest_test_content ( & storage , " Testing content three " ) . await ;
let args = serde_json ::json! ( {
" query " : " testing " ,
" limit " : 2 ,
" min_similarity " : 0.0
} ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
2026-01-26 01:31:58 -06:00
assert! ( result . is_ok ( ) ) ;
let value = result . unwrap ( ) ;
let results = value [ " results " ] . as_array ( ) . unwrap ( ) ;
assert! ( results . len ( ) < = 2 ) ;
}
#[ tokio::test ]
async fn test_search_empty_database_returns_empty_array ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
// Don't ingest anything - database is empty
let args = serde_json ::json! ( { " query " : " anything " } ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
2026-01-26 01:31:58 -06:00
assert! ( result . is_ok ( ) ) ;
let value = result . unwrap ( ) ;
assert_eq! ( value [ " total " ] , 0 ) ;
assert! ( value [ " results " ] . as_array ( ) . unwrap ( ) . is_empty ( ) ) ;
}
#[ tokio::test ]
async fn test_search_result_contains_expected_fields ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
ingest_test_content ( & storage , " Testing field presence in search results. " ) . await ;
let args = serde_json ::json! ( {
" query " : " testing " ,
" min_similarity " : 0.0
} ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
2026-01-26 01:31:58 -06:00
assert! ( result . is_ok ( ) ) ;
let value = result . unwrap ( ) ;
let results = value [ " results " ] . as_array ( ) . unwrap ( ) ;
if ! results . is_empty ( ) {
let first = & results [ 0 ] ;
assert! ( first [ " id " ] . is_string ( ) ) ;
assert! ( first [ " content " ] . is_string ( ) ) ;
assert! ( first [ " combinedScore " ] . is_number ( ) ) ;
// keywordScore and semanticScore may be null if not matched
assert! ( first [ " nodeType " ] . is_string ( ) ) ;
assert! ( first [ " tags " ] . is_array ( ) ) ;
assert! ( first [ " retentionStrength " ] . is_number ( ) ) ;
}
}
// ========================================================================
// DEFAULT VALUES TESTS
// ========================================================================
#[ tokio::test ]
async fn test_search_default_limit_is_10 ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
// Ingest more than 10 items
for i in 0 .. 15 {
ingest_test_content ( & storage , & format! ( " Item number {} " , i ) ) . await ;
}
let args = serde_json ::json! ( {
" query " : " item " ,
" min_similarity " : 0.0
} ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
2026-01-26 01:31:58 -06:00
assert! ( result . is_ok ( ) ) ;
let value = result . unwrap ( ) ;
let results = value [ " results " ] . as_array ( ) . unwrap ( ) ;
assert! ( results . len ( ) < = 10 ) ;
}
// ========================================================================
// SCHEMA TESTS
// ========================================================================
#[ test ]
fn test_schema_has_required_fields ( ) {
let schema_value = schema ( ) ;
assert_eq! ( schema_value [ " type " ] , " object " ) ;
assert! ( schema_value [ " properties " ] [ " query " ] . is_object ( ) ) ;
assert! ( schema_value [ " required " ]
. as_array ( )
. unwrap ( )
. contains ( & serde_json ::json! ( " query " ) ) ) ;
}
#[ test ]
fn test_schema_has_optional_fields ( ) {
let schema_value = schema ( ) ;
assert! ( schema_value [ " properties " ] [ " limit " ] . is_object ( ) ) ;
assert! ( schema_value [ " properties " ] [ " min_retention " ] . is_object ( ) ) ;
assert! ( schema_value [ " properties " ] [ " min_similarity " ] . is_object ( ) ) ;
}
#[ test ]
fn test_schema_limit_has_bounds ( ) {
let schema_value = schema ( ) ;
let limit_schema = & schema_value [ " properties " ] [ " limit " ] ;
assert_eq! ( limit_schema [ " minimum " ] , 1 ) ;
assert_eq! ( limit_schema [ " maximum " ] , 100 ) ;
assert_eq! ( limit_schema [ " default " ] , 10 ) ;
}
#[ test ]
fn test_schema_min_retention_has_bounds ( ) {
let schema_value = schema ( ) ;
let retention_schema = & schema_value [ " properties " ] [ " min_retention " ] ;
assert_eq! ( retention_schema [ " minimum " ] , 0.0 ) ;
assert_eq! ( retention_schema [ " maximum " ] , 1.0 ) ;
assert_eq! ( retention_schema [ " default " ] , 0.0 ) ;
}
#[ test ]
fn test_schema_min_similarity_has_bounds ( ) {
let schema_value = schema ( ) ;
let similarity_schema = & schema_value [ " properties " ] [ " min_similarity " ] ;
assert_eq! ( similarity_schema [ " minimum " ] , 0.0 ) ;
assert_eq! ( similarity_schema [ " maximum " ] , 1.0 ) ;
assert_eq! ( similarity_schema [ " default " ] , 0.5 ) ;
}
feat: Vestige v1.2.0 — dashboard, temporal tools, maintenance tools, detail levels
Add web dashboard (axum) on port 3927 with memory browser, search, and
system stats. New MCP tools: memory_timeline, memory_changelog,
health_check, consolidate, stats, backup, export, gc. Search now supports
detail_level (brief/summary/full) to control token usage. Add backup_to()
and get_recent_state_transitions() to storage layer. Bump to v1.2.0.
2026-02-12 04:33:05 -06:00
// ========================================================================
// DETAIL LEVEL TESTS
// ========================================================================
#[ test ]
fn test_schema_has_detail_level ( ) {
let schema_value = schema ( ) ;
let dl = & schema_value [ " properties " ] [ " detail_level " ] ;
assert! ( dl . is_object ( ) ) ;
assert_eq! ( dl [ " default " ] , " summary " ) ;
let enum_values = dl [ " enum " ] . as_array ( ) . unwrap ( ) ;
assert! ( enum_values . contains ( & serde_json ::json! ( " brief " ) ) ) ;
assert! ( enum_values . contains ( & serde_json ::json! ( " summary " ) ) ) ;
assert! ( enum_values . contains ( & serde_json ::json! ( " full " ) ) ) ;
}
#[ tokio::test ]
async fn test_search_detail_level_brief_excludes_content ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
ingest_test_content ( & storage , " Brief mode test content for search. " ) . await ;
let args = serde_json ::json! ( {
" query " : " brief " ,
" detail_level " : " brief " ,
" min_similarity " : 0.0
} ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
feat: Vestige v1.2.0 — dashboard, temporal tools, maintenance tools, detail levels
Add web dashboard (axum) on port 3927 with memory browser, search, and
system stats. New MCP tools: memory_timeline, memory_changelog,
health_check, consolidate, stats, backup, export, gc. Search now supports
detail_level (brief/summary/full) to control token usage. Add backup_to()
and get_recent_state_transitions() to storage layer. Bump to v1.2.0.
2026-02-12 04:33:05 -06:00
assert! ( result . is_ok ( ) ) ;
let value = result . unwrap ( ) ;
assert_eq! ( value [ " detailLevel " ] , " brief " ) ;
let results = value [ " results " ] . as_array ( ) . unwrap ( ) ;
if ! results . is_empty ( ) {
let first = & results [ 0 ] ;
// Brief should NOT have content
assert! ( first . get ( " content " ) . is_none ( ) | | first [ " content " ] . is_null ( ) ) ;
// Brief should have these fields
assert! ( first [ " id " ] . is_string ( ) ) ;
assert! ( first [ " nodeType " ] . is_string ( ) ) ;
assert! ( first [ " tags " ] . is_array ( ) ) ;
assert! ( first [ " retentionStrength " ] . is_number ( ) ) ;
assert! ( first [ " combinedScore " ] . is_number ( ) ) ;
}
}
#[ tokio::test ]
async fn test_search_detail_level_full_includes_timestamps ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
ingest_test_content ( & storage , " Full mode test content for search. " ) . await ;
let args = serde_json ::json! ( {
" query " : " full " ,
" detail_level " : " full " ,
" min_similarity " : 0.0
} ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
feat: Vestige v1.2.0 — dashboard, temporal tools, maintenance tools, detail levels
Add web dashboard (axum) on port 3927 with memory browser, search, and
system stats. New MCP tools: memory_timeline, memory_changelog,
health_check, consolidate, stats, backup, export, gc. Search now supports
detail_level (brief/summary/full) to control token usage. Add backup_to()
and get_recent_state_transitions() to storage layer. Bump to v1.2.0.
2026-02-12 04:33:05 -06:00
assert! ( result . is_ok ( ) ) ;
let value = result . unwrap ( ) ;
assert_eq! ( value [ " detailLevel " ] , " full " ) ;
let results = value [ " results " ] . as_array ( ) . unwrap ( ) ;
if ! results . is_empty ( ) {
let first = & results [ 0 ] ;
// Full should have timestamps
assert! ( first [ " createdAt " ] . is_string ( ) ) ;
assert! ( first [ " updatedAt " ] . is_string ( ) ) ;
assert! ( first [ " content " ] . is_string ( ) ) ;
assert! ( first [ " storageStrength " ] . is_number ( ) ) ;
assert! ( first [ " retrievalStrength " ] . is_number ( ) ) ;
assert! ( first [ " matchType " ] . is_string ( ) ) ;
}
}
#[ tokio::test ]
async fn test_search_detail_level_default_is_summary ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
ingest_test_content ( & storage , " Default detail level test content. " ) . await ;
let args = serde_json ::json! ( {
" query " : " default " ,
" min_similarity " : 0.0
} ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
feat: Vestige v1.2.0 — dashboard, temporal tools, maintenance tools, detail levels
Add web dashboard (axum) on port 3927 with memory browser, search, and
system stats. New MCP tools: memory_timeline, memory_changelog,
health_check, consolidate, stats, backup, export, gc. Search now supports
detail_level (brief/summary/full) to control token usage. Add backup_to()
and get_recent_state_transitions() to storage layer. Bump to v1.2.0.
2026-02-12 04:33:05 -06:00
assert! ( result . is_ok ( ) ) ;
let value = result . unwrap ( ) ;
assert_eq! ( value [ " detailLevel " ] , " summary " ) ;
let results = value [ " results " ] . as_array ( ) . unwrap ( ) ;
if ! results . is_empty ( ) {
let first = & results [ 0 ] ;
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
// Summary should have content AND timestamps (v2.1: dates always visible)
feat: Vestige v1.2.0 — dashboard, temporal tools, maintenance tools, detail levels
Add web dashboard (axum) on port 3927 with memory browser, search, and
system stats. New MCP tools: memory_timeline, memory_changelog,
health_check, consolidate, stats, backup, export, gc. Search now supports
detail_level (brief/summary/full) to control token usage. Add backup_to()
and get_recent_state_transitions() to storage layer. Bump to v1.2.0.
2026-02-12 04:33:05 -06:00
assert! ( first [ " content " ] . is_string ( ) ) ;
assert! ( first [ " id " ] . is_string ( ) ) ;
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
assert! ( first [ " createdAt " ] . is_string ( ) , " summary must include createdAt " ) ;
assert! ( first [ " updatedAt " ] . is_string ( ) , " summary must include updatedAt " ) ;
feat: Vestige v1.2.0 — dashboard, temporal tools, maintenance tools, detail levels
Add web dashboard (axum) on port 3927 with memory browser, search, and
system stats. New MCP tools: memory_timeline, memory_changelog,
health_check, consolidate, stats, backup, export, gc. Search now supports
detail_level (brief/summary/full) to control token usage. Add backup_to()
and get_recent_state_transitions() to storage layer. Bump to v1.2.0.
2026-02-12 04:33:05 -06:00
}
}
#[ tokio::test ]
async fn test_search_detail_level_invalid_fails ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
let args = serde_json ::json! ( {
" query " : " test " ,
" detail_level " : " invalid_level "
} ) ;
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
feat: Vestige v1.2.0 — dashboard, temporal tools, maintenance tools, detail levels
Add web dashboard (axum) on port 3927 with memory browser, search, and
system stats. New MCP tools: memory_timeline, memory_changelog,
health_check, consolidate, stats, backup, export, gc. Search now supports
detail_level (brief/summary/full) to control token usage. Add backup_to()
and get_recent_state_transitions() to storage layer. Bump to v1.2.0.
2026-02-12 04:33:05 -06:00
assert! ( result . is_err ( ) ) ;
assert! ( result . unwrap_err ( ) . contains ( " Invalid detail_level " ) ) ;
}
feat: Vestige v1.9.1 AUTONOMIC — self-regulating memory with graph visualization
Retention Target System: auto-GC low-retention memories during consolidation
(VESTIGE_RETENTION_TARGET env var, default 0.8). Auto-Promote: memories
accessed 3+ times in 24h get frequency-dependent potentiation. Waking SWR
Tagging: promoted memories get preferential 70/30 dream replay. Improved
Consolidation Scheduler: triggers on 6h staleness or 2h active use.
New tools: memory_health (retention dashboard with distribution buckets,
trend tracking, recommendations) and memory_graph (subgraph export with
Fruchterman-Reingold force-directed layout, up to 200 nodes).
Dream connections now persist to database via save_connection(), enabling
memory_graph traversal. Schema Migration V8 adds waking_tag, utility_score,
times_retrieved/useful columns and retention_snapshots table. 21 MCP tools.
v1.9.1 fixes: ConnectionRecord export, UTF-8 safe truncation, link_type
normalization, utility_score clamping, only-new-connections persistence,
70/30 split capacity fill, nonexistent center_id error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:02:06 -06:00
// ========================================================================
// TOKEN BUDGET TESTS (v1.8.0)
// ========================================================================
#[ tokio::test ]
async fn test_token_budget_limits_results ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
for i in 0 .. 10 {
ingest_test_content (
& storage ,
& format! ( " Budget test content number {} with some extra text to increase size. " , i ) ,
)
. await ;
}
// Small budget should reduce results
let args = serde_json ::json! ( {
" query " : " budget test " ,
" token_budget " : 200 ,
" min_similarity " : 0.0
} ) ;
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
assert! ( result . is_ok ( ) ) ;
let value = result . unwrap ( ) ;
assert! ( value [ " tokenBudget " ] . as_i64 ( ) . unwrap ( ) = = 200 ) ;
assert! ( value [ " tokensUsed " ] . is_number ( ) ) ;
}
#[ tokio::test ]
async fn test_token_budget_expandable ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
for i in 0 .. 15 {
ingest_test_content (
& storage ,
& format! (
" Expandable budget test number {} with quite a bit of content to ensure we exceed the token budget allocation threshold. " ,
i
) ,
)
. await ;
}
let args = serde_json ::json! ( {
" query " : " expandable budget test " ,
" token_budget " : 150 ,
" min_similarity " : 0.0
} ) ;
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
assert! ( result . is_ok ( ) ) ;
let value = result . unwrap ( ) ;
// expandable field should exist if results were dropped
if let Some ( expandable ) = value . get ( " expandable " ) {
assert! ( expandable . is_array ( ) ) ;
}
}
#[ tokio::test ]
async fn test_no_budget_unchanged ( ) {
let ( storage , _dir ) = test_storage ( ) . await ;
ingest_test_content ( & storage , " No budget test content. " ) . await ;
let args = serde_json ::json! ( {
" query " : " no budget " ,
" min_similarity " : 0.0
} ) ;
let result = execute ( & storage , & test_cognitive ( ) , Some ( args ) ) . await ;
assert! ( result . is_ok ( ) ) ;
let value = result . unwrap ( ) ;
// No budget fields should be present
assert! ( value . get ( " tokenBudget " ) . is_none ( ) ) ;
assert! ( value . get ( " tokensUsed " ) . is_none ( ) ) ;
assert! ( value . get ( " expandable " ) . is_none ( ) ) ;
}
#[ test ]
fn test_schema_has_token_budget ( ) {
let schema_value = schema ( ) ;
let tb = & schema_value [ " properties " ] [ " token_budget " ] ;
assert! ( tb . is_object ( ) ) ;
assert_eq! ( tb [ " minimum " ] , 100 ) ;
feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
Synthesis), spreading activation expansion, temporal supersession, trust-weighted
contradiction analysis, relation assessment, dream insight integration, and
algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines
Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema
Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)
Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:01 -05:00
assert_eq! ( tb [ " maximum " ] , 100000 ) ;
feat: Vestige v1.9.1 AUTONOMIC — self-regulating memory with graph visualization
Retention Target System: auto-GC low-retention memories during consolidation
(VESTIGE_RETENTION_TARGET env var, default 0.8). Auto-Promote: memories
accessed 3+ times in 24h get frequency-dependent potentiation. Waking SWR
Tagging: promoted memories get preferential 70/30 dream replay. Improved
Consolidation Scheduler: triggers on 6h staleness or 2h active use.
New tools: memory_health (retention dashboard with distribution buckets,
trend tracking, recommendations) and memory_graph (subgraph export with
Fruchterman-Reingold force-directed layout, up to 200 nodes).
Dream connections now persist to database via save_connection(), enabling
memory_graph traversal. Schema Migration V8 adds waking_tag, utility_score,
times_retrieved/useful columns and retention_snapshots table. 21 MCP tools.
v1.9.1 fixes: ConnectionRecord export, UTF-8 safe truncation, link_type
normalization, utility_score clamping, only-new-connections persistence,
70/30 split capacity fill, nonexistent center_id error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:02:06 -06:00
}
2026-01-26 01:31:58 -06:00
}