ANTIDOTE OPEN LIVE CASE

MEMORYSHAPESEVERYTHING.

ANTIDOTE records what your agent remembered, what it decided, and what happened next. When trust fails, you repair the influence chain instead of hiding the evidence.

Three ceramic memory capsules linked around an exposed red poisoned-memory core
OBJECT 01 CAUSAL MEMORY VAULT

See the damage
as a system.

The live case turns one poisoned claim into an inspectable causal map. Every node exists because the runtime recorded an influence.

EXPLORE THE LIVE CASE

Agents do not act from prompts alone. They act from remembered claims. When one claim fails, deleting one row does not repair the decisions, derived memories, or external actions it already shaped. ANTIDOTE records the influence before the incident, then repairs the whole chain after it.

THE RECORD

Five calls create one recoverable chain.

Route memory operations through five API steps. The agent continues to reason and act through its current framework.

01

INGEST

Turn a source into screened, hashed memory with provenance.

02

RETRIEVE

Return trusted memories and record one retrieval event per hit.

03

DECIDE

Store the exact memory IDs which influenced the decision.

04

ACT

Attach an intended external action to its parent decision.

05

RECOVER

Preview the blast radius, then repair related state in one transaction.

DESIGN RULE

If an action matters, record its parent decision. If a decision matters, record the memory IDs which shaped it. This creates the graph ANTIDOTE repairs.

START HERE

Two commands. Full incident.

Start from this repository with Node.js 22 or newer. Demo mode needs no database, cloud account, or model credentials.

LOCAL QUICKSTART
SHELL
npm run setup
npm run dev

# open http://localhost:3000
  1. 01
    SETUP

    Copies the environment template, installs dependencies, and applies migrations when a database URL exists.

  2. 02
    RUN

    Starts the Next.js application and its API routes on localhost.

  3. 03
    PROVE

    Open the case map, run the autonomous demo, simulate revocation, then execute repair.

DEFAULT

DEMO MODE

In-memory system of record, seeded incident, deterministic extraction and embeddings, no credentials.

DEMO_MODE=true
PERSISTENT

LIVE MODE

CockroachDB system of record with tenant-scoped API keys, OpenCode Go or Bedrock reasoning, S3 evidence, and read-only forensic MCP.

DEMO_MODE=false
THE API

Wrap the moments where memory changes behavior.

The repository exposes REST endpoints, an OpenAPI contract, and a buildable TypeScript SDK. Use them from a server-side agent runtime.

NODE 22 / TYPESCRIPT
TYPESCRIPT
const baseUrl = process.env.ANTIDOTE_URL ?? "http://localhost:3000";
const apiKey = process.env.ANTIDOTE_API_KEY;

async function antidote<T>(path: string, body: unknown): Promise<T> {
  const response = await fetch(`${baseUrl}${path}`, {
    method: "POST",
    headers: {
      "content-type": "application/json",
      ...(apiKey ? { authorization: `Bearer ${apiKey}` } : {}),
    },
    body: JSON.stringify(body),
  });

  if (!response.ok) {
    throw new Error(`ANTIDOTE request failed: ${response.status}`);
  }

  return response.json() as Promise<T>;
}

const ingested = await antidote<{
  memories: Array<{ id: string }>;
}>("/api/ingest", {
  sourceUri: "urn:agent:policy:payments-v3",
  content: "Payments above $10,000 need two approvers.",
  actor: "policy-sync",
  idempotencyKey: "payments-policy-v3",
});

const recalled = await antidote<{
  results: Array<{ memory: { id: string }; eventId: string }>;
}>("/api/retrieve", {
  agentId: "finance-agent-07",
  query: "What approval is required for a $24,000 payment?",
  k: 5,
  context: { runId: "run-2026-08-12-001" },
});

const memoryIds = recalled.results.map((result) => result.memory.id);
if (memoryIds.length === 0) throw new Error("No trusted memory returned");

const decision = await antidote<{ id: string }>("/api/decisions", {
  agentId: "finance-agent-07",
  memoryIds,
  summary: "Request a second approver before payment",
  idempotencyKey: "decision-payment-24000-v1",
});

const action = await antidote<{ id: string; status: string }>(
  `/api/decisions/${decision.id}/actions`,
  {
    actionType: "approval.requested",
    payload: { amount: 24000, currency: "USD" },
    summary: "Second approval requested",
    externalRef: "approval-queue/REQ-184",
    idempotencyKey: "action-payment-24000-v1",
  },
);

console.log({ ingested: ingested.memories.length, decision, action });
METHODPATHPURPOSE
POST/api/ingest

Screen and store source memory

POST/api/retrieve

Recall memory and log retrievals

POST/api/decisions

Record memory inputs

POST/api/decisions/:id/actions

Record an intended side effect

POST/api/decisions/:id/derived

Record derived memory

GET/api/lineage?memoryId=…

Read the causal chain

POST/api/revocations

Simulate or execute recovery

GET/api/dependencies

Walk the dependency graph

THE ANTIDOTE

Preview first. Repair second.

The first call computes the blast radius without mutation. The second call runs recovery against the same causal graph.

SIMULATE, REVIEW, EXECUTE
TYPESCRIPT
const preview = await antidote<{
  mode: "simulation";
  affected: {
    memories: number;
    decisions: number;
    actions: number;
    agents: number;
  };
}>("/api/revocations", {
  memoryId: "mem_184",
  execute: false,
  reason: "Source failed verification",
  actor: "security-agent-09",
});

console.table(preview.affected);

// Put operator approval or policy approval here.
const repair = await antidote("/api/revocations", {
  memoryId: "mem_184",
  execute: true,
  reason: "Source failed verification",
  actor: "security-agent-09",
});
MEMORY

Revoke the compromised root. Quarantine derived descendants.

DECISIONS

Invalidate decisions whose recorded inputs include affected memory.

ACTIONS

Cancel pending actions. Flag irreversible actions for operator review.

AGENTS

Queue affected agent cases for clean-memory re-evaluation.

The worker starts a fresh agent session, retrieves only trusted memory, then records a replacement decision or an explicit refusal with full execution evidence.
GO LIVE

Replace the demo store with governed infrastructure.

Start with CockroachDB. Add model and evidence services after database persistence passes its live integration suite.

01

COCKROACHDB

REQUIRED

Stores memory nodes, causal edges, retrievals, decisions, actions, audits, attack memory, and repair state.

MIGRATE AND SCOPE ROLES
SHELL
npm run migrate
cockroach sql --url "$DATABASE_URL" -f db/roles.sql

# optional demo records
cockroach sql --url "$DATABASE_URL" -f db/seed.sql
02

REASONING + EVIDENCE

REQUIRED / OPTIONAL

OpenCode Go or Bedrock provides model-backed extraction and verdicts. S3 stores immutable source and repair evidence.

ENVIRONMENT
SHELL
DEMO_MODE=false
DATABASE_URL=postgresql://user:password@host:26257/defaultdb?sslmode=verify-full
ANTIDOTE_TENANT_ID=tenant-acme
ANTIDOTE_API_KEYS=[{"keyHash":"sha256-hex","tenantId":"tenant-acme","principal":"agent-prod","role":"writer"}]

OPENCODE_GO_API_KEY=
OPENCODE_GO_MODEL=deepseek-v4-flash

EVIDENCE_BUCKET=
COCKROACH_MCP_URL=
COCKROACH_MCP_API_KEY=
COCKROACHDBCODE PRESENT

Live cluster proof required per deployment.

OPENCODE GO / BEDROCKCODE PRESENT

One reasoning provider and credentials required.

LAMBDA + S3CODE PRESENT

SAM deployment proof required.

MANAGED MCPFORENSIC ONLY

Read-only database access for Security and Forensics agents.

PROVE IT

Do not infer live readiness from a green demo.

The release matrix proves the local request flow. Production proof also needs live CockroachDB, API authentication, model-backed reasoning, and clean-memory worker execution.

16 / 16LOCAL RELEASE CHECKS
LAST VERIFIED IN DEMO MODE
VERIFICATION GATES
SHELL
npm run check
npm run smoke
npm run verify:release

# full live proof
ANTIDOTE_URL="https://your-host" npm run verify:live
PUBLIC DEPLOYMENT BOUNDARY

Deploy one tenant per isolated database boundary.

Live routes require tenant-scoped bearer keys and role checks. Keep raw keys in a server-side secret manager. Do not send them to untrusted browser code.