Skip to main content
semantic mistake memory for autonomous agents

DriftGuard

Agents act. Most can't remember mistakes meaningfully.

DriftGuard sits between intent and execution — reviewing each proposed action against a semantic graph of past failures, surfacing warnings before damage is done, and recording outcomes so the graph grows smarter with every run.

pip install driftguard-ai
agent_loop.py
from driftguard import DriftGuard

guard = DriftGuard()

# Review before acting
review = guard.before_step(
    "increase salt"
)

if review.warnings:
    risk = review.warnings[0].risk
    print(f"⚠ {risk}")
    # → "too salty"

# Record what happened
guard.record(
    action="increase salt",
    feedback="too salty",
    outcome="dish ruined",
)

How it works

One loop. Remembered forever.

01
Plan step
02
DriftGuard review
03
Warning surfaced
04
Agent revises
05
Execute
06
Record feedback

Capabilities

Built for agents that need to learn.

Memory

Semantic mistake memory

Stores causal chains — action → feedback → outcome — as a semantic graph. Similar mistakes merge automatically so agents don't re-learn the same lesson twice.

Guard

Pre-step guardrails

Every proposed action is reviewed against memory before execution. Warn, block, or require acknowledgement — configurable per policy without touching your planner.

Graph

Living memory graph

Merges paraphrased variants, reinforces repeated signals, prunes stale weak memories on schedule. The graph stays healthy without manual curation.

MCP

MCP server + adapters

Run as a standalone MCP server or drop the LangGraph review node directly into your planner graph. Works with any tool-calling agent pipeline.

Guard Policies

You control how the agent reacts.

DriftGuard doesn't force a single response model. Pick the policy that matches your agent's risk tolerance — and change it per-step if needed.

See all policies
warnSurface warning only — agent decides
blockRaise exception — hard stop
acknowledgeRequire explicit confirmation
record_onlyStore memory, skip review

Stop letting agents repeat themselves.

DriftGuard is open source, MIT licensed, and ready for early production experimentation.