Skip to main content

Crate byob_memory

Crate byob_memory 

Source
Expand description

byob’s memory: the bundled memory plugin’s backend, in-process. Memory is plain Markdown the user can read and edit in any editor:

  • <config>/memory.md: notes for every chat (byob’s config folder);
  • <workspace>/.byob/memory.md: notes for one workspace.

Each - line is one note; anything else in the files (headings, prose) is kept as it is. A before_prompt hook puts the start of both files (PROMPT_CAP bytes each) into the system prompt, remember(text, scope?) adds a note and forget(text, scope?) removes one (by its text, a unique part of it, or its number), and a pane shows and edits both.

The plugin’s manifest (crates/bundled/plugins/memory) names it with "backend": {"native": "memory"}; the app registers factory under ID.

Structs§

Files
Where the files are.
Memory
The memory backend’s state.

Enums§

Scope
Which file.

Constants§

ID
The id manifests name ("backend": {"native": "memory"}).
MAX_FILE
Largest memory file remember still adds to.
MAX_NOTE_CHARS
Longest note (characters).
PROMPT_CAP
Most bytes of each file that go into the system prompt.
TOOLS
The tools it serves, in the manifest’s order.
VIEW
The pane it draws.
WORKSPACE_FILE
The workspace file, relative to the workspace.

Functions§

factory
Makes a fresh backend (registered as ID); config is byob’s config folder.
forget
Remove a note: query is its text, a unique part of it, or its number (3, #3) in the file of scope. Without a scope both files are searched.
pane
The pane: both files, their notes with Forget buttons, a field to add one.
prompt
The system-prompt section.
remember
Add note text to the file of scope.