pub struct DecisionWriter { /* private fields */ }Expand description
The deterministic middle ground between MemoryWriter (verbatim final
answer — noisy) and MemorySynthesizer (LLM distillation — costs a
model call): persist only the lines that start with a capture marker,
"DECISION:" by default.
Zero model calls, zero cost, and predictable: a run that states no
decision writes nothing at all, so the store accumulates only content an
agent explicitly committed to. Pair it with a system prompt that asks for
conclusions as DECISION: lines. Measured against an LLM-free
co-occurrence extractor on technical run transcripts, marker capture was
the only extraction that stayed noise-free.
Marker lines from every assistant turn of the run are collected (not
just the final one — an agent may commit to something mid-run), deduped
verbatim, and written as one entry tagged decision on TaskCompleted.
Implementations§
Source§impl DecisionWriter
impl DecisionWriter
pub fn new(memory: Arc<dyn Memory>) -> Self
Sourcepub fn with_markers(
self,
markers: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_markers( self, markers: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Replace the line prefixes that trigger capture.
Sourcepub fn with_source(self, source: impl Into<String>) -> Self
pub fn with_source(self, source: impl Into<String>) -> Self
Tag every persisted entry with the given source name.