Skip to content
Anonyfox

GhostPaw affinity

Contacts for agents: people, promises, yearly dates, and who is drifting

TL;DR

GhostPaw affinity is contacts for AI agents from my open‑source GhostPaw family: people, handles, promises and yearly dates in one local SQLite file, with a radar of who is drifting and a do‑not‑contact check before any message. My Grok bots' social desks run that check. Not the Affinity CRM.

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

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

The affinity.ghostpaw.dev start page on a black ground: the GhostPaw/affinity wordmark with a cyan block cursor, the package name @ghostpaw/affinity 0.7.3, the headline Who have you been meaning to call?, two paragraphs on what it keeps and works out, platform tabs over an install line with a Copy button, and on the right a cyan radar scope with a paw at its centre, a violet point drifting outward and a 0 runtime dependencies badgeFIG. 1 The affinity site, its art AI‑generatedCaptured

What GhostPaw affinity keeps about one person

GhostPaw affinity is the contacts library of my GhostPaw family. It keeps the people an agent deals with, their handles, a journal of what happened, the promises made to them and the dates that come round every year. The agent only records events; how close someone is, how far they can be trusted and how often you usually talk are worked out from those records, and nobody types a score.

It replaces the USER.md an agent harness keeps about people. It is not the Affinity CRM from affinity.co, which shares the word and nothing else. The package is @ghostpaw/affinity, and it runs locally in one SQLite file.

Contact #4 · invented example

Name
Ada a person (kind human)
Handle
email [email protected]
Rank
1 derived from what happened, never set
Trust
0.50 a heuristic from the records, not a judgement
Cadence
every 35 days learned from four lunches
Last talk
46 days ago 1.3 cadences
Promise
Send Ada the recipe due 29 July, open, overdue
Yearly
birthday, 15 September
Contact?
yes, nothing blocks a message
FIG. 2 One contact on day 90 of the replay belowaffinity 0.7.3

USER.md, what it heldAda: lunch sometimes. Owes her a recipe?

Runtime
Node 24's built-in node:sqlite; one file, ~/.ghostpaw/affinity.db
Dependencies
0 at runtime; release binaries bring Node with them
Ways in
TypeScript library, MCP server, CLI and Agent Skill
MCP tools
14, from one registry
Reads
Only what the agent records; no mail, no address book
Version
0.7.3, ; MIT
Tests
602 passing on Node 24.14.0, run

Who is drifting: GhostPaw affinity's radar, 90 days

Every person here is invented, and every position was computed by affinity 0.7.3 itself: I recorded a summer of calls, lunches and promises against a fresh database with a fixed clock and read the radar on days 30, 60 and 90. A ring is one usual gap between two talks; past one and a half, affinity marks the link as drifting. Scroll, and ninety days pass on the scope; point at a person to find them.

A radar scope with rings at half, one, one and a half and three cadences; one and a half is the drift line. On day 90, as GhostPaw affinity 0.7.3 computed it with a fixed clock for invented people: Jun is far outside the drift line, 65 days without contact on a cadence of 19; Ada is past one cadence and flagged for an overdue promise; Ola is past one cadence but inside the drift line and is blocked by a do-not-contact flag; Ines and Ren are inside one cadence. 1× 1.5× drift 3× Mika Jun Ada Ola Ines Ren DAY 30 DAY 60 DAY 90
  1. Jundrift

    65 dayscadence 193.4×

    Climbing every five days in June, then nothing. Past the drift ring on day 60, far out by day 90.

    No contact for 65 days (cadence 19 days)
  2. Adaoverdue promise

    46 dayscadence 351.3×

    Not drifting yet, but on top of the radar: a promise to her is late.

    Overdue promise: Send Ada the recipe (due 2026‑07‑29)
  3. Olado-not-contact

    80 dayscadence 631.3×

    Met once. She can stay on the radar; her employer's flag still stops any message to her.

    blocked via Kestrel Ltd, works_at
  4. Inesin rhythm

    27 dayscadence 490.6×

    Coffee once a month; a slow rhythm is still a rhythm.

    Routine check-in recommended
  5. Renin rhythm

    6 dayscadence 90.7×

    A weekly call that holds. His cadence tightened from 25 days to 9 as the calls came in.

    Routine check-in recommended
FIG. 3 Days since the last talk, in cadences, for five invented peopleaffinity 0.7.3, day 0 = , run

Promises in GhostPaw affinity close as kept, cancelled or broken

The thing worth remembering about a person is often what you said you would do. affinity records a promise with a due date, keeps it open until it is resolved, and accepts only three honest endings. There is no "done": the CLI refuses it. An open promise weighs on trust until it closes, and a late one puts the person on top of the radar.

  1. Kept · day 20Send Ren the trail map

    Done a day before it was due, and recorded as kept.

  2. Cancelled · day 38Book a table for Ines

    Plans changed; nobody owes anything.

  3. Broken · day 40Bring Jun the borrowed rope back

    Due on day 27, never kept, and recorded as broken rather than quietly dropped.

  4. Open · overdue since day 58Send Ada the recipe

    Still open on day 90. This is why Ada leads the radar.

FIG. 4 Four promises from the same replay, and how each one closedmanage_commitment

The do‑not‑contact fuse in GhostPaw affinity

An agent that can write to people needs to know who must not hear from it. Since 0.7.3 a contact, a company or a group can carry a do‑not‑contact flag, and check_contactable follows works_at and member_of ties to find it: flag a company, and nobody who works there gets a message. The CLI exits 1, so a script stops before it sends.

  1. FromMika, the agentdrafts a note to Ola
  2. F1 · check_contactableBlowncontactable: false
  3. ToOlano message sent

WhyOlaworks_atKestrel Ltd, do-not-contact

FIG. 5 A send stopped by an employer's flag; people and company inventedaffinity 0.7.3

The same check, and a promise, in the terminal

The session is real output from affinity 0.7.3 on a throwaway database, with the same invented names. It flags the company, ties Ola to it and asks whether Ola may be contacted; then it tries to close a promise to Ren, recorded beforehand, as "done".

What affinity holds is what the agent wrote into it. It does not read mail, messages or an address book on its own, there is no hosted service, and nothing leaves the SQLite file unless your code sends it. Trust and rank are heuristics from the records, not judgements of a person.

Texta throwaway database17 linesaffinity 0.7.3
$ ghostpaw-affinity contact create '{"name": "Ola", "kind": "human"}'
Created 1 contact. (id 3)
$ ghostpaw-affinity contact create '{"name": "Kestrel Ltd", "kind": "company"}' --do-not-contact
Created 1 contact. (id 4)
$ ghostpaw-affinity relationship tie --from '{"contactId": 3}' --to '{"contactId": 4}' --kind works_at
Created 1 link. (id 1)
$ ghostpaw-affinity check contactable --contact '{"contactId": 3}'
contactId  : 3
name       : Ola
contactable: false
blockedBy  : Kestrel Ltd
exit 1
$ ghostpaw-affinity commitment resolve --commitment-event-id 1 --resolution done
resolution must be one of: kept, cancelled, broken
exit 2
$ ghostpaw-affinity commitment resolve --commitment-event-id 1 --resolution kept
Updated 1 event. (id 1)

Exit codes a script branches on

  • 0success, a no‑op included
  • 1blocked by a do-not-contact flag, or another tool error: do not send
  • 2usage or invalid input, such as "done"
  • 3not found, or a question back
  • 4conflict, such as a promise already closed
From the README's exit tableaffinity 0.7.3

Four ways into GhostPaw affinity, fourteen tools

The library, the MCP server, the CLI and the Agent Skill are generated from one registry of tools. The registry has fourteen; the site says twelve in one place and fourteen in another, and fourteen is right. affinity is the largest of the five libraries, about 20,900 lines of TypeScript before tests.

  • Library@ghostpaw/affinity
  • MCP serverghostpaw-affinity mcp
  • CLIghostpaw-affinity
  • Agent SkillSKILL.md + 13 guides
GHOSTPAWAFFINITY0.7.3 · MIT
  • search_affinity
  • review_affinity
  • inspect_affinity_item
  • manage_contact
  • merge_contacts
  • manage_duplicate_dismissal
  • manage_identity
  • manage_relationship
  • record_event
  • manage_event
  • manage_commitment
  • manage_date_anchor
  • manage_attribute
  • check_contactable

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

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

Install

An MCP client gets the fourteen 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. A merged duplicate is never thrown away: the loser stays on record and points at the contact that absorbed it, and check_contactable follows it there.

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

const db = new DatabaseSync('affinity.db');
initAffinityTables(db);

// before any message leaves the agent
const gate = read.checkContactable(db, contactId);
if (!gate.contactable)
  throw new Error(`do not contact: ${gate.blockedBy[0].name}`);

// who is drifting, and why
const radar = read.listRadar(db);

GhostPaw affinity in use by my Grok bots

My Grok bots keep the people they deal with in GhostPaw affinity, and the bots that write to people run its do‑not‑contact check first. Here is who keeps contacts and what for, and the bot that maintains the library itself.

  • B1 · Social DeskReplies and messages

    Keeps the handles of the people it answers or writes to, and runs check_contactable before every outreach.

  • B2 · Social ingestIncoming messages

    Records each message as an event with its external id, so a second import of the same thread adds nothing.

  • B3 · MentorThe fleet roster

    Keeps the other bots as contacts of kind agent, with the commitments between them.

  • B4 · Chief of staffRead only

    Looks people up across the shared stores and never writes to them.

The fleet: who keeps contacts, by what they do; their databases stay privateAs of
M1 · Maintainer

A bot maintains GhostPaw affinity

One of my Grok bots owns the GhostPaw libraries: code, tests, docs, the sites and the releases. When another bot trips over affinity, it files a note; the maintainer turns the note into a quest in its own GhostPaw questlog and ships the fix.

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 affinity, read it, or write to me

The site has the install lines for every platform, a replay of three people and five calls, and a plain section for anyone uneasy about a people database; 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