Constructor
Unique identifier for this nugget. Used as the filename (
<name>.nugget.json) and as the nugget name embedded in every graph note.Dimensionality of the FHRR vectors. Higher values increase storage capacity and recall accuracy at the cost of memory. Must be the same value when reloading a saved nugget.
Number of memory banks. Facts are distributed across banks in round-robin order. More banks improve retrieval robustness when the fact set is large.
Number of independent ensemble copies. Each ensemble uses a separate random key matrix. Increasing this value improves recall at the cost of memory.
When
true, the nugget writes to disk after every mutating operation (remember, forget, clear, and note mutations). Set to false when batching many writes.Directory where
<name>.nugget.json is stored. The note graph is always written to <saveDir>/graph/graph.json.Maximum number of facts to retain. When the limit is reached, the oldest facts are evicted in FIFO order and their corresponding graph notes are removed.
0 means unlimited.Methods
remember
"fact"-kind note.
Lookup key for this fact. Keys are trimmed and compared case-insensitively. Use a scoped prefix such as
user:, self:, shared:, or project: to set the memory scope explicitly.Value to store. Trimmed before saving.
Optional metadata to attach to the graph note. See
GraphNoteMetaInput.recall
sessionId is provided, the matched fact’s hit counter increments once per session.
The key or partial key to search for.
An opaque string identifying the current session. When non-empty and the session hasn’t seen this fact before, the hit count increments by one.
The recalled value, or
null if no match was found.Softmax probability of the top match across all vocabulary entries. Range
[0, 1].Difference between the top-1 and top-2 softmax probabilities. A higher margin means a cleaner, less ambiguous recall.
true when a key matched the query and a value was decoded.The actual key that matched the query.
forget
The key to remove.
true if a fact was found and removed, false if no matching key existed.
facts
createNote
"note"-kind graph note. Notes are richer than facts: they have a title, multi-line content, tags, and can carry outbound links.
Note title. Used as the primary search surface and as the human-readable label in the graph.
Note body. Whitespace is normalised (trailing spaces trimmed, runs of 3+ blank lines collapsed).
Optional tag list. Tags are lower-cased and hyphenated.
Optional metadata overrides. See
GraphNoteMetaInput.MemoryNote.
editNote
"fact"-kind note, the underlying fact entry is also updated to stay in sync.
The ID of the note to edit.
Replacement content. Whitespace is normalised.
Replacement tag list.
New title. For fact-kind notes this also updates the fact key.
Set to
true to soft-archive the note.ISO 8601 timestamp to record as
lastRewrittenAt.Metadata overrides applied during the edit.
MemoryNote, or null if the note was not found.
updateNote
editNote, you can update individual fields (such as hits, lastAccessedAt, or scope) without supplying new content.
The ID of the note to update.
An object with any subset of
MemoryNote fields. id and nuggetName are immutable and ignored if supplied.MemoryNote, or null if the note was not found.
deleteNote
hidden is set to true and archivedAt is recorded. Pass hard: true to permanently remove it from the graph file and strip all incoming links.
The ID of the note to delete.
When
true, the note is permanently removed. When false, it is hidden but remains in the graph.true on success, false if the note was not found.
addLink
ID or title of the first note.
ID or title of the second note.
Human-readable description of why these notes are related. Stored on both link objects.
true if the link was created, false if either note could not be resolved.
mergeNotes
source note into the target note. The target’s content gains any unique lines from the source. Tags, links, and hit counts are combined. The source note is soft-archived and a redirect link is added pointing to the target. You can pass a note ID or title for either argument.
ID or title of the note to merge into.
ID or title of the note to merge from. Soft-archived after the merge.
Reason stored on the redirect link attached to the source.
MemoryNote, or null if either note could not be resolved.
searchNotes
Free-text search query.
Maximum number of results to return.
Optional filters. See
NoteFilterOptions.SearchNotesResult sorted by score descending.
listNotes
updatedAt ascending.
Optional filters. See
NoteFilterOptions.getNote
The note ID to look up.
MemoryNote or null if not found.
clear
autoSave is enabled, writes the empty nugget to disk.
status
The nugget’s name.
Number of facts currently stored.
FHRR vector dimensionality (
D).Number of memory banks.
Number of ensemble copies.
Estimated percentage of the theoretical FHRR capacity in use. Calculated as
fact_count / (banks × √D) × 100.Empty string when usage is healthy.
"WARNING: approaching capacity" above 80%. "CRITICAL: nearly full" above 90%.The configured
maxFacts limit. 0 means unlimited.Total number of graph notes (including hidden) belonging to this nugget.
save
<saveDir>/<name>.nugget.json. The write is atomic: data is staged to a .tmp file and then renamed.
Explicit output path. Defaults to
<saveDir>/<name>.nugget.json.Nugget.load
.nugget.json file. On load, legacy unscoped keys are migrated to scoped form and the FHRR memory is rebuilt from the stored facts.
Absolute or relative path to the
.nugget.json file.Whether the loaded nugget should auto-save on mutations.
Nugget instance ready for use.