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§
- Entity
In - One entity the caller recognised in the text.
- FactIn
- One relationship the caller recognised, between keys named in
entitiesorabout. - Remember
Input - What to remember.
- Remember
Report - Everything one
remembercall writes. - Upsert
Outcome - What one
upsert_entitycall did.
Constants§
- DEFAULT_
NOTE_ KIND - The
kinda note gets when the caller names none. - NOTE_
KINDS - The
kindvalues aNotemay carry.
Functions§
- dedup_
keep_ order - Drop repeats from
keys, keeping the first of each and the order — the orderrememberreportsprovisionalkeys 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
inputas aNote, describing whatever it names along the way. - unix_
now_ secs - Unix seconds now — the
tsa note gets when the caller names none.0on a clock set before 1970 rather than a panic. - upsert_
entity - Create or update one entity by key, with the policy every surface shares.