Skip to main content

reinsert

Function reinsert 

Source
pub fn reinsert(
    db: &Database,
    collection: &str,
    fact: &RawFact,
    vector: &[f32],
) -> Result<Reinsertion, MemoryError>
Expand description

Put fact back into collection under its ORIGINAL id, with vector as the caller decided it.

vector is the target embedder’s output under reembed, or fact.source_vector under reuse. This function does not choose between them and must not: passing the source vector is legitimate exactly when the source records the target model at the target width, and the only thing that establishes it is resolve — one place, tested as one rule. Writing back a source vector on any other footing produces a store whose vectors and whose recorded model disagree, which recall answers from without ever failing.

§Errors

Returns crate::MemoryError if the collection is absent, if the stored payload is not readable, or if the write fails.