Documentation
¶
Overview ¶
Package memory is tomo's long-term store: MEMORY.md is a one-line-per-fact index that rides in the system prompt, and each fact's detail lives in its own markdown topic file. Plain files on purpose, so the user can read, edit, and grep their agent's memory like anything else on disk.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Memory ¶
type Memory struct {
Dir string
// contains filtered or unexported fields
}
Memory roots the store at one directory. It is safe for concurrent use: the curator writes on its own goroutine while a live turn may be reading.
func (*Memory) Save ¶
Save writes (or overwrites) a topic file and keeps the index line for it current: one line per slug, replaced in place when the fact changes.
func (*Memory) SaveNoted ¶
func (m *Memory) SaveNoted(slug, title, body string, p Provenance) error
SaveNoted is Save with a provenance stamp appended to the body. The curator uses it so an inferred fact carries where it came from; a direct write from the user leaves the stamp empty and trusts the fact plainly.
type Provenance ¶
type Provenance struct {
Source string // who recorded it, e.g. "curator"
From string // where it was learned, e.g. "telegram:12345"
On string // date, supplied by the caller so memory stays clockless
}
Provenance labels where a fact came from, so a later reader can weigh it: a fact the user stated outright is worth more than one the curator inferred while tidying up. It rides as a trailing line in the topic file, visible to the model when it reads the topic. The zero value adds no line.