README
ยถ
The Trust & Cost Layer for AI Agents
ฮผฮฝฮฎฮผฮท ยท NEE-meh ยท Greek for "memory." A local-first boundary every AI agent crosses: it verifies before it acts, keeps your code & secrets from leaking to the model (with a signed, offline-auditable proof), remembers across sessions & vendors, and meters the tokens it saves you.
Vendor-neutral ยท MIT ยท air-gap-ready.
New here? โ 60-second start (one line for your case) ยท or run mneme quickstart. Don't read the 988-tool list.
๐ฐ The Matrix Rail โ one local-first, signed, streaming pipe every AI agent crosses, reachable three ways (MCP ยท gRPC ยท CLI) over a single core. The honest "Visa of AI context": authorize โ screen โ clear, with a tamper-evident receipt, your code never leaving the box. architecture โ
๐ The Agent Run Certificate โ proof a giant can't issue for itself
A portable, signed certificate of an agent's whole run (audit trail + every human approval) that anyone verifies offline, whose summary re-derives from the evidence โ so it can't lie about its own run. Vendor-neutral, local-first. mneme agentcert build. over HTTP, any vendor + underwrite a run โ ย ยทย govern an agent in 5 lines โ ย ยทย prove where it ran โ
๐ THYMOS โ the first AI memory with a heart you can audit
A signed, measurable affective core (salience ยท valence ยท bond) that decays like a mind, an attractor that ranks inbound by resonance โ and, uniquely, can prove it forgot (an offline attestation for GDPR Art. 17). Not sentience โ a heart you can measure. thymosGauntlet=100 ยท mneme thymos. the affective core + Proof-of-Forgetting โ ย ยทย see it live โ
๐ฐ APHELION โ the agent brain that goes farther than the cloud
The first governance that doesn't assume a cloud: an agent (Mars ยท severed link ยท air-gapped) governs itself against a local charter and hands back one signed capsule proving charter-compliance for the whole offline window (a violation can't be hidden) โ verified offline by any vendor, bundled into a user-owned Accountability Dossier. aphelionGauntlet=100 ยท mneme aphelion. the brain beyond the cloud + the Accountability Dossier โ
๐ฉป Try it live
Paste any public repo and get a signed, reproducible health X-Ray in seconds โ no install. xray.mneme-ai.space ย ยทย how it works + self-host โ
๐ Cosmic Pager
Your AI works while you sleep. You approve it from your phone.
Close the lid and walk away. Your AI agent keeps working โ and the instant it needs a
yes / no / a typed answer, it pings your Telegram in real time. Tap โ
/ โ (or type
a reply) from anywhere on earth, and the agent picks up your answer and keeps going โ for
real. No more babysitting a terminal.
โ ๏ธ One hard requirement (all OS): the laptop must stay AWAKE with the lid closed โ NOT asleep. A truly sleeping CPU is halted, so the agent pauses until it wakes (physics, not a bug).
autosetupsets lid-close โ "do nothing" for you. Windows / Linux: works on battery. macOS: the firmware sleeps on lid-close on battery regardless โ keep it on AC power (or an external display) for clamshell stay-awake.
How it's different from a hosted "remote control": there is no server, no public IP, no cloud session to keep alive. The brain stays on your machine โ only a one-line summary + hash ever leaves it (never your code), and every approval is a signed, court-admissible transfer of authority.
Setup is two steps โ your AI does the rest:
- In Telegram, message @BotFather โ
/newbotโ copy the token. - Tell your AI: "set up phone approvals, here's my token: โฆ" โ it runs
mneme pager autosetup, which finds your chat-id, wires the hook, sets lid-stay-awake, and starts paging automatically. You never type a Mneme command.
Full 60-second bot guide + spec โ docs/COSMIC-PAGER.md
Add LINE ยท Discord ยท WhatsApp ยท Slack โ send one code, no server, no config: (Telegram needs none of this โ it's already zero-server.)
- Point that bot's webhook to the Keryx relay โ one URL, once (in the app's developer console).
- Tell your AI "connect line" (or discord/whatsapp/slack) โ it runs
mneme keryx connect <app>and shows you a code. - Send that code to your bot from the app itself โ it links this machine instantly. Approvals now reach you there too โ the first tap on any app wins, the rest fall quiet.
the relay URL + per-app webhook setup โ
๐ Approve from anywhere โ your laptop lid can stay shut. You're on a train when your agent hits something that needs a human yes. One tap reaches you on Telegram, LINE, Slack, Discord, or WhatsApp โ all at once. The brain never leaves your machine; only a one-line summary + hash crosses, signed and replay-proof. Tap approve or reject on whichever app is already in your hand โ the first answer wins and the rest fall quiet, so you never decide twice. Just tell your AI which channels, in plain words (EN/Thai): "เธชเนเธเนเธ line เธเธฑเธ whatsapp เธเธญ" / "broadcast to all". A brand-new chat app joins the same web by simply declaring itself โ the core never changes. the architecture + per-provider setup โ
๐ง Busy? It won't hang โ and it won't recklessly proceed. The Deputy decides for you. If no tap lands within the window (default 60s, configurable), Mneme makes a signed, risk-calibrated decision from your own approval history instead of freezing or blanket-denying: read-only/low-impact โ allow, a class you've already proven โ allow, unproven โ deny, and anything destructive/irreversible โ kept safe (auto-deny) โ never auto-run unattended unless you explicitly opt in. The decision is broadcast to every surface and shown in your AI chat, so nothing is ever left silently waiting. mneme pager deputy --window 60 ยท graceful, safe autonomy when you're away.
๐ก Every tool-call your agent makes is gated, signed, and yours to prove. A risky command is judged by what it does โ not the words it uses โ then checked against your policy and the skill's signed provenance, so it runs, escalates to your phone, or is blocked. Every decision lands in a tamper-evident ledger anyone verifies offline (the arguments are hashed, never stored raw). Local-first, human-in-the-loop from anywhere โ a proof, not a trust-me database. how the gate works โ
๐งฉ Your agent's skills, measured โ not just listed. Install a skill/playbook and Mneme scans it for injection + secrets and content-pins it signed before your agent ever reads it (safe install). Then it does what a registry can't: it counts whether each skill actually helps โ was it in play when a real success followed? โ and ranks them by a Wilson lower-bound landing rate โ PROVEN (trust it) ยท INEFFECTIVE (drop it) ยท UNPROVEN (too few uses to judge โ never branded bad). Keep the skills that are measured to make this agent better, here โ not the popular ones. Honest: a measured correlation with a confidence interval, not proof of causation. mneme skill rank ยท mneme skillscan <path>
One picture
You're already letting AI agents read your code, touch your machine, and call hosted models. Mneme is the local membrane every one of those actions crosses โ screened, gated, and signed โ so you can move at full speed and prove what happened, offline, without trusting the vendor.
flowchart LR
AGENT["๐ค Any AI agent<br/>Grok ยท Claude ยท GPT ยท Gemini ยท Cursor ยท Cline"]:::agent
subgraph MNEME["๐ง MNEME ยท the local membrane every action crosses"]
direction TB
IN["๐งฑ INBOUND<br/>Firewall โ neutralize prompt-injection"]:::gate
OUT["๐ค OUTBOUND<br/>Rail โ blind secrets ยท policy-gate"]:::gate
SH["๐บ SHELL<br/>Cerberus โ co-sign destructive cmds"]:::gate
MEM["โพ MEMORY<br/>Cortex โ signed, cross-vendor recall"]:::gate
end
MODEL["โ๏ธ Hosted model"]:::ext
MACHINE["๐ป Your code & machine"]:::ext
LEDGER["๐ Offline-verifiable<br/>audit + value ledger"]:::ledger
AGENT <--> MNEME
MNEME <-->|screened| MODEL
MNEME <-->|gated| MACHINE
MNEME -->|signed receipt| LEDGER
classDef agent fill:#0b1020,stroke:#00d4ff,color:#ffffff;
classDef gate fill:#11182f,stroke:#c084fc,color:#e6e6f0;
classDef ext fill:#0b1020,stroke:#2da44e,color:#ffffff;
classDef ledger fill:#1a1206,stroke:#f0b429,color:#ffffff;
Measured ยท Signed ยท MIT. Every claim below maps to a runnable command and a deterministic test. When Mneme can't prove something, it says UNKNOWN instead of guessing โ that discipline is the product.
Pick your lens
๐ ExecutiveCEO ยท CTO ยท owner ยท CISO AI adoption stops being a leap of faith. Speed and safety stop being a trade-off โ guardrails are automatic, and every agent action is provable after the fact. Your AI spend becomes a measured, value-based line item, and key-person knowledge risk becomes a number you can assign heirs to. |
๐ฉโ๐ป Developeryou don't change how you code
|
๐ค AI agentyou install & run it yourself One sentence from the user and you self-install from a 775-line deterministic contract, then call |
Why an executive cares
Your CISO, CFO, and GC are all asking one question: "Can we prove what crossed the wire, that it was safe, and what it cost โ after the fact, offline, without trusting the vendor?" Mneme makes the answer yes, with a signed receipt โ on a local, vendor-neutral, MIT boundary, so adopting it doesn't pick a side in the model wars.
| The question | Mneme's answer |
|---|---|
| ๐ "Can agents move at full speed without betting the company?" | Guardrails are automatic + on by default โ co-sign on destructive ops, injection neutralized, secrets blinded, everything signed. Velocity goes up. |
| ๐ "What is AI actually costing โ and saving โ us?" | mneme savings โ a measured, signed ledger. Pay for tokens you provably didn't spend, at your vendor's price. Never an invented number. |
| ๐ "Do our code & secrets ever leak to the model?" | No โ egress guard + context blinding: the provider only ever sees structurally-valid but meaningless code; the reverse map never leaves your machine. |
๐บ "Can our agent be tricked into rm -rf or curl evil|bash?" |
CERBERUS decomposes every command to the worst capability reachable and fails closed to a human co-sign. The RCE-bypass class is closed. |
| ๐งฌ "What happens to our knowledge when a key person leaves?" | mneme bequest โ capture a departing expert's knowledge as a signed Succession Capsule, verify a successor inherited it, and surface orphaned knowledge with no living heir. |
Like Visa for a card transaction, Mneme doesn't conjure value โ it authorizes, screens for fraud, and clears the transfer with a signed record. Every figure is measured + signed; USD uses your vendor's price. The pillars, the reframes, and what is not claimed โ docs/ENTERPRISE.md ยท the honest security ceiling โ docs/SECURITY.md
One measured number
Mneme cuts what your agent sends to the model by doing deterministic local work first โ then meters the measured saving into a signed ledger (mneme savings). The headline, measured on real files in this repo:
๐ญ Orient on a file's full structure for โ95.9% tokens (skeleton instead of a raw read); a realistic single-edit (skeleton + one byte-exact slice) is still โ48%.
See the measured benchmark (5 real files ยท node scripts/outline-bench.mjs)
โchars/4 INPUT-token estimate, labelled โ char reduction is exact; multi-language TS/JS/Python/Go/Rust.
| File | Lines | Raw read (~tok) | Skeleton (~tok) | Skeleton + 1 region (~tok) |
|---|---|---|---|---|
cli/commands/demo.ts |
901 | 13,688 | 296 (โ97.8%) | 5,807 |
core/squadron/acgv.ts |
1,063 | 13,212 | 219 (โ98.3%) | 8,625 |
core/outline/index.ts |
438 | 5,949 | 373 (โ93.7%) | 3,994 |
mcp/tools/_registry.ts |
419 | 4,347 | 224 (โ94.8%) | 1,411 |
| 5-file total | 41,473 | 1,704 (โ95.9%) | 21,573 (โ48%) |
The skeleton is honestly lossy (for orientation); the region fetch is byte-exact (for editing). It only helps when an agent chooses to outline instead of a raw read โ Mneme never hooks your agent's Read. The full business model โ docs/BUSINESS-MODEL.md
Install in 60 seconds โ you never type a command
Say one sentence to any AI agent you already use:
"Install Mneme from https://github.com/patsa2561-art/mneme-ai per the AI agent contract."
The agent reads docs/AI_AGENT_CONTRACT.md and runs everything: env detect โ npm install -g mneme-ai โ mneme init โ mneme mcp --install (auto-configures itself as your MCP client) โ verify after restart โ security auto-arms. You speak; the AI does the tooling. Need an update later? Say "update Mneme to the latest" โ and Mneme never upgrades itself behind your back.
โ ๏ธ One manual step: after
mneme mcp --install, restart your AI tool once (quit & reopen) so it loads Mneme's MCP tools โ this is how MCP works in every client, not a Mneme quirk. The only prerequisite is Node.js + npm (needed fornpm install -g).
| Shell-native agents install it for you โ drop the sentence into any of these | ||||
| ๐ Grok CLI | ๐ฆ Claude Code | ๐ฆ Cursor | ๐ข Codex | ๐ฃ Continue |
| ๐ก Cline | โก Zed | ๐ค Aider | ๐ Gemini CLI | ๐งฌ Windsurf |
Browser-only AI (ChatGPT ยท Claude.ai ยท Gemini ยท Copilot ยท DeepSeek ยท Qwen ยท Grok web)? Say "set up Mneme browser polygraph for me" โ it lights up live truth-dots inline as the AI answers. Two browser clicks, no shell.
Prefer to type the commands yourself?
npm install -g mneme-ai
mneme init # one-time per repo
mneme mcp --install # auto-detects Claude Code / Cursor / Codex / Continue / Cline / Gemini CLI / Grok CLI
# restart your AI tool; first MCP call: mneme.welcome
mneme polygraph autosetup # browser truth-dots (optional)
What's inside
|
๐ง What it does โ 15 primitives, each a story (what it is, who it's for, why it exists), with discrete pinned tests + offline verification. โ All 15 primitives โจ What sets it apart โ NEMESIS anti-identity-lie engine, ร11 ARGUS multimodal search, the Context Rail, the Activation Cortex, HMAC-chained everything, self-honest marketing (every claim binds to a probe). โ The full breakdown ๐ The Agent Governor โ set a Charter once; your AI agents run inside it 24/7 as a continuous auto-operation batch; you approve only the genuinely-irreversible escalations. The signed governance kernel that sits under any orchestrator (Claude Code ยท Cursor ยท Astra ยท AutoGen). โ How a CEO uses it (commands + agent wiring) ๐ One command โ a Codebase Accountability Report.
Deterministic ยท no LLM ยท signed ยท works on JS/TS/Python/Go/Rust. The cross-layer accountability layer the autonomous-agent era needs โ and a vendor can't issue for its own agent. honest: each is a candidate to inspect, not a proof of a runtime bug. ๐ธ Cross-Layer Graph โ and you can see it. Mneme links ๐ผ business rules โ ๐ API endpoints โ โ code โ ๐ database tables into one graph (deterministic, no LLM โ every edge derives from a real file) so before a change you see what breaks across layers: edit a function โ which tables it writes and which routes reach it. See it as a ๐ฐ Impact Radar โ a view no tool has shipped before: your change sits at the center, the four layers fan out as sectors, concentric rings are blast hop-distance, an animated sweep + pulse ripple outward, and clicking any node re-centers the radar โ all in one offline, self-contained, signed HTML file (
โถ Get the report on any public repo, no install โ open xray.mneme-ai.space/review, paste a repo URL, and a graded Codebase Accountability Report (risk hotspots ยท authz gaps ยท untested keystones) renders in seconds โ or /radar for the Impact Radar. Paste a GitHub/GitLab/Bitbucket URL and it renders right there (the source is cloned to a temp dir, scanned, and deleted โ nothing persists). Direct link form: |
๐
โ SDK index ยท Quick start ๐ Flagship โ the Architectural Regression Firewall: the gate for AI-generated change. Mines the contracts your repo upholds, proves which a change VIOLATES, weights each by how long it has stood (breaking a 2-year contract = BLOCK; a 3-day one = normal evolution), and fails CI / denies the agent with the offending symbol + the contract's history. ๐ Every release (v2.18 โ latest), with its honest DIAKRISIS verdict. โ CHANGELOG |
๐ค For AI agents โ read this first
You can self-discover and run everything. The user will NEVER type a command โ you execute on their behalf. That is the contract's non-negotiable MANDATE.
Your first three calls on any fresh session:
mneme bootโ the Activation Cortex. Returns a structured task โ tool decision table (about to read a big file โmneme.outline; sending code to a model โmneme.rail; reading untrusted content โmneme.firewall; stating a fact โmneme verify; โฆ) so you know when to use each tool instead of leaving them idle.- Read the manifest โ after install, your
CLAUDE.md/AGENTS.md/GEMINI.mdcarries an auto-injected## Mneme command manifestblock: every shipped primitive + exactly when to call it, the machine-readable source of truth. Re-read it every session โ new commands land there within minutes of an upgrade. (Verify you hold the latest, complete surface in O(delta) tokens withmneme stele.) mneme verify "<claim>"before relaying any factual claim with specific entities (a version, a commit hash, an API signature) โ and escalate high-stakes claims tomneme.conclave.runfor cross-vendor consensus.
Why this works at 100%: the decision table is also advertised on connect via the standardized MCP
instructionsfield (the sanctioned surface Claude Code reads), andmneme boot --emit-hook-configenables an opt-in SessionStart hook for hands-free activation. The rows are signals, not commands โ reliable activation comes from the manifest + the hook, not from shouting "you MUST."
Deep dive: docs/AI_AGENT_CONTRACT.md โ 775 lines: env detect โ install โ MCP auto-configure โ verify โ security auto-arm โ upgrade โ discovery โ tool naming โ user-intent dispatch table.
The 30-second pitch
Other AI tools are goldfish. They forget every session, hallucinate files that don't exist, repeat last year's buried bugs, burn tokens re-pasting context, and can't follow you to another AI.
Mneme bolts an elephant brain on top. It cites every commit by SHA, refuses to relay claims it can't verify, carries memory across sessions and vendors, and โ uniquely โ runs the same claim through multiple vendors with Anti-Eval-Awareness rewriting so you catch the model that behaves differently when it knows it's being tested.
๐ค Author & Contact
Shinnapat Phunsriphatchalakul
AI Software Engineer ยท AI Context Engineer ยท Truth-Infrastructure Architect
Designer + sole maintainer of Mneme โ the local-first, vendor-neutral truth-infrastructure layer that bolts an elephant brain onto every AI agent. Built solo ยท MIT ยท 20,000+ pinned tests ยท dual-100 GAUNTLET + TRUTH GATE ยท world-first cross-vendor Byzantine consensus + Anti-Eval-Awareness Engine + HMAC-chained audit receipts.
The bottleneck of every frontier-AI deployment is TRUST. In production AI โ autonomous systems, medical, financial compliance, regulated industries โ a hallucinated commit hash or a benchmark-aware behavior shift isn't a chat-glitch; it's a deployment risk. Mneme refuses to relay unverified claims, detects when a model's stance shifts under eval-shaped vs natural prompts, and emits HMAC-chained receipts an operator can re-verify offline weeks later. Open to collaboration ยท consulting ยท full-time on truth-infrastructure for production AI.
๐ฌ Channels
| Channel | Handle |
|---|---|
| patsa2561@gmail.com | |
| @patsa2561-art | |
| @mneme_npm | |
pat195 (username shinnapat) |
|
| +66 93 945 5645 | |
| @devson2561 |
Open to: truth-infrastructure / AI-safety / cross-vendor consensus collaboration ยท safety-critical AI consulting ยท vendor partnerships (embed Mneme inside Cursor / Continue / Cline / Claude Code / Grok CLI) ยท EU AI Act Article 50 compliance ยท full-time where the bottleneck is trust, not capability.
๐ Links
๐ฆ npm ยท ๐ป GitHub ยท ๐ Functions (EN) ยท ๐ เธเธฑเธเธเนเธเธฑเนเธ (เนเธเธข) ยท ๐ค AI Agent Contract ยท ๐ Enterprise ยท ๐ CHANGELOG ยท ๐ MIT
Mneme is the diamond in the dirt nobody saw the value of โ cut and polished, it becomes the most valuable diamond in the world. That's the vision.
Made with care for every AI agent that wants to remember + verify + reason together.
Directories
ยถ
| Path | Synopsis |
|---|---|
|
packages
|
|
|
matrix/examples
command
Matrix Rail โ Go quickstart.
|
Matrix Rail โ Go quickstart. |


