Skip to main content

set_embedding

Function set_embedding 

Source
pub fn set_embedding(
    conn: &Connection,
    id: &str,
    embedding: &[f32],
) -> Result<()>
Expand description

Store an embedding vector for a memory.

v0.6.3.1 P2 — writes are now headed with the magic byte (encode_embedding_blob) and the namespace’s first established dim is enforced. A dim mismatch returns a typed EmbeddingDimMismatch surfaced as a 409 by the handler layer. The same call also persists embedding_dim so future stats / doctor passes don’t re-derive from BLOB length.

§Errors

Returns EmbeddingDimMismatch (boxed via anyhow) when the embedding’s dimensionality differs from what the namespace established, or the underlying SQLite error on failure.