Class●Since v0.7
MemoryMiddleware
MemoryMiddleware(
self,
*,
backend: BackendProtocol,
sources: list[str],
add_cache_control:Bases
Constructors
Attributes
Methods
=
False
,
system_prompt
:
|
None
=
)
Parameters
constructor
__init__
Middleware for loading agent memory from AGENTS.md files.
Loads memory content from configured sources and injects into the system prompt. Supports multiple sources that are combined together. See constructor for the full argument list.
System-prompt fragment template. Must contain a
{agent_memory} slot for runtime memory substitution. Pass
None to skip appending entirely (memory is still loaded
into state["memory_contents"]).
