pub struct MemoryContext {
pub project_context: Option<String>,
pub user_memory: Option<String>,
pub memory_files: Vec<MemoryFile>,
pub surfaced: HashSet<PathBuf>,
}Expand description
Persistent context loaded at session start.
Contains project-level context (AGENTS.md), user-level memory
(~/.config/agent-code/memory/), and individual memory files.
Injected into the system prompt so the agent has context across sessions.
Fields§
§project_context: Option<String>Project-level instructions from AGENTS.md in the repo root.
user_memory: Option<String>User-level memory index from MEMORY.md.
memory_files: Vec<MemoryFile>Individual memory files linked from the index.
surfaced: HashSet<PathBuf>Paths already surfaced in this session (to avoid duplicates).
Implementations§
Trait Implementations§
Source§impl Clone for MemoryContext
impl Clone for MemoryContext
Source§fn clone(&self) -> MemoryContext
fn clone(&self) -> MemoryContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MemoryContext
impl Debug for MemoryContext
Source§impl Default for MemoryContext
impl Default for MemoryContext
Source§fn default() -> MemoryContext
fn default() -> MemoryContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MemoryContext
impl RefUnwindSafe for MemoryContext
impl Send for MemoryContext
impl Sync for MemoryContext
impl Unpin for MemoryContext
impl UnsafeUnpin for MemoryContext
impl UnwindSafe for MemoryContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more