Where memories live: a TypeDB connection, a database, and the hooks.
store = Reminisce.Store.new(TypeDB, "memory", policy: MyApp.MemoryPolicy)Options:
:policy— aReminisce.Policymodule, run after the built-in secret guard before every write. DefaultReminisce.Policy.Allow.:analyser— aReminisce.Analysermodule. DefaultReminisce.Analyser.Default(English and Russian).:aspects— the aspects a memory may carry: a non-empty list of atoms, each a lower-case name (a letter, then letters, digits or_). Default[:episodic, :semantic, :procedural, :autobiographical, :prospective]. Anything else raisesArgumentError.:review_aspects— aspects that requirereviewed_byon write. Default[].:page_size— how many memories each fetch reads as recall,as_ofandconsolidatewalk every memory of an owner (in one read transaction). 1 to 2,000; default 2,000. It bounds how many whole memories are held at once, not what is seen. What else is held grows with the owner: every walk first reads the owner's keys; recall keeps a key and its matching terms for each memory that matches the query;consolidatekeeps a key and a number per memory;as_ofreturns every memory it finds.:decay—[tau_days: %{aspect => days}, default_tau_days: n, floor: f, inactive_below: f, exempt_aspects: [aspect]]forReminisce.consolidate/3; seeReminisce.Decay.:exempt_aspectsmust be aspects the store knows.:clock— a zero-arity function returning the currentDateTime. DefaultDateTime.utc_now/0. Tests fix it.:withdraw_batch— memories redacted per transaction byReminisce.withdraw/4. Default 500.:withdraw_keep— attribute types, by label, that a withdrawal leaves on a memory besides the library's bookkeeping: identifiers the host's schema givesmemory, such as a tenant id, never words. Default[]: a withdrawal deletes every attribute the host defined onmemory. An attribute the host made required (@card(1..)) must be named here, or no withdrawal of a memory that has it can complete: deleting it fails the batch's commit, andwithdraw/4answers{:error, {:withdrawal_incomplete, _}}with the words still there.content,facet,cue,valence,arousal,felt_by,unslowed_salience,strand_kindandstrand_namecannot be named.:intentions—[due_bases: [basis]]: the bases an intention may be due with (docs/spec.md §A.2). Default[due_bases: [:told, :inferred, :generated]]: an intention written from data,:observed, is found by its words and never pushed indueuntil the host lists that basis.:affect— how affects (docs/spec.md Appendix B) weigh, fade and are kept,[recall_weight:, decay_slowing:, appraise_subjects:, observed_cap:, subject_retention_days:]::recall_weight— 0 to 500, default 250: an affect at full weight multiplies a score by(1000 + w) / 1000at most;:decay_slowing— 0 to 1, default 1: an owner's own unscoped affect at full weight lengthens its memory's time constant by that much;:appraise_subjects— defaultfalse: a:generatedaffect held by a subject, a model's reading of a person, is refused unless it istrue, andtrueneeds a:subject_retention_days;:observed_cap— 0 to 1,000, default 250: the most an affect that rests on outside text (an:observedobject or ground, or sources) weighs;:subject_retention_days— a positive integer, ornil(the default) to keep affects about a person until they are withdrawn:Reminisce.consolidate/3erases those recorded more days than that before its interval end.
Anything else raises
ArgumentError.:affectiveis the library's own aspect, for affects, and cannot be one of:aspects.:persona— how the persona DNA (docs/spec.md Appendix C) weighs and is bounded,[recall_weight:, max_changed:, drift_alert:, drift_min:]::recall_weight— 0 to 250, default 100: a memory a strand of the current version rests on, scored by a term of the query, has its score multiplied by(1000 + w) / 1000;:max_changed— 1 to 16, default 2: how many strands one proposal may add, change or drop;:drift_alert— 0 to 1,000, default 300: the share of departing readings, in thousandths, at whichReminisce.persona_drift/3names a strand inalerts;:drift_min— a positive integer, default 5: how many readings the latest window needs before it can alert.
Anything else raises
ArgumentError.:personais the library's own aspect, for the DNA's strands, and cannot be one of:aspects.
Summary
Types
@type t() :: %Reminisce.Store{ affect: keyword(), analyser: module(), aspects: [atom()], clock: (-> DateTime.t()) | nil, conn: GenServer.server(), database: String.t(), decay: keyword(), intentions: [{:due_bases, [atom()]}], page_size: pos_integer(), persona: keyword(), policy: module(), review_aspects: [atom()], withdraw_batch: pos_integer(), withdraw_keep: [String.t()] }
Functions
@spec new(GenServer.server(), String.t(), keyword()) :: t()
Builds a store over a running TypeDB connection.