From f9d189edaa70200b51a09f476ff8cf3719b8a334 Mon Sep 17 00:00:00 2001 From: anaslimem Date: Tue, 21 Apr 2026 07:53:47 +0100 Subject: [PATCH] Update the core of cortexaDB --- crates/cortexadb-core/src/core/command.rs | 3 +-- crates/cortexadb-core/src/core/memory_entry.rs | 7 ------- crates/cortexadb-core/src/core/state_machine.rs | 2 +- crates/cortexadb-core/src/engine.rs | 2 +- crates/cortexadb-core/src/lib.rs | 4 +++- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/crates/cortexadb-core/src/core/command.rs b/crates/cortexadb-core/src/core/command.rs index 1ebeaff..8d0d350 100644 --- a/crates/cortexadb-core/src/core/command.rs +++ b/crates/cortexadb-core/src/core/command.rs @@ -1,7 +1,6 @@ use serde::{Deserialize, Serialize}; -use super::memory_entry::MemoryEntry; -use crate::core::memory_entry::MemoryId; +use crate::core::memory_entry::{MemoryEntry, MemoryId}; /// State-mutating commands for the state machine #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/crates/cortexadb-core/src/core/memory_entry.rs b/crates/cortexadb-core/src/core/memory_entry.rs index 0903cc9..46c5654 100644 --- a/crates/cortexadb-core/src/core/memory_entry.rs +++ b/crates/cortexadb-core/src/core/memory_entry.rs @@ -65,11 +65,4 @@ mod tests { assert_eq!(entry.importance, 0.8); assert_eq!(entry.embedding, Some(vec![0.1, 0.2, 0.3])); } - - #[test] - fn test_memory_id_ordering() { - let id1 = MemoryId(1); - let id2 = MemoryId(2); - assert!(id1 < id2); - } } diff --git a/crates/cortexadb-core/src/core/state_machine.rs b/crates/cortexadb-core/src/core/state_machine.rs index eb67282..20f4a14 100644 --- a/crates/cortexadb-core/src/core/state_machine.rs +++ b/crates/cortexadb-core/src/core/state_machine.rs @@ -3,7 +3,7 @@ use std::collections::{BTreeMap, HashMap}; use serde::{Deserialize, Serialize}; use thiserror::Error; -use super::{ +use crate::core::{ command::Command, memory_entry::{MemoryEntry, MemoryId}, }; diff --git a/crates/cortexadb-core/src/engine.rs b/crates/cortexadb-core/src/engine.rs index f5a613d..0b043af 100644 --- a/crates/cortexadb-core/src/engine.rs +++ b/crates/cortexadb-core/src/engine.rs @@ -439,7 +439,7 @@ impl Engine { &self.state_machine } - /// Get mutable reference to the state machine + /// Get mutable reference to the state machine pub(crate) fn get_state_machine_mut(&mut self) -> &mut StateMachine { &mut self.state_machine } diff --git a/crates/cortexadb-core/src/lib.rs b/crates/cortexadb-core/src/lib.rs index e568c0f..27d9e02 100644 --- a/crates/cortexadb-core/src/lib.rs +++ b/crates/cortexadb-core/src/lib.rs @@ -9,5 +9,7 @@ pub mod store; // Re-export the primary facade types for convenience. pub use chunker::{chunk, ChunkMetadata, ChunkResult, ChunkingStrategy}; -pub use facade::{BatchRecord, CortexaDB, CortexaDBBuilder, CortexaDBConfig, CortexaDBError, Hit, Memory, Stats}; +pub use facade::{ + BatchRecord, CortexaDB, CortexaDBBuilder, CortexaDBConfig, CortexaDBError, Hit, Memory, Stats, +}; pub use index::{HnswBackend, HnswConfig, HnswError, IndexMode, MetricKind};