Skip to main content
Glama

ctxkit

Local-first memory + verification for AI agents. Runs fully offline. Zero login. Zero API spend. Zero dependencies.

Python 3.10+ MCP License: AGPL-3.0 Tests


The two problems every agent user hits

1. Your agent forgets everything. You tell Claude or Cursor something on Monday. On Tuesday it has no idea. The usual fix is a cloud memory service β€” which means shipping your project notes, client names, and internal decisions to someone else's server, behind a login, for a monthly fee.

2. Your agent lies with total confidence. A single model will state 3 Γ— 7 = 25, invent a URL, and tell you a deadline is "100% guaranteed." It never hesitates. You find out later.

ctxkit fixes both β€” on your own machine, with no network at all.


Related MCP server: Nexus RAG MCP Server

What you get

🧠 ctx_remember / ctx_recall β€” memory that survives restarts

Append-only JSONL on local disk, indexed with BM25 for instant retrieval. No embeddings, no vector database, no model download, no GPU, no account.

  • Works in a clean venv with zero pip dependencies

  • Handles Chinese/Japanese/Korean text (per-character tokenisation)

  • Crash-safe: a torn write never corrupts the store

  • You can cat ~/.ctxkit/memory.jsonl and read your own memory β€” it's just text

  • Deleting is real deleting: ctx_forget tombstones and compacts

πŸ” ctx_verify_text β€” catch bad output before it ships

Free, offline, pure stdlib. Recomputes everything a model asserted:

Check

Catches

arithmetic

250 * 4 = 900 β†’ reports computed 1000

percent

20% of 150 is 45 β†’ reports computed 30

date

"February 30, 2025", years >2 ahead

absolute_claims

100% guaranteed, never, risk-free, all users

url_format

malformed or suspicious links

Verdict is clean or suspicious, with every failure itemised.

πŸ”‘ ctx_license β€” tier, expiry and usage

Shows what you're on, when it expires, and how many consensus calls you've used this month. Everything verifies offline β€” paying customers are never locked out because a licence server is down.

🎯 ctx_consensus β€” multi-model cross-check (paid tier)

Ask the same question to several models, extract each one's key claims, and score their agreement. Disagreements are listed per model, so you see exactly where the models disagree instead of a vague "the AI might be wrong."

This measures agreement, not correctness. Three models can agree and all be wrong. It narrows where to look; it does not establish truth.

Requires CTXKIT_API_KEY + CTXKIT_API_BASE. Nowhere near as scary as it sounds β€” it's an OpenAI-compatible endpoint and works with any provider.

Pricing

Everything is free. Since 2026-11-03 there is no paywall.

ctx_consensus spends your API budget (you supply CTXKIT_API_KEY), not ours, so charging for it would be charging for nothing. The only limit is a local abuse guard to stop a runaway loop burning your API credit β€” you can raise or remove it with CTXKIT_CONSENSUS_FREE_QUOTA.

See PRICING.md for the full reasoning.

---|---|---| | ctx_remember / ctx_recall / ctx_forget | βœ… unlimited | βœ… | | ctx_verify_text | βœ… unlimited | βœ… | | ctx_stats / ctx_license | βœ… | βœ… | | ctx_consensus | β€” | 300/mo | | Bring your own model API key | β€” | βœ… | | Runtime dependencies | zero | pyjwt[crypto], httpx | | Support | community | best-effort, no SLA |

Not yet on sale. The paid tier exists in code but billing is not deployed and has not passed its deployment checklist. See ../AUDIT_REMEDIATION.md.

Memory and verification are free forever and unlimited. They cost nothing to run β€” no server, no model calls β€” so charging for them would be charging for nothing. The paid tier is the only part that spends real money on model API calls, which is exactly what it's priced against.


Install

pip install meshctx-ctxkit

That's it. No extras needed for memory and verification β€” zero dependencies.

Only if you want the paid ctx_consensus feature:

pip install 'meshctx-ctxkit[license]'   # licence verification
pip install 'meshctx-ctxkit[api]'       # consensus (also pulls httpx)

Verify it works:

meshctx-ctxkit add "Stripe key rotated 3 May; old key revoked" --tag ops
meshctx-ctxkit search "stripe"
meshctx-ctxkit verify "Cost is 250 * 4 = 900 hours and it is 100% guaranteed"

Add to Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "ctxkit": {
      "command": "meshctx-ctxkit",
      "args": ["serve"]
    }
  }
}

Restart Claude Desktop. You'll see seven tools appear.

Add to Cursor / Cline / Windsurf / Zed

Same idea β€” point the MCP server config at:

command: ctxkit
args: ["serve"]

Any MCP-capable client works. The server speaks protocol 2024-11-05 over stdio.


Try it in 60 seconds

You:    Remember that this client's invoice must go to billing@acme.example,
        never to the sales rep.

Claude: [calls ctx_remember] βœ“ stored locally

--- restart Claude Desktop, new conversation ---

You:    Where does the Acme invoice go?

Claude: [calls ctx_recall "acme invoice"]
        β†’ "invoice must go to billing@acme.example, never to the sales rep"
        It goes to billing@acme.example β€” not the sales rep.

No cloud. No login. No subscription. It just remembered.


Configuration

Variable

Default

Purpose

CTXKIT_HOME

~/.ctxkit

Where memory.jsonl lives

CTXKIT_API_KEY

(unset)

Enables ctx_consensus

CTXKIT_API_BASE

(unset)

OpenAI-compatible base URL

CTXKIT_MODELS

3 defaults

Comma-separated model list for consensus

CTXKIT_LICENSE

~/.ctxkit/license.key

Pro/Team licence token


CLI reference

meshctx-ctxkit add "text" [--tag t1 --tag t2]   store a memory
meshctx-ctxkit search "query" [--limit 5]        retrieve
meshctx-ctxkit stats                             count, tags, disk path
meshctx-ctxkit verify "text"                     offline sanity checks
meshctx-ctxkit license [--key TOKEN]             show tier, expiry, usage
meshctx-ctxkit serve                             run the MCP server

Short alias: `mctxkit` is identical.

How it compares

Cloud memory services

Vector-DB memory libs

ctxkit

Data stays on your disk

❌

βœ…

βœ…

Works with no network

❌

depends

βœ…

Needs an account/login

❌ usually yes

❌

βœ… no

pip dependencies

SDK required

heavy

0

Human-readable storage

❌

❌

βœ… JSONL

Built-in output verification

❌

❌

βœ…

Monthly cost

$10–30

free

free forever


Development

git clone https://github.com/LucyAndLuna2023/meshctx
cd meshctx
pip install -e ".[dev]"
PYTHONPATH=src pytest tests/ -q

60 tests: memory semantics, BM25 ranking, crash recovery, every verifier, consensus scoring, the full MCP protocol surface, and a real subprocess end-to-end session.


License

AGPL-3.0-or-later for open-source use. Commercial/enterprise licensing available β€” see LICENSE.

The commercial tiers are what fund the free one. Pricing, and a plain-English explanation of exactly what you get and don't, is in PRICING.md.


Honest limitations

  • Retrieval is lexical (BM25), not semantic. "car" won't find "automobile." This is the deliberate price of needing zero dependencies and zero downloads.

  • ctx_verify_text flags suspicion, it does not prove truth. Clean output can still be wrong; it just contains no machine-checkable arithmetic, date, or absolute-claim errors.

  • ctx_consensus measures agreement, not correctness. Three models can agree and all be wrong β€” especially on niche or recent facts. It's a smoke detector, not a fireproof wall.

  • Memory is local by design. There is no sync between machines. That's the point.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    A local, offline memory server for AI agents that stores and retrieves memories without LLM calls, enabling persistent cross-session memory with bi-temporal querying and auditable records.
    4
    430 PyPI
    10
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents with long-term memory and retrieval-augmented generation (RAG) capabilities, allowing them to recall past conversations, search local files, and learn user preferences.
    MIT
  • A
    license
    B
    quality
    A
    maintenance
    Enables AI agents to maintain a local, event-sourced long-term memory with semantic retrieval, decision confidence checks, and proactive recalls, ensuring data never leaves the machine.
    23
    3
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables agents to persist, search, and manage short- and long-term memories using local SQLite storage and offline embeddings, with tools for recall, update, confirmation, and consolidation without external services.
    10 npm
    MIT