Skip to content

Jev for AI agent memory cleanup: a context sweep

Jev swept 6,000 claims of agent memory in seven minutes for 37 cents. What context poisoning is, and how the sweep would run on a SpineOS knowledge base.

Most people who run an AI agent for more than a week end up with some kind of second brain: a folder of notes the agent reads before it works and writes to when it learns something. The folder gets messy fast. Decisions get reversed, facts expire, the same lesson gets written three times. Nobody cleans it, because reading every note against every later note is a job nobody has time for.

A developer published a demo this week that does the cleaning with Jev, TypeSafe AI's new decision model. On a set of more than 6,000 claims, the sweep made about 41,000 judgments in roughly seven minutes for about 37 cents. It also flagged a hard decision in the developer's own memory file that they had overruled months later, and that the agent had been reading as current ever since.

We run a shared knowledge base for every SpineOS workspace, and it has the same problem. This post explains what the sweep does, where the numbers come from, and what a version of it would look like on a workspace vault. That last part is a design sketch and an invitation. It is not a shipped feature.

What Jev is

Jev is a model that answers typed questions about a piece of content and returns probabilities instead of prose. TypeSafe AI released it on 15 September 2026 and calls it a System One model: fast classification rather than step-by-step reasoning.

A request carries a state (the text to judge) and a set of questions. Each question is one of three types, per the TypeSafe documentation:

Question typeWhat you supplyWhat comes back
ChoiceA list of options, up to 255The chosen option, a probability per option, and a confidence
ScoreAn ordered rubric of 2 to 10 levelsA level, a probability per level, and a confidence
NoulA yes/no propositionA single value between 0 and 1

The launch post prices input at $0.042 per million tokens, charges nothing for output, and quotes end-to-end response times of 70 to 500 milliseconds. Source: TypeSafe's introduction to System One models and Jev, read on 21 September 2026.

Jev cannot write text, so it cannot rewrite a note or explain its answer. That limit is the reason the sweep works the way it does.

What context poisoning is in an AI agent

Context poisoning is what happens when an agent pulls a fact that is no longer true into its working context and then builds on it for the rest of the session. The agent does not know the fact is stale. It found the note with a search tool, the note reads as authoritative, and every later step inherits the error.

The symptom users describe is that the model "got stupid." The model did not change. Its inputs did.

A folder of notes is the simplest case of a failure that shows up in every memory architecture. A retrieval system that re-embeds documents on a schedule keeps serving the old version until the schedule fires. A graph that promotes summaries upward carries a reversed decision into every digest above it. In each case the corpus holds two claims that cannot both be true, and nothing marks which one won.

Why nobody cleans an agent's memory

Cleaning is expensive because it is a pairwise job. To know whether a claim is stale, you read it against the claims that came after it and decide whether one of them supersedes it, duplicates it, or contradicts it. For thousands of claims, that is thousands of readings per claim.

The developer behind the demo estimated that running the same set through Claude Sonnet would take about twelve hours and around sixty dollars. That is their estimate, not a measurement, but the order of magnitude matches what anyone who has tried this by hand would expect. A task that costs a working day and a meaningful invoice runs once, if ever, and always as a background job someone has to remember to start.

So the corpus stays dirty, and the agent keeps reading it.

How a context cleanup sweep splits the work between code and Jev

The sweep gives the mechanical half to code and the judgment half to Jev. Code can extract every claim with its date, order them, and pair each claim against the ones written later. What code cannot do is read two sentences and say whether the newer one kills the older one. That is the only part the model does.

One pair looks like this. The state carries both claims, and two questions ask about their relationship:

{
  "model": "jev-latest",
  "state": {
    "older": {
      "date": "2026-03-04",
      "text": "Client invoices go out on the 1st of the month."
    },
    "newer": {
      "date": "2026-08-19",
      "text": "Agreed with the client in August: invoices now go out on the 15th."
    }
  },
  "questions": {
    "relation": {
      "type": "choice",
      "instructions": "How does the newer claim relate to the older one?",
      "criteria": {
        "supersedes": "The newer claim replaces the older one. The older one is no longer true.",
        "duplicate": "Both claims say the same thing.",
        "contradicts": "They conflict and the text does not settle which is current.",
        "unrelated": "They are about different things."
      }
    },
    "still_true": {
      "type": "noul",
      "instructions": "Is the older claim still true after reading the newer one?"
    }
  }
}

The answer comes back as probabilities rather than a sentence. For this pair you would expect something close to supersedes at 0.9 and still_true near 0.05. The exact figures are illustrative; what matters is that every pair gets a number, and the numbers can be sorted.

That sorting is the product. Run the sweep, get a ranked list of the pairs most likely to be poisoning the corpus, and hand that list to an agent or a person to fix. The sweep finds problems. It does not edit anything.

What the sweep found, and what it missed

On the demo set, the sweep covered more than 8,000 comparisons, about 41,000 judgments in total, in about seven minutes for about 37 cents. Running a frontier model over the same pairs in the same seven minutes got through about 180 of them. All of those figures are the developer's own report from one run, not a benchmark we reproduced.

The accuracy claim is the more interesting one, and it is anecdotal in the best sense: the sweep surfaced a note in which the developer had recorded a firm decision, and a later note where they had reversed it after it caused problems. The agent had been reading the first note as current for months.

Mike Taylor's test for Every is the counterweight. In a seeded check with seven planted writing defects, Jev found six and Claude Fable 5.1 found all seven, with Jev about 25 times faster at an estimated 580th of the cost. Read the two results together and the design rule writes itself: Jev's output is a ranking, and a person or an agent decides what to do with each line of it.

What a Jev sweep would look like on a SpineOS workspace knowledge base

Every SpineOS workspace has a shared knowledge base: a folder of markdown notes that every desktop in the workspace can read and write, with folders for memories, lessons learned, issues and fixes. Agents write to it as they work. You can open it in Obsidian. Over a few months it accumulates exactly the kind of superseded claims the demo went looking for.

Here is the sweep we would build on it. None of this exists today.

  1. A scheduled task in Mission Control runs the code half: walk the vault, pull every dated claim, and pair each one against later notes that share a folder or a tag. Most pairs are unrelated on their face and never leave the machine.
  2. The shortlisted pairs go to Jev with the two questions above.
  3. The results land back in the vault as a report note: the date of the sweep, the pairs ranked by probability, and a count per category. Nothing else is written.
  4. An agent picks up the report as a task. For high-probability supersessions it adds a superseded_by link to the older note. For duplicates it proposes a merge. For contradictions it leaves a comment and asks a human.

The reason the report is a note rather than a dashboard is that agents already read the vault. A report in the vault is something the next agent to search for "invoices" will find before it finds the stale claim.

Two things we would need before switching this on for a customer workspace. The pairs leave the workspace and go to a third party, so it would be opt-in per workspace, and we would want a clear data retention answer from TypeSafe for that traffic. And we would want to run it on our own vault first, because the demo's error rate is one anecdote and a workspace vault is someone's business.

If you are on the TypeSafe side and reading this, we would like to try it. If you run a workspace with a vault old enough to have gone stale, we would like to run it on yours, with your permission, before anyone else's.

Rules for a cleanup sweep that does not destroy history

A sweep is only safe if it is allowed to be wrong. Four rules follow from that.

  1. Probabilities rank, a threshold gates, a person or an agent decides. The model never deletes.
  2. Supersession is a link, not a deletion. The old note was true on the day it was written, and an agent that later asks "why did we do it that way" needs to find it.
  3. Re-run on a schedule. A note that is current today will be superseded by something written next month, and the sweep's last result cannot see that.
  4. The report says what it read and when. A finding pinned to a date can be checked. A finding without one becomes the next stale claim.

The developer's own example is the argument for rule two. The overruled decision was not wrong in March. It was wrong to still be presented as current in September. The fix is a pointer from the old note to the new one. An empty file where the decision used to be would erase the reason along with the mistake.

Frequently asked questions

What is Jev?

Jev is a decision model from TypeSafe AI, released on 15 September 2026. It takes a piece of content and a set of typed questions, and returns a probability per option instead of written text. It is priced at $0.042 per million input tokens with no charge for output.

What is context poisoning?

Context poisoning is when an agent retrieves a fact that is no longer true and then reasons from it for the rest of the session. The usual cause is a memory store that holds both the old claim and the newer one that replaced it, with nothing marking which is current.

Does SpineOS use Jev today?

No. The workspace knowledge base exists and every desktop in a workspace shares it. The Jev sweep described here is a design we would like to build, and we have not built it.

Can I run a sweep like this on my own notes today?

Yes. An open source tool, jev-second-brain, indexes an Obsidian vault locally and, optionally, asks Jev to classify note pairs as duplicate, related, revises, contradicts, none or unsure. It is local-first and sends only the shortlisted pairs to the model.

Will a sweep delete my notes?

Not in the design above. The sweep writes a report. Any edit to a note is made by an agent or a person acting on that report, and supersession is recorded as a link rather than a deletion.

Open a workspace at www.spinestudio.dev and give your agents a knowledge base to share. If you are building on Jev and want to try a cleanup sweep on a real workspace vault, write to contact@spinestudio.dev.

Related reading

Ready to give your AI agent a real desktop?

View plans

Monthly newsletter

Once a month. Not one more.

The best articles, product news, and one reading pick. Five minutes, start of the month.