# @ghostpaw/codex [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/GhostPawJS/codex  
**GitHub Stars:** 3  
**npm Downloads (last month):** 2466  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/ghostpaw-codex

## Description
Standalone belief and memory engine for Node.js — SQLite, zero dependencies, with a built-in LLM tool facade

## Tools
Capabilities this server exposes over MCP:

- **search_codex** — Search active beliefs by natural language query. Returns ranked matches with recall scores and transparency metadata.

Use when: Use this to find beliefs about a topic before acting on them. Always search before creating a new belief to avoid duplicates.
Not for: Do not use this for browsing all beliefs — use review_codex with the status or flags view instead.
- **review_codex** — Load a codex review surface: flags for beliefs needing attention, status for portfolio health, log for recent activity, trends for time-based patterns, or duplicates for nearby active pairs sharing a claim prefix (unprefixed claims pair together).

Use when: Use this when you need an overview of the codex state rather than a specific belief. Start with flags for maintenance, status for a dashboard, or log for recent changes.
Not for: Do not use this to find a specific belief by topic — use search_codex instead. Do not use this to inspect one belief deeply — use inspect_codex_item.
- **inspect_codex_item** — Inspect one belief in full detail: certainty, freshness, display strength (strong if certainty >= 0.7 or certainty >= 0.4 and freshness >= 0.7), integrityTier (strong if certainty >= 0.7), source, category, lineage chain, proximity to similar beliefs, and version diff when applicable.

Use when: Use this after finding a belief through search_codex or review_codex to understand it deeply before deciding whether to confirm, correct, or forget it.
Not for: Do not use this for bulk browsing — use review_codex for lists. Do not call this without a specific belief id.
- **remember_belief** — Capture a belief from a claim, source, and category. Reuses active normalized duplicates unless allowDuplicate is set, and detects nearby beliefs.

Use when: Use this when a new proposition should enter the codex. Always search first to check whether the belief already exists — prefer confirming or correcting an existing belief over creating a duplicate.
Not for: Do not use this to update an existing belief. Use revise_belief with the correct, confirm, or merge action instead.
- **revise_belief** — Revise an existing belief: confirm it still holds, correct it with a new claim, merge multiple beliefs into one, forget it from active recall, or defer its next flag review.

Use when: Use this after inspecting a belief to act on it. Choose the action that matches the situation: confirm for reinforcement, correct for changed understanding, merge for consolidation, forget for removal from active recall, defer for postponing review.
Not for: Do not use this to create a new belief — use remember_belief. Do not use this to permanently delete a belief — use retire_belief.
- **retire_belief** — WARNING: Hard-deletes the whole lineage (the belief and all its predecessors/successors) and cannot be undone. Use belief forget for soft removal that keeps lineage.

Use when: Use this only for privacy cleanup or hard erasure. The belief and all of its lineage (predecessors and successors) will be destroyed.
Not for: Do not use this for normal belief lifecycle — use revise_belief with the forget action to preserve the audit trail.
- **dismiss_proximity** — Record that two beliefs are not meaningfully related despite proximity detection. Uses exponential backoff — the pair will resurface less frequently with each dismissal.

Use when: Use this after inspecting two proximate beliefs and determining they are not duplicates or in conflict. The dismissal suppresses the pair in future proximity results.
Not for: Do not use this if the beliefs are genuinely related — instead use revise_belief to merge, correct, or forget one of them.
- **import_beliefs** — Import a JSON array or JSON Lines of beliefs atomically; report indexed ids or errors. Dry runs roll back and return provisional ids.

Use when: Use for batch capture of existing beliefs.
Not for: Use remember_belief for one belief and revise_belief for revisions.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "codex": {
    "command": "npx",
    "args": ["-y","@ghostpaw/codex","mcp"]
  }
}
```

## Documentation

## What @ghostpaw/codex does

@ghostpaw/codex manages agent memory as beliefs rather than undifferentiated notes. Each belief can include a claim, source, category, provenance, certainty, evidence counts, decay information, and a history of revisions. The local database uses SQLite, and the package has no runtime dependencies.

The project can be used as an MCP server, TypeScript library, command-line tool, or Agent Skill. These interfaces are generated around the same seven operations, so an agent can search existing knowledge before saving a new claim and can update an existing belief when information changes.

This makes the server suitable for local, evidence-backed memory in workflows where stale or weakly supported facts need visibility. It also supports deliberate cleanup, including permanent deletion and recording that two similar beliefs are intentionally different.

## How it works

The MCP entry point is `ghostpaw-codex mcp` for an installed binary or `npx -y @ghostpaw/codex mcp` in an npm-based environment. Clients communicate with it over stdio. Beliefs are stored in a SQLite database, using `~/.ghostpaw/codex.db` by default unless a database path is supplied through configuration or the command line.

Search combines SQLite FTS5 BM25 ranking with character-trigram similarity. This supports lexical recall while also identifying close textual matches. Review and inspection operations expose the condition of stored knowledge, including flags, trends, status information, belief metrics, related items, and lineage.

## Setup and configuration

The npm package and library require Node.js 24 or newer:

```sh
npm install -g @ghostpaw/codex
npx -y @ghostpaw/codex mcp
```

A release binary can also be installed for Linux, macOS, or Windows. The binary distribution includes its Node.js runtime. MCP clients configured for command-based servers can start `ghostpaw-codex mcp`; clients using npm can invoke the equivalent `npx` command.

Set `GHOSTPAW_CODEX_DB` to an absolute database path, or pass `--db <path>`, to choose a different location. In sandboxed OpenAI Codex CLI sessions, the database and its SQLite sidecar files must be inside a writable directory. The database can instead be made accessible by adding its parent directory to the sandbox writable roots.

## Tools and capabilities

- `search_codex` finds existing beliefs using full-text ranking and trigram similarity.
- `review_codex` reports memory dashboards such as flags, status, trends, and logs.
- `inspect_codex_item` returns a belief with its metrics, lineage, and nearby beliefs.
- `remember_belief` records a claim together with source, category, and provenance.
- `revise_belief` confirms, corrects, defers, forgets, or merges a belief.
- `retire_belief` permanently deletes a belief for privacy or cleanup.
- `dismiss_proximity` marks two similar beliefs as intentionally distinct.

## Limitations and notes

The server is local and file-backed, so database placement matters in restricted environments. SQLite may need access to `-wal` and `-shm` files alongside the main database. Linux release binaries require glibc 2.28 or newer; npm usage is the documented option for Alpine systems. Release installers verify downloaded archives against SHA256SUMS, and optional attestation verification is available through `GHOSTPAW_VERIFY=attestation`.

_Full upstream README: https://allmcps.com/mcp/ghostpaw-codex/readme_

