Reference design · Intelligence
Field Agent Memory That Learns From Corrections
- Hindsight
- PostgreSQL
- pgvector
- Ollama
- ERPNext
- MCP
The problem
An operations agent that drafts work orders starts every conversation knowing nothing, so an engineer corrects the same mistake at the same site week after week, and nothing the agent got wrong is kept where the next draft can see it.
What I would build
A self-hosted Hindsight memory layer beside the operations agent. The agent retains every engineer correction and every failed tool call against its site and asset, and recalls what happened last time there before it drafts the next work order. A scheduled reflect pass gathers repeated corrections into proposed rules, and an engineer approves each one before the agent may treat it as standing practice. It runs on Postgres with local embeddings and an Ollama model, so site records stay in-house.
The logic flow
Click any node for what it does, what it hands on, and where a person is required.
What it returns
This is a reference design on someone else's open-source project, not a system I run, so there is no measured saving to quote. The numbers I would watch are how often an engineer still corrects the same thing at the same site, and how many proposed rules the engineers reject. A small local model can return malformed extraction JSON, so strict schema mode goes on from the first day.
Why it fits
A battery-string operator's maintenance staff can now ask their own assistant for the replacement interval of a cell type, the torque on a terminal and the discharge procedure in the standard, so a service firm that sold that knowledge is selling something its customer already has. The tempting response is to put a chatbot in front of the old work-order desk. That makes the desk quicker and leaves it exactly as forgetful, because the assistant on the customer's side and the one on the firm's side both start every conversation knowing nothing about the string at site 14 that has failed its float check twice since March.
This design gives the firm's operations agent a memory it earns from the people who correct it. Every time an engineer rewrites a draft work order, and every time a tool call fails, the agent files the event with Hindsight's 'retain' call, against that site and that asset. Before it drafts the next order it calls 'recall' and reads what happened last time. Once a week, a 'reflect' pass gathers corrections that keep recurring into proposed rules, and an engineer accepts or rejects each one before the agent may treat it as standing practice. The whole store runs on the firm's own Postgres with local embeddings and a local model, so the site records never leave the building.
Over five years, and I offer this as a sketch rather than a plan, the firm could stop selling the procedure and start selling the record of how the procedure went wrong on each customer's equipment, reviewed and signed by the engineers who made the corrections. Each correction gives the next draft at that site something to read, and every rule carries the name of the engineer who approved it. A customer's assistant can recite the standard. It cannot recite their history.
See it run
Want one of these?
Every part of it is open source and self-hostable. What I bring is the build, the checks around the project's gaps, and the judgement about where your gates should sit.