use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StoredEntry {
pub id: String,
pub text: String,
pub elid: Option<String>,
pub simhash_hex: Option<String>,
pub text_simhash: u64,
pub bands: Vec<String>,
pub metadata: serde_json::Value,
}
#[derive(Debug, Clone)]
pub struct MemoryResult {
pub id: String,
pub text: String,
pub score: f64,
pub metadata: serde_json::Value,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MemoryEntry {
pub id: String,
pub text: String,
pub metadata: serde_json::Value,
}
impl MemoryEntry {
#[must_use]
pub fn new(text: impl Into<String>) -> Self {
Self {
id: String::new(),
text: text.into(),
metadata: serde_json::Value::Null,
}
}
#[must_use]
pub fn with_id(mut self, id: impl Into<String>) -> Self {
self.id = id.into();
self
}
#[must_use]
pub fn with_metadata(mut self, metadata: serde_json::Value) -> Self {
self.metadata = metadata;
self
}
}