amend

command
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Amend: correct once, prove what it knew

A support team runs a chat agent and a voice agent that share one memory. A rep promises customer 4812 a refund exception on September 12, and the customer calls on September 20 to use it. Today a support lead revokes the exception. The customer disputes the refund they asked for on the 20th.

The demo needs no model. Each transcript turn and the statements drawn from it are fixed, so every run gives the same answers. It uses the support starter registry plus two predicates: refund_exception (approved or revoked) and policy.

Start a Polign server, then run every beat in order:

polign-server -http :8080 -store fs:/tmp/amend-store
go run ./examples/amend -server http://localhost:8080 -collection amend-$(date +%s) -pause

-pause waits for Enter between beats, for presenting live. Use a new -collection for each fresh run. Running the seed beat again is harmless: its turns are dated in the past, so they never undo a later correction.

The beats

Beat What happens What to say
seed Replays the history: a policy memo (Aug 1), the chat promise (Sep 12), the voice call asking to use it (Sep 20). The voice agent reads the exception the chat agent recorded. Both agents learn from one memory.
correct The chat agent records the revocation, timestamped now. The voice agent is asked and answers from the new belief. The history shows both events. "The old fact wasn't deleted. It was retired, with a timestamp." Correct once, fixed everywhere.
withdraw The goodwill-credit policy is withdrawn. The voice agent can no longer cite it; the history keeps it and the withdrawal. Gone from beliefs, kept in history.
timetravel Reads the exception as of Sep 20: approved, with the quote and the whole chat turn it came from. Today's answer is revoked. The request was made while the exception stood, so the company honors it. This is the screenshot.
audit Exports what was believed about customer 4812 on Sep 20 as a JSON bundle, then replays it from the file alone and verifies the digest. Anyone holding the file can check it, without our server.

Run one beat with -beat correct and so on; each beat is a separate process, so the later beats also show the memory surviving across processes. Never cut correct or timetravel.

Check the bundle independently:

go run ./cmd/recall-audit < amend-audit.json

Recording

record.sh plays every beat with narration and nobody typing, against its own server on port 24400 with a fresh store. amend.cast and amend.gif were made with it:

asciinema rec --headless --window-size 124x34 -c ./examples/amend/record.sh amend.cast
agg --idle-time-limit 6 amend.cast amend.gif

What it does not show

The demo proves what the agents believed on any date and which turn each belief came from. It does not link an agent's answer to the beliefs that produced it; that log is not built yet.

Set POLIGN_API_KEY for an authenticated server.

Documentation

Overview

amend demonstrates Recall as the memory of record for a support team: a chat agent and a voice agent share one memory of customer commitments and policies. A commitment is corrected once and both agents answer from the correction, a policy is withdrawn without being deleted, and an as-of read shows what the agents believed on the day a customer made a disputed request, quoting the turn the belief came from.

Turns are scripted and their statements are fixed proposals, so the demo needs no model and gives the same answers on every run.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL