Skip to main content

remember

Function remember 

Source
pub fn remember<F: Fs>(
    w: &mut GraphDb<F>,
    input: &RememberInput<'_>,
) -> Result<String>
Expand description

Write input as a Note, returning its key.

Validated before anything is written: text must be [MIN_TEXT_CHARS]..=[MAX_TEXT_CHARS] characters after trimming, kind must be one of NOTE_KINDS, and every about key must already exist — GraphError::KeyNotFound names the first missing one, sorted, so a caller with several bad keys is told about the same one twice rather than a different one each retry.

The key is "note:" followed by 16 hex characters of a stable 64-bit hash of ts and text (see [note_key] for why it is not blake3), so remembering the same text at the same ts again returns the same key without writing a second node — the caller’s insertion order into about does not affect the key, but does affect which edges backfill first, which the engine already makes deterministic.

Also ensures full-text search is enabled on Note.text, and that the about_<label> rule for every label named among about already exists (see the module docs), so a store whose very first write is a remember call — never having gone through structure::ensure_rules_and_fulltext — can still be recalled from and still derives its ABOUT edges.