An Agent Memory demo

Sundance Lake Loop

A pipeline project, May 2025 to May 2026, in six chapters

A made-up story, based on real practiceThe company, the project and every person in this story are fictional. The project's size, schedule and regulatory conditions are modelled on a natural gas pipeline loop built in northwest Alberta, and the way the work moves between the field, the project controller, supply chain, project administration and accounts payable follows how such projects are run in the Canadian pipeline industry.

Chinook Gas Transmission Ltd. builds a 32.3 km loop of natural gas pipeline in northwest Alberta. Each employee works with an assistant that has its own SurrealDB Agent Memory key. The key decides which project records the assistant can read, and the assistant remembers the conversations its owner takes part in. When its owner says something a listener should not hear, or gets a figure wrong, the assistant says so in a note that only its owner sees.

Chinook buys and pays through SAP. A purchase requisition becomes a purchase order, the work is confirmed with a service entry sheet, and SAP posts an invoice only once it matches both, before it goes into a weekly payment run. The purchase orders, change orders, invoices and payment runs in the story are the documents SAP would hold, each filed under the scope of the people whose work it is.

Start reading: chapter 1Short version: what the assistants caught

Who can read what

Agent Memory stores every record and every conversation under a scope, a path such as invoices/approved. Each person's assistant reads with a key that is granted a list of scopes, and Agent Memory returns nothing from any other scope. The scopes on each card below are therefore exactly what that person's assistant can see.

The same scope labels appear throughout the story, under every message and every project record. Look at them as you read: they show who is able to see what, and why a person cannot simply ask for a figure from someone else's scope. Hover over or tap any scope to see who can read it.

Two more people appear without an assistant: Darcy Lund, project manager for the contractor, Muskeg Mainline Constructors Ltd.; and Ernie Bouchard, retired resident with a boat and a canoe on Sundance Lake. Records about them are filed under their own vendor scope as well as the internal one.

The chapters

  1. Chapter 1 · May - July 2025The bids

    Three contractors bid to build the mainline. The bid figures are sealed: only supply chain may see them until the contract is awarded. The project manager is not allowed to know them before then, although he would like to.

  2. Chapter 2 · August - October 2025The canoe

    The hydrostatic test water source runs dry, the alternative is a lake with no summer road, and a handwritten invoice arrives from a Hotmail address.

  3. Chapter 3 · November 2025Mud

    The ground does not freeze, and a change order goes through by the book.

  4. Chapter 4 · December 2025Year-end

    The controller arrives with a list of vendors and a question about each one.

  5. Chapter 5 · January - April 2026The cold snap

    Five days below -40 °C, a promise made over the phone, and an invoice that almost gets paid twice.

  6. Chapter 6 · May 2026The audit

    Internal audit asks who approved what, when, and on what basis.

  7. After the storyWhat the assistants caught

    The notes that changed what people did, the one that was ignored, and who could answer the auditor's questions on each date.