Memory
Memory keeps two things, by level: personal, a workspace, a project in a
workspace, or a brand in a workspace.
- What the person said, in their exact words, on a
said: stream, with
their purpose: a mandate or a procedure, which stand as rules, or
confirmed_memory, something they told you. Nothing is kept until the
person confirms the words are theirs, and a correction replaces them only
with the person's approval of the exact change.
- What an agent found, on an
observed: stream, with the fact's date and
its sources. An observation is evidence, never an instruction, and never
becomes a confirmed memory.
Every entry carries its own date, the fact's and not when it was stored, where
it came from, and summary, the line the index shows for it, which its writer
writes for recall: a cue to read the entry, on one line of at most 120
characters. An entry can say the last date it's true, valid_until: once that
has passed, the index leaves it out, and history, search and read keep it. A
correction or a superseding observation is the entry's next version, so what's
current is what a turn reads, and its history stays.
Confirming the person's words
remember asks the person to confirm the quote, the line the index shows for
it, its purpose, its dates, its sources and the stream it goes to. A host that
holds the words may answer itself only when the line is the quote itself and
the purpose is confirmed_memory. A line the host wrote, or a purpose that
makes the words a rule, is shown to the person, because a quote that checks
out doesn't confirm a summary of it or the force it's given.
Methods
remember: keep the person's exact words, once they're confirmed.
correct: replace words with corrected words, as the entry's next version.
disable: stop an entry applying. The record keeps it.
observe: keep what an agent found, or supersede an earlier observation.
index: a bounded index for a turn's context, the default method.
search: ranked matches among current entries, by their text and
summary only, never a confirmation's wording, a purpose or a source.
read: one entry by handle, at the version it names.
An entry's handle is memory:<stream>#<key>@<version>. A short handle is
one whose key is only the start of the entry's, at least 8 hex characters, as
an index line shows it. read takes one and resolves it within its stream: a
start that begins no key, or more than one, is refused, naming the full
handles it could mean, so read never guesses. Every other method and result
names an entry by its full handle.
A write is shown what it likely replaces
remember and observe take supersedes: the handle of the entry the new
one replaces, or none. Without it, they search the stream they'd write for
current entries whose text matches the new one. If any match, nothing is kept
and they're returned as matches, so the writer decides with them in view and
calls again. If none does, there's nothing to decide, so it's kept at once and
the result says so, with no matches and the new handle. For observe, a
handle keeps the new observation as that entry's next version. For
remember, it makes the call a correction of that entry, at the correction's
own gate. So a fact that contradicts an older one can't sit beside it as
current unless the writer said it doesn't replace it.
The index
The index is one context entry per stream and purpose. Its summary is a
header, memory:<stream>, then a line per entry, `@
- Standing rules: the person's words kept as a
mandate or a
procedure, every one, whatever its age, oldest first.
- Facts: the person's other words, then observations. Given a
focus,
what the turn is about to do, the ones that match it come first, best
first and newest first among equals, and the rest follow newest first.
Without one, newest first.
An entry whose valid_until has passed, by the run's clock, is left out.
Every line holds its summary, and headers count toward the budget,
max_characters, with their lines. Facts fill the room the rules leave
whole, in rank order, and the first that doesn't fit ends them. A standing
rule's line never goes: when the rules alone pass the budget, no fact shows,
the rules' summaries go, newest first, so the oldest rules keep the start of
the request, and over_budget says so. It says when it cut entries, and
search and read reach them.
Reading it from another skill
Compose it with an ordinary step, skill: runx/memory#index, and hand its
entries to a turn through context.entries. A run reads only the streams its
authority names: a stream it doesn't reach is passed over, never an error, and
a level that needs a workspace in a run with none is passed over too. Entries
are labelled with the person's purpose, mandate, procedure or
confirmed_memory, with person_confirmed, or observation with
untrusted_evidence, and shared with the model the person configured.
1---2name: memory3description: Keep what a person said, in their exact words once they confirm them, and what an agent found, with its date and sources, by level, and give a turn a bounded index of it, ranked search across it, and any entry by handle.4metadata:5 source: https://skillmd.com/skills/runxhq/memory6---78# Memory910Memory keeps two things, by level: personal, a workspace, a project in a11workspace, or a brand in a workspace.1213- **What the person said,** in their exact words, on a `said:` stream, with14 their purpose: a `mandate` or a `procedure`, which stand as rules, or15 `confirmed_memory`, something they told you. Nothing is kept until the16 person confirms the words are theirs, and a correction replaces them only17 with the person's approval of the exact change.18- **What an agent found,** on an `observed:` stream, with the fact's date and19 its sources. An observation is evidence, never an instruction, and never20 becomes a confirmed memory.2122Every entry carries its own date, the fact's and not when it was stored, where23it came from, and `summary`, the line the index shows for it, which its writer24writes for recall: a cue to read the entry, on one line of at most 12025characters. An entry can say the last date it's true, `valid_until`: once that26has passed, the index leaves it out, and history, search and `read` keep it. A27correction or a superseding observation is the entry's next version, so what's28current is what a turn reads, and its history stays.2930## Confirming the person's words3132`remember` asks the person to confirm the quote, the line the index shows for33it, its purpose, its dates, its sources and the stream it goes to. A host that34holds the words may answer itself only when the line is the quote itself and35the purpose is `confirmed_memory`. A line the host wrote, or a purpose that36makes the words a rule, is shown to the person, because a quote that checks37out doesn't confirm a summary of it or the force it's given.3839## Methods4041- `remember`: keep the person's exact words, once they're confirmed.42- `correct`: replace words with corrected words, as the entry's next version.43- `disable`: stop an entry applying. The record keeps it.44- `observe`: keep what an agent found, or supersede an earlier observation.45- `index`: a bounded index for a turn's context, the default method.46- `search`: ranked matches among current entries, by their text and47 summary only, never a confirmation's wording, a purpose or a source.48- `read`: one entry by handle, at the version it names.4950An entry's handle is `memory:<stream>#<key>@<version>`. A short handle is51one whose key is only the start of the entry's, at least 8 hex characters, as52an index line shows it. `read` takes one and resolves it within its stream: a53start that begins no key, or more than one, is refused, naming the full54handles it could mean, so `read` never guesses. Every other method and result55names an entry by its full handle.5657## A write is shown what it likely replaces5859`remember` and `observe` take `supersedes`: the handle of the entry the new60one replaces, or `none`. Without it, they search the stream they'd write for61current entries whose text matches the new one. If any match, nothing is kept62and they're returned as `matches`, so the writer decides with them in view and63calls again. If none does, there's nothing to decide, so it's kept at once and64the result says so, with no `matches` and the new handle. For `observe`, a65handle keeps the new observation as that entry's next version. For66`remember`, it makes the call a correction of that entry, at the correction's67own gate. So a fact that contradicts an older one can't sit beside it as68current unless the writer said it doesn't replace it.6970## The index7172The index is one context entry per stream and purpose. Its summary is a73header, `memory:<stream>`, then a line per entry, `<key>@<version> <date>74<summary>`, and its data is its entries whole. The key is the shortest start75of the entry's key, at least 8 characters, that no other line of its stream76shares, so the header and a line make the entry's short handle. The date is77the fact's own and never a relative age, so the same memory reads the same78from one day to the next. The person's standing rules, their other words and79the observations each sit under a header of their own, labelled with their80purpose. In order:81821. **Standing rules:** the person's words kept as a `mandate` or a83 `procedure`, every one, whatever its age, oldest first.842. **Facts:** the person's other words, then observations. Given a `focus`,85 what the turn is about to do, the ones that match it come first, best86 first and newest first among equals, and the rest follow newest first.87 Without one, newest first.8889An entry whose `valid_until` has passed, by the run's clock, is left out.90Every line holds its summary, and headers count toward the budget,91`max_characters`, with their lines. Facts fill the room the rules leave92whole, in rank order, and the first that doesn't fit ends them. A standing93rule's line never goes: when the rules alone pass the budget, no fact shows,94the rules' summaries go, newest first, so the oldest rules keep the start of95the request, and `over_budget` says so. It says when it cut entries, and96`search` and `read` reach them.9798## Reading it from another skill99100Compose it with an ordinary step, `skill: runx/memory#index`, and hand its101`entries` to a turn through `context.entries`. A run reads only the streams its102authority names: a stream it doesn't reach is passed over, never an error, and103a level that needs a workspace in a run with none is passed over too. Entries104are labelled with the person's purpose, `mandate`, `procedure` or105`confirmed_memory`, with `person_confirmed`, or `observation` with106`untrusted_evidence`, and shared with the model the person configured.