agent-decision-log
WHY-layer decision log for AI agents. Records the reasoning behind each branch in an agent run: what options were considered, which one was chosen, the rationale, and what happened.
Sibling of agentsnap (CALLS) and
agenttrace (COST + LATENCY).
Together they cover the three audit dimensions of an agent run.
Install
[]
= "0.1"
Usage
use DecisionLog;
use json;
let mut log = new;
let id = log.add;
log.set_outcome;
let d = log.find_by_id.unwrap;
assert_eq!;
JSONL persistence
use DecisionLog;
let mut log = new;
// ... log.add(...) ...
log.to_jsonl.unwrap;
let loaded = from_jsonl.unwrap;
Each decision serializes as one JSON object per line. Good for jq -c
piping or DuckDB's read_json_auto.
API
Decision { id, timestamp, options, chosen, rationale, outcome, meta }DecisionLog::new()DecisionLog::add(options, chosen, rationale, meta) -> idDecisionLog::set_outcome(id, outcome) -> boolDecisionLog::find_by_id(id) -> Option<&Decision>DecisionLog::last() -> Option<&Decision>DecisionLog::len() / is_empty()DecisionLog::to_jsonl(path) / from_jsonl(path)Decision::chose_listed_option() -> bool
License
MIT