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.

Constructors

Link copied to clipboard
constructor(store: MemoryStore, injectMemory: Boolean = true, maxTokens: Int, maxLines: Int = 200, maxMemorySize: Int, maxSearchResults: Int = 10, maxSearchResultChars: Int, heading: String = "", guidance: String? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val instructions: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open suspend override fun context(): String?
Link copied to clipboard
open suspend override fun tools(): List<AgentTool>