Memory
class Memory(store: MemoryStore, val injectMemory: Boolean = true, val maxTokens: Int, val maxLines: Int = 200, val maxMemorySize: Int, val maxSearchResults: Int = 10, val maxSearchResultChars: Int, val heading: String = "", guidance: String? = null) : Capability(source)
A persistent notebook for the agent, with the tools and prompt format of Pydantic AI Harness Memory: MEMORY.md is the main notebook, injected each turn inside <memory> markers (bounded by maxTokens / maxLines) with the names of other files; write_memory appends or replaces one unique passage, read_memory reads a bounded prefix, delete_memory removes a topic file, search_memory finds files by terms.
Writes are compare-and-swap and idempotent per tool call: replaying the same call does not append twice.