agrag.memory.decisions.DecisionMemory
DecisionMemory(store:GraphStore, *, project_id:str, agent_id:str) -> None
Write and search durable decisions for one configured project.
Functions:
- continue_review_propagation – Expand at most
limitqueued decisions by one dependency hop each. - get_decision – Read a decision only when it belongs to this project.
- list_conflicts – List active same-choice decisions with different conclusions.
- list_decisions – List decisions for a task, including lifecycle history by default.
- list_review – List active decisions that need a look, within this project's bounds.
- reaffirm_decision – Confirm a decision still stands on the current version of its documents.
- record_decision – Record a decision only when every support is valid and in scope.
- reject_decision – Mark a decision rejected without changing its recorded conclusion.
- search_decisions – Find same-project decisions as precedents, with their task context.
- supersede_decision – Record a same-choice replacement and preserve the old decision.
continue_review_propagation
continue_review_propagation(*, limit:int = 100) -> int
Expand at most limit queued decisions by one dependency hop each.
get_decision
get_decision(decision_id:UUID) -> DecisionLookup
Read a decision only when it belongs to this project.
list_conflicts
list_conflicts() -> ConflictList
List active same-choice decisions with different conclusions.
list_decisions
list_decisions(task_name:str, *, include_history:bool = True) -> DecisionPageLookup
List decisions for a task, including lifecycle history by default.
list_review
list_review(*, task_name:str | None = None, limit:int = 20) -> DecisionReviewList
List active decisions that need a look, within this project's bounds.
A listed decision is flagged because a source or a decision it depends
on changed. Review means it needs a look, not that it is false. Use
reaffirm_decision, supersede_decision or reject_decision to
clear the flag.
Parameters:
- task_name (
str | None) – Only list decisions of this task, or all tasks if None. - limit (
int) – The number of decisions to return, capped at the page limit.
Returns:
DecisionReviewList– The decisions in the page, the total count, and whether more exist.
reaffirm_decision
reaffirm_decision(decision_id:UUID, evidence:Sequence[DocumentSupportInput], *, fetched_evidence:Sequence[FetchOutcome] = (), request_id:str | None = None) -> ReaffirmDecisionResult
Confirm a decision still stands on the current version of its documents.
Review means the decision needs a look. It does not mean the decision
is false. Reaffirming records the caller as the reviewer, replaces the
decision's document supports with evidence, and clears the review
flag. It does not change the flags of dependent decisions.
Every document the decision cites must be fetched in its current
version, and evidence must cite exactly those documents. A cited
document that is removed, or whose current version was not fetched
with status ok, fails with cannot_revalidate and the decision
stays flagged. So does a decision that depends on another decision
still needing review.
Parameters:
- decision_id (
UUID) – The id of the active decision to reaffirm. - evidence (
Sequence[DocumentSupportInput]) – The new document supports, one or more per cited document. - fetched_evidence (
Sequence[FetchOutcome]) – Fetch outcomes from this session. They must cover the current version of each cited document. - request_id (
str | None) – An optional key that makes a retry return the stored result of the first call.
Returns:
ReaffirmDecisionResult– The reaffirmed decision, or a result with an error code.
record_decision
record_decision(task_name:str, choice_key:str, conclusion:str, rationale:str, *, supports:Sequence[SupportInput], fetched_evidence:Sequence[FetchOutcome] = (), assumptions:Sequence[str] = (), open_questions:Sequence[str] = (), request_id:str | None = None) -> RecordDecisionResult
Record a decision only when every support is valid and in scope.
Document evidence must appear in fetched_evidence with status
ok. All checks and writes share one graph transaction.
reject_decision
reject_decision(decision_id:UUID, reason:str, *, request_id:str | None = None) -> RejectDecisionResult
Mark a decision rejected without changing its recorded conclusion.
search_decisions
search_decisions(query:str, *, task_name:str | None = None, limit:int = 20) -> list[DecisionHit]
Find same-project decisions as precedents, with their task context.
supersede_decision
supersede_decision(decision_id:UUID, conclusion:str, rationale:str, *, explanation:str, supports:Sequence[SupportInput], fetched_evidence:Sequence[FetchOutcome] = (), assumptions:Sequence[str] = (), open_questions:Sequence[str] = (), request_id:str | None = None) -> RecordDecisionResult
Record a same-choice replacement and preserve the old decision.