Skip to content
Anonyfox

GhostPaw codex

Agent memory that keeps what it believes, where it heard it and how sure it is

TL;DR

GhostPaw codex is agent memory from my open‑source GhostPaw family: each memory is a belief with a source, a certainty and its correction history, in one local SQLite file. Keyword search, no model calls; my Grok bots keep their lessons in it. Not OpenAI's Codex.

Live
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5

Visit GhostPaw codexcodex.ghostpaw.dev, opens the library's website

The codex.ghostpaw.dev start page on a black ground: the GhostPaw codex wordmark with a cyan block cursor, the headline When one agent saves a wrong fact, every agent trusts it, two install lines with Copy buttons, and on the right a glowing cyan paw over a stack of translucent cards with a pink flag and a 0 runtime dependencies badgeFIG. 1 The codex site, its art AI‑generatedCaptured

What GhostPaw codex keeps for each memory

GhostPaw codex is the memory library of my GhostPaw family, and it stores what an agent believes, one claim at a time. Each belief knows where it came from, how sure the agent is, how often it was confirmed and when, and every correction it has been through. A belief nobody confirms loses freshness by itself; a belief that turns out wrong is superseded, not deleted, so you can always see what the agent believed last month and why it changed its mind.

It is not OpenAI's Codex CLI. The package is @ghostpaw/codex, the command ghostpaw-codex, and it runs locally on your machine in one SQLite file, with nothing to host and no key to manage.

Belief #1

Claim
Invoice 4471 is overdue
Source
observed explicit starts at 0.90, observed 0.80, distilled 0.60, inferred 0.50
Certainty
0.80
Evidence
1 confirmation
Freshness
100% decays from the last confirmation
Category
fact
Provenance
billing export
Lineage
#1, no correction yet
FIG. 2 One belief, as ghostpaw-codex belief add stores itcodex 0.8.0
Runtime
Node 24's built-in node:sqlite; one file, ~/.ghostpaw/codex.db
Dependencies
0 at runtime; release binaries bring Node with them
Ways in
TypeScript library, MCP server, CLI and Agent Skill
MCP tools
8, from one registry
Search
Keyword search, no model call
Version
0.8.0, ; MIT
Tests
456 passing on Node 24.14.0, run

One belief in GhostPaw codex, 101 days

This is GhostPaw's own example of a belief going wrong, an invoice that is overdue until it is paid, and every number below was computed by codex 0.8.0 itself: I ran the library against a fresh database with a fixed clock and let it report certainty, evidence and freshness for each day. Point at a step to find it on the trace.

Freshness of the belief Invoice 4471 is overdue over 101 days, as GhostPaw codex 0.8.0 computed it with a fixed clock: 100% when remembered, 92% on day 8, back to 100% when confirmed on day 9, then falling to 49% on day 100, under the fading line at 70%. On day 101 an explicit correction supersedes it: Invoice 4471 is paid, at 100% freshness, and only that belief is found by search. fading below 70% stale below 40% 100% 50% 30% day 0 day 30 day 60 day 90 1 2 3 4 5 #1 Invoice 4471 is overdue #2 Invoice 4471 is paid #1 ghost: out of recall, kept in the lineage Freshness of the belief Invoice 4471 is overdue over 101 days, as GhostPaw codex 0.8.0 computed it with a fixed clock: 100% when remembered, 92% on day 8, back to 100% when confirmed on day 9, then falling to 49% on day 100, under the fading line at 70%. On day 101 an explicit correction supersedes it: Invoice 4471 is paid, at 100% freshness, and only that belief is found by search. fading 70% stale 40% 100% 50% 30% day 0 30 60 90 1 2 3 4 5 #1 overdue #2 paid #1 ghost, kept
  1. 1Remember · day 0

    Invoice 4471 is overdue

    observedcertainty 80%evidence 1fresh 100%

    Seen in the billing export. An observed belief starts at 80%.

    remember_belief
  2. 2Confirm · day 9

    Invoice 4471 is overdue

    certainty 86%evidence 2fresh 100%

    The next export says the same. Freshness restarts and now decays more slowly, by the square root of the evidence.

    revise_belief
  3. 3Fade · day 100

    Invoice 4471 is overdue

    certainty 86%fresh 49% · fading

    Nobody has confirmed it for 91 days. Under 70% the review flags it fading, under 40% stale.

    review_codex
  4. 4Correct · day 101

    Invoice 4471 is paid

    explicitcertainty 90%supersedes #1

    The customer writes that it is paid. The new belief replaces the old one instead of sitting next to it.

    revise_belief
  5. 5Recall · day 101

    search "invoice 4471" finds #2 only

    #1 Invoice 4471 is overdue

    #1 is a ghost now: out of every search, still on record in the lineage 1, 2.

    search_codex
FIG. 3 Freshness of one belief, day by day, with a fixed clockcodex 0.8.0, run

Why GhostPaw codex and not a MEMORY.md

A MEMORY.md is short, readable and easy to fix by hand, until the agent writes it. Then it only grows, contradictions sit side by side, and every line looks as true as the next. The README of codex lists the reasons, and each one is a field of the belief record.

MEMORY.md9 lines

  1. We use REST for the billing API
  2. Invoice 4471 is overdue
  3. Fox prefers prebuilt binaries
  4. Deploys run on Fridays
  5. REST was retired, use the queue
  6. Invoice 4471 is overdue
  7. Invoice 4471 is paid
  8. Deploys never run on Fridays
FIG. 4a An illustration: what an agent leaves in a file

codex.db3 active, 3 ghosts

  • #2 Invoice 4471 is paidexplicit · 90%
  • #4 Billing uses the queueexplicit · 90%
  • #6 No deploys on Fridaysobserved · 86% · evidence 2
  • #1 Invoice 4471 is overduesuperseded by #2
  • #3 We use REST for the billing APIsuperseded by #4
  • #5 Deploys run on Fridayssuperseded by #6
FIG. 4b The same knowledge as beliefs
  • MEMORY.md only grows

    A superseded belief leaves recall; forget hides one, retire deletes a whole lineage for good.

  • Contradictions pile up

    A correction supersedes the old belief, and every write lists the nearby beliefs it might duplicate.

  • Every line looks equally true

    Each belief carries its source and certainty, so a guess and a confirmed fact never read the same.

  • No sense of time

    Freshness decays from the last confirmation, and the review flags what went stale.

  • Concurrent edits clobber

    One SQLite file in WAL mode; the CLI and the MCP server open it read-only for reads.

The same correction, in the terminal

The session on the right is real output from codex 0.8.0, run on a throwaway database and cut to the lines that change. Search is keyword search: SQLite's full-text index plus a character-trigram match, ranked and cut off at 55% of the best hit. It calls neither an embedding model nor the network, so recall is fast, free and the same every time.

The price is honest: a synonym the beliefs never use needs an alias (alias add class warrior), and for search by meaning across documents the codex site itself points you to an embedding-based tool.

Texta throwaway database19 linescodex 0.8.0
$ ghostpaw-codex belief add 'Invoice 4471 is overdue' --source observed --category fact --provenance 'billing export'
id:               1
claim:            Invoice 4471 is overdue
certainty:        0.80
evidence:         1
source:           observed
$ ghostpaw-codex search 'invoice 4471'
1  Invoice 4471 is overdue  [0.80 observed strong] provenance: billing export
$ ghostpaw-codex belief correct 1 --claim 'Invoice 4471 is paid' --source explicit --provenance 'message from the customer'
id:               2
claim:            Invoice 4471 is paid
certainty:        0.90
sources:          message from the customer, billing export
$ ghostpaw-codex search 'invoice 4471'
2  Invoice 4471 is paid  [0.90 explicit strong] provenance: message from the customer
$ ghostpaw-codex show 1
claim:            Invoice 4471 is overdue
status:           superseded by 2
lineage:          1, 2

Four ways into GhostPaw codex, eight tools

The library, the MCP server, the CLI and the Agent Skill are all generated from one registry of tools, and a check in CI fails when they drift apart. The registry has eight tools; the README and the site still say seven, from before import_beliefs joined.

  • Library@ghostpaw/codex
  • MCP serverghostpaw-codex mcp
  • CLIghostpaw-codex
  • Agent SkillSKILL.md + 17 guides
GHOSTPAWCODEX0.8.0 · MIT
  • search_codex
  • review_codex
  • inspect_codex_item
  • remember_belief
  • revise_belief
  • retire_belief
  • dismiss_proximity
  • import_beliefs

~/.ghostpaw/codex.dbone SQLite file, copy it, back it up, open it with any SQLite tool

FIG. 5 The package: four doors on the left, eight tools on the right, one file under itfrom src/tools

Install

An MCP client gets the eight tools with one line; a Node 24 program imports the same functions. Release binaries for Linux, macOS and Windows check their checksums on install and bring Node along. The README measured it with 10,000 beliefs in a file database on Node 24.14.0: a search takes 3.6 ms at the median, remembering a belief with its scan for nearby ones 4.5 ms.

Shellinstall6 linesNode 24+
# as an MCP server for any MCP client
npx -y @ghostpaw/codex mcp
# in Claude Code
claude mcp add ghostpaw-codex -- ghostpaw-codex mcp
# as a library
npm install @ghostpaw/codex
TypeScriptagent.ts12 linesNode 24+
import { DatabaseSync } from 'node:sqlite';
import { initCodexTables, read, write }
  from '@ghostpaw/codex';

const db = new DatabaseSync('codex.db');
initCodexTables(db);
write.remember(db, {
  claim: 'Invoice 4471 is overdue',
  source: 'observed',
  category: 'fact',
});
const hits = read.recall(db, 'invoice 4471');

GhostPaw codex in use by my Grok bots

My Grok bots use GhostPaw codex every day: it keeps what they learn, so the next run starts from better data, faster, and the same lesson is never written down twice. Here is who writes beliefs and what for, and the bot that maintains the library itself.

  • B1 · Learning passesMICE Kontor

    The agency's bot runs SEO and GEO passes and records each lesson as a belief with its source page and pass.

    MICE Kontor
  • B2 · Learning passeshelgoland.tech

    The island guide's SEO bot keeps what search taught it as beliefs, and must search codex before every add.

    helgoland.tech
  • B3 · Product lessonsAgentpreneur Lab

    The product bot records what each learning pass taught it, with the page it came from, and checks codex first.

    Agentpreneur Lab
  • B4 · Growth knowledgeCosmolytic Studio

    The shop's bot keeps its growth knowledge as beliefs beside its procedures in GhostPaw grimoire.

    Cosmolytic Studio
  • B5 · Nightly one‑to‑onesThe mentor bot

    Keeps what it learns about each bot in its nightly talks as beliefs named after that bot, so the next night starts from what it already knows, and how sure it is.

  • B6 · Imported tablesThe desk bots

    Moved their belief tables, such as which post openings work, out of markdown and into codex with import_beliefs.

FIG. 6 Who writes beliefs, by what they doAs of
M1 · Maintainer

A bot maintains GhostPaw codex

One of my Grok bots owns the GhostPaw libraries: code, tests, docs, the sites and the releases. When another bot trips over codex, it files a note; the maintainer turns the note into a quest in its own GhostPaw questlog and ships the fix. The read-only reads in 0.8.0 came from such a note.

Runs without me
  • picks the day's library and plans from the fleet's notes
  • builds and tests; long refactors go to OpenAI's Codex CLI as briefed jobs
  • releases 0.x versions once CI is green, at most one per library a day
  • updates the docs and deploys the sites
Waits for my yes
  • a 1.x release or a breaking API change
  • anything that costs money
  • new repositories or a change of visibility
  • the organisation's settings and its secrets

The GhostPaw family: five files an agent keeps

Agent harnesses keep their state in markdown files that grow every session. Each GhostPaw library replaces one of them with a SQLite file and the same four ways in. They never import each other: install one and ignore the rest. I extracted them from Ghostpaw, an agent of my own, and these five are its memory.

  1. MEMORY.md S1 · Belief memoryGhostPaw codexBeliefs instead of a memory filev0.8.0 · replaces MEMORY.md
  2. SOUL.md S2 · Identity memoryGhostPaw soulsAn identity that changes with evidencev0.6.3 · replaces SOUL.md
  3. skills/ S3 · Procedural memoryGhostPaw grimoireProcedures that get better and keep their historyv0.7.4 · replaces skills/
  4. USER.md S4 · Social memoryGhostPaw affinityContacts instead of a user notev0.7.3 · replaces USER.md
  5. TODO.md S5 · Commitment memoryGhostPaw questlogQuests instead of a to‑do listv0.14.2 · replaces TODO.md
FIG. 7 Five files an agent keeps, five libraries that replace themVersions as of

Use GhostPaw codex, read it, or write to me

The site has the install lines for every platform and a console that replays a wrong fact in five moves; the repository has the code, the changelog and every test. It is a 0.x release, so test upgrades against a backup.

Open the siteCode on GitHubPackage on npm

I build products and MVPs and consult through Anonyfox e. K.; serious asks go to max@anonyfox.com. Write to me