Shunya Systems

Logs and memory

One place where every program reports, a few kinds of memory that exist today, and the one that is being built.

4 min read

An agent can only fix what it can see, and can only continue what it remembers. This article is about both: where the system's programs report, and how the system remembers from one session to the next. The first is built. The second is partly built, and this article says which part.

One record for everything

Every program in the system, an app on a phone, a server, a build, an agent, logs the same kind of record: when, which program, how serious, a message, a few named fields, and the identity of the piece of work it belongs to. Errors carry their stack. An event a product cares about, such as a form being sent, is the same record with an event name in it.

That last identity is what makes the record useful. One tap in an app can pass through the app, a queue and a server. All three write records that carry the same trace identity, so the whole path of that tap can be read back in order, across programs.

A service in the middle

Programs do not send their logs straight to an analytics product. They send them to a small service the company runs. The service does three things.

  1. It masks. E-mail addresses, tokens and the like are removed once, in one place, before anything leaves.
  2. It keeps a journal. The last two weeks can be searched and any trace read back.
  3. It forwards. Records go on to a hosted analytics product for charts and alerts. That product can be swapped without touching any program.

Logs an agent can read

The journal has a second door, made for agents. Through it an agent can search the logs, read one trace from start to end, or ask for a summary, and each answer is cut to a size an agent can take in. When a person says "the form failed on my phone a minute ago", the agent does not ask for a screenshot. It reads the trace.

Agents write to the journal as well. A long piece of agent work leaves the same kind of record an app does.

Memory today

There is no single memory yet. There are four smaller ones, each real and each in daily use.

MemoryWhat it holdsHow it is read
NotesA few short files: what the person prefers, what went wrong before, what is openIn full, at the start of every session
TicketsEvery piece of work, its state, its outcome and the questions waiting for the personWhen work is picked up or reported
The threadEvery brief and every report between agentsOn demand, back to the first message
A retrieval indexThe code, documents and recent history of the framework's repositoryAsked before any change there

The retrieval index was added after a mistake. An agent built a store for feature flags that the repository already had. Now every task in that repository starts by asking the index what exists.

What is missing

These four do not know about each other. A fact learned in a thread does not reach the notes unless an agent writes it there. Nothing takes in what happens outside the work: messages, mail, measurements, thoughts. And nothing yet hands an agent the right handful of facts for the task in front of it, drawn from all of them.

That is the memory system, and it is the next thing to be built. Its design has three parts: an intake that keeps everything as it arrived, a recall that returns what is relevant to a question, and a body of settled knowledge that is written once and corrected, not relearned. It is designed and not built. When it is built, this article will be rewritten.

What all of this has produced so far is the last article.

Request access

What is collected, and why