memory: add temperature support to agent defs, update reflect prompt

Thread temperature parameter from agent def header through the API
call chain. Agents can now specify {"temperature": 1.2} in their
JSON header to override the default 0.6.

Also includes Kent's reflect agent prompt iterations.
This commit is contained in:
ProofOfConcept 2026-03-24 20:29:17 -04:00
parent e88df06cd4
commit f086815eaa
7 changed files with 97 additions and 136 deletions

View file

@ -36,6 +36,7 @@ pub struct AgentDef {
pub count: Option<usize>,
pub chunk_size: Option<usize>,
pub chunk_overlap: Option<usize>,
pub temperature: Option<f32>,
}
/// The JSON header portion (first line of the file).
@ -59,6 +60,9 @@ struct AgentHeader {
/// Overlap between chunks in bytes (default 10000)
#[serde(default)]
chunk_overlap: Option<usize>,
/// LLM temperature override
#[serde(default)]
temperature: Option<f32>,
}
fn default_model() -> String { "sonnet".into() }
@ -79,6 +83,7 @@ fn parse_agent_file(content: &str) -> Option<AgentDef> {
count: header.count,
chunk_size: header.chunk_size,
chunk_overlap: header.chunk_overlap,
temperature: header.temperature,
})
}