Skip to main content

Module remember

Module remember 

Source
Expand description

remember — write a Note the graph can later recall.

Unlike the code-graph remember this module superseded, deleted in 0.7 with the rest of that module, an about key here is not required to already exist: a fact may name its subject before anything has described that subject. A missing key is stubbed as a provisional entity (memory_schema::PROVISIONAL_LABEL, memory_schema::PROVISIONAL_PROP) rather than refusing the whole call — the store learns the shape of what it does not yet know. facts[] endpoints get the identical stub, not a bare insert_edge_upsert auto-create: an unnamed, unmarked node from a typo’d object would be unfindable by the same provisional query that surfaces every other guess this module makes (fix round 1, 0.7).

Everything one call writes — the entities the caller recognised, the note, the ABOUT edges linking the note to about, and the facts among those entities — goes through one GraphDb::batch commit, in that order: an about key or a fact endpoint that is also named in entities (or, for a fact endpoint, also in about) is created as the real entity the caller described, not a provisional stub, because the entity ops are queued (and their keys become visible to the batch’s own validation) before the about keys and the facts’ own endpoints are resolved.

Structs§

EntityIn
One entity the caller recognised in the text.
FactIn
One relationship the caller recognised, between keys named in entities or about.
RememberInput
What to remember.
RememberReport
Everything one remember call writes.
UpsertOutcome
What one upsert_entity call did.

Constants§

DEFAULT_NOTE_KIND
The kind a note gets when the caller names none.
NOTE_KINDS
The kind values a Note may carry.

Functions§

dedup_keep_order
Drop repeats from keys, keeping the first of each and the order — the order remember reports provisional keys in.
describe_entity
Create-or-update one entity, clearing any provisional mark.
describe_entity_with_aliases
describe_entity, with aliases the caller knows the entity by.
remember
Write input as a Note, describing whatever it names along the way.
unix_now_secs
Unix seconds now — the ts a note gets when the caller names none. 0 on a clock set before 1970 rather than a panic.
upsert_entity
Create or update one entity by key, with the policy every surface shares.