oxios_kernel/memory/
mod.rs1use async_trait::async_trait;
14use oxios_memory::memory::storage::{MemoryGit, MemoryStorage};
15use serde_json::Value;
16
17#[async_trait]
18impl MemoryStorage for crate::state_store::StateStore {
19 async fn save_json_value(&self, c: &str, k: &str, v: &Value) -> anyhow::Result<()> {
20 self.save_json(c, k, v).await
21 }
22 async fn load_json_value(&self, c: &str, k: &str) -> anyhow::Result<Option<Value>> {
23 self.load_json::<Value>(c, k).await
24 }
25 async fn list_category(&self, category: &str) -> anyhow::Result<Vec<String>> {
26 crate::state_store::StateStore::list_category(self, category).await
27 }
28 async fn delete_file(&self, category: &str, key: &str) -> anyhow::Result<bool> {
29 crate::state_store::StateStore::delete_file(self, category, key).await
30 }
31}
32
33#[async_trait]
36impl MemoryGit for crate::git_layer::GitLayer {
37 async fn commit_file(&self, path: &str, message: &str) -> anyhow::Result<()> {
38 crate::git_layer::GitLayer::commit_file(self, path, message)?;
39 Ok(())
40 }
41 fn is_enabled(&self) -> bool {
42 crate::git_layer::GitLayer::is_enabled(self)
43 }
44}
45
46impl From<&crate::config::ConsolidationConfig> for oxios_memory::memory::dream::DreamConfig {
49 fn from(c: &crate::config::ConsolidationConfig) -> Self {
50 Self {
51 dream_enabled: c.dream_enabled,
52 dream_interval_hours: c.dream_interval_hours,
53 dream_min_sessions: c.dream_min_sessions,
54 hot_max_entries: c.hot_max_entries,
55 warm_max_entries: c.warm_max_entries,
56 cold_max_entries: c.cold_max_entries,
57 hot_token_budget: c.hot_token_budget,
58 decay_threshold: c.decay_threshold,
59 retention_days: c.retention_days,
60 decay_multiplier: c.decay_multiplier,
61 auto_protection: c.auto_protection,
62 protection_low_access: c.protection_low_access,
63 protection_medium_access: c.protection_medium_access,
64 protection_high_access: c.protection_high_access,
65 protection_medium_sessions: c.protection_medium_sessions,
66 protection_high_sessions: c.protection_high_sessions,
67 protection_demotion_enabled: c.protection_demotion_enabled,
68 protection_demotion_stale_days: c.protection_demotion_stale_days,
69 auto_classification: c.auto_classification,
70 type_promotion_repetitions: c.type_promotion_repetitions,
71 compaction_line_threshold: c.compaction_line_threshold,
72 proactive_recall_limit: c.proactive_recall_limit,
73 proactive_recall_threshold: c.proactive_recall_threshold,
74 pagerank_enabled: true,
75 pagerank_damping: 0.85,
76 pagerank_iterations: 30,
77 pagerank_boost_factor: 0.3,
78 }
79 }
80}
81
82pub use oxios_memory::memory::manager::MemoryManager;
89pub use oxios_memory::memory::types::{
90 content_hash, MemoryEntry, MemoryTier, MemoryType, ProtectionLevel, TextVector,
91};
92
93pub use oxios_memory::memory::dream::{DreamCheckpoint, DreamConfig, DreamProcess, DreamReport};
95pub use oxios_memory::memory::proactive::{ProactiveRecall, RecallTiming};
96
97pub use oxios_memory::memory::embedding_viz::{
99 compute_pca_2d, compute_top_neighbors, MemoryMapEntry, MemoryNeighbor,
100};
101pub use oxios_memory::memory::hnsw::HnswIndex;
102pub use oxios_memory::memory::hnsw_memory_index::{HnswMemoryIndex, SemanticHit};
103
104pub mod markdown_bridge;
111
112pub mod auto_memory_bridge {
115 pub use oxios_memory::memory::auto_bridge::*;
116}