Spots

I Gave an AI Agent a Memory with Hindsight. Then I Taught It When to Ignore It.

Most AI agents have a simple memory story: remember something, retrieve something similar, and use it again. That sounds useful until the world changes.

I built ED Resolve, an operational decision engine

I built ED Resolve, an operational decision engine for a recurring Emergency Department problem: a patient is ready for ICU/HDU transfer, but something in the hospital workflow is blocking it. ED Resolve uses Hindsight to remember previous operational experiences — but it does not assume that an old solution is still correct. The hard part was not making the agent remember.

It was making it answer: Does this old

It was making it answer: Does this old experience actually apply to what is happening right now? The problem is bigger than “find a bed”

An ICU transfer can depend on bed availability

An ICU transfer can depend on bed availability, bed cleaning, transport, coordination, escalation paths, and competing transfers. Two situations can look similar at a high level while requiring different actions.

That is why I did not want to

That is why I did not want to build only a prediction model. I wanted a system that can reason over the current operational state, recall previous experiences, reject impossible interventions, simulate feasible alternatives, and learn from the outcome.

A 2026 observational study from a tertiary-care centre

A 2026 observational study from a tertiary-care centre in India examined 510 adults who remained in an Emergency Department for at least 24 hours without specialty transfer and reported system-related causes including ICU/HDU bed waits and interdepartmental disputes. That work motivated the operational setting; ED Resolve itself uses synthetic scenarios and does not claim clinical effectiveness. What happens inside ED Resolve?

CURRENT ED STATE ↓ WORLD MODEL + BOTTLENECK

CURRENT ED STATE ↓ WORLD MODEL + BOTTLENECK ↓ HINDSIGHT RECALL ↓ APPLICABILITY CHECK ↓ GPT-OSS CANDIDATE ACTIONS ↓ CP-SAT HARD CONSTRAINTS ↓ SIMPY COUNTERFACTUAL SIMULATION ↓ DETERMINISTIC SELECTION ↓ OUTCOME + PREDICTION ERROR ↓ HINDSIGHT RETAIN

Every stage has a different responsibility. That separation

Every stage has a different responsibility. That separation is deliberate: I did not want one LLM call to quietly become the entire control system. Hindsight is the experience layer

I use Hindsight as the persistent experiential memory

I use Hindsight as the persistent experiential memory layer. Instead of keeping a few previous messages in a prompt, ED Resolve retains completed operational episodes: the state, bottleneck, candidate actions, constraints, selected action, outcome, and prediction error. Later, another episode can recall those experiences. Memory says: “This happened before.” ED Resolve asks: “Was it the same kind of world?”

That is why Hindsight is central to the

That is why Hindsight is central to the architecture rather than just an attached history store. For background, I also used Vectorize's guide to agent memory. The key layer: applicability Recall something similar → Repeat what worked

News

I Gave an AI Agent a Memory with Hindsight. Then I Taught It When to Ignore It.

Most AI agents have a simple memory story: remember something, retrieve something similar, and use it again.

@spots #dev
Source: Dev.to
See more like this