Skip to main content

inject_memory_prompt

Function inject_memory_prompt 

Source
pub fn inject_memory_prompt(
    system_instructions: &str,
    memory_summary: Option<&str>,
) -> String
Expand description

Injects memory summary into system instructions if available.

This function appends memory context to the base system instructions, enabling the agent to maintain persistent context across conversation turns.

§Arguments

  • system_instructions - The base system instructions
  • memory_summary - Optional memory summary from session state

§Returns

System instructions with memory context injected, or original instructions if no memory