pub struct EmbedRecord {
pub memory_id: MemoryId,
pub backend_id: String,
pub dim: u32,
pub vector: Vec<f32>,
pub computed_at: DateTime<Utc>,
}Expand description
One persistable embedding row produced by an embedder backend.
This is the canonical struct shape: cortex-retrieval::embedding
re-exports it so a single name is reachable from both the storage and
retrieval sides of the foundation.
Fields§
§memory_id: MemoryIdMemory the vector was computed for.
backend_id: StringBackend that produced the vector (matches Embedder::backend_id).
dim: u32Vector dimensionality. Always equals vector.len(); carried
explicitly so the durable row can fail closed on a corrupt blob
without trusting the implicit length.
vector: Vec<f32>The embedding vector. Length MUST equal dim.
computed_at: DateTime<Utc>Wall-clock time the embedding was computed.
Implementations§
Source§impl EmbedRecord
impl EmbedRecord
Sourcepub fn new(
memory_id: MemoryId,
backend_id: impl Into<String>,
vector: Vec<f32>,
computed_at: DateTime<Utc>,
) -> Result<EmbedRecord, StoreError>
pub fn new( memory_id: MemoryId, backend_id: impl Into<String>, vector: Vec<f32>, computed_at: DateTime<Utc>, ) -> Result<EmbedRecord, StoreError>
Construct a record after verifying that vector.len() fits in u32.
The dim field is derived from vector.len() so every constructed
record satisfies dim as usize == vector.len() by construction.
Trait Implementations§
Source§impl Clone for EmbedRecord
impl Clone for EmbedRecord
Source§fn clone(&self) -> EmbedRecord
fn clone(&self) -> EmbedRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EmbedRecord
impl Debug for EmbedRecord
Source§impl PartialEq for EmbedRecord
impl PartialEq for EmbedRecord
Source§fn eq(&self, other: &EmbedRecord) -> bool
fn eq(&self, other: &EmbedRecord) -> bool
self and other values to be equal, and is used by ==.