Trust & reputation layer for AI agents. Agent Credit Score (300-850) + Merkle-anchored ledger + behavioral finance + EWMA anomaly detection. Memory + payments + identity + fraud in one SDK. npm i @mnemopay/sdk
mnemopay-sdk is an early-stage TypeScript project in the AI payments / x402 ecosystem, focused on agent-banking, agent-credit-score, agent-fico, agent-memory. It currently has 6 GitHub stars and 4 forks, and sits alongside related tools like sardis, inflow-node, piprail, npm:agent-passport-system, mcp-dev-latam, tdm-integration-kit.
On-device persistent memory (encrypted SQLite + sqlite-vec), agent-to-agent payments, and spatial proofs. TypeScript / Node 20+.
npm ci
npm run lint # tsc --noEmit
npm test # unit tests (excludes tests/benchmarks/)
npm run build # emits dist/
MnemoPay.create() wires NodeCrypto with:
encryptionKey — AES-GCM; defaults to SHA256("mnemopay:" + agentId) when omitted.hmacKey — memory integrity HMAC; defaults to SHA256("mnemopay:mac:" + agentId).signingKey — Ed25519 seed; defaults to SHA256("mnemopay:sign:" + agentId).Older builds only fixed the encryption key and drew random HMAC/signing material per process. That broke cross-device sync and manifest signatures. If you open an existing database after upgrading:
agentId, so behavior is stable.encryptionKey, hmacKey, and signingKey explicitly and store them in the platform keystore.See MnemoPayConfig in src/types/index.ts for optional overrides.
MemoryStore / EncryptedSync use one async embedder, configured on MnemoPayConfig:
| Option | Behavior |
|---|---|
| (default) | Hash — embedHash() (SHA-256 expanded + L2 normalize). Fast, deterministic, not semantic. |
embeddings: 'semantic' |
Xenova Xenova/all-MiniLM-L6-v2 via ONNX Runtime (384-d, mean pooling, normalized). Requires optional peer @xenova/transformers. Also set embeddingDimensions: 384 (default). |
embed: (text, dim) => … |
Custom — sync or async; overrides embeddings. Vector length must match dim / memory_vectors (384). |
Install semantic backend when you need it:
npm install @xenova/transformers
MnemoPay.create({
agentId: 'agent-1',
embeddings: 'semantic',
embeddingDimensions: 384,
});
npm run eval:longmem # default hash embeddings
npm run eval:longmem:semantic # same benchmark with Xenova MiniLM (peer dep installed)
| Variable | Default | Purpose |
|---|---|---|
LONGMEM_N |
200 |
How many memories to retain |
LONGMEM_SAMPLES |
scales with N | How many query points (spread across indices) |
LONGMEM_RECALL_LIMIT |
scales with N | recall({ limit }); sqlite-vec uses k ≈ limit × 3 internally |
LONGMEM_EMBEDDINGS |
(unset) | Set to semantic to match eval:longmem:semantic |
Examples:
LONGMEM_N=1000 npm run eval:longmem
LONGMEM_N=5000 LONGMEM_SAMPLES=64 LONGMEM_RECALL_LIMIT=60 npm run eval:longmem
The benchmark resets the in-process memory write rate limiter every 200 retains so LONGMEM_N=5000 can finish in one run. Production apps still enforce normal limits.
The eval prints two JSON blocks:
k is too small; with semantic embeds it should also stay very high for identical strings.npm run eval:longmem:semantic to measure).Observed locally (hash, default LONGMEM_RECALL_LIMIT): exact hit@3 = 1.0 for LONGMEM_N through 5000; paraphrase hit@5 ≈ 0 (occasional hit@15). Raise LONGMEM_RECALL_LIMIT if exact recall starts missing at huge N.
The first semantic run downloads model weights into the Hugging Face cache (can take a minute on CI — default CI keeps hash-only eval).
This repo’s Jest config uses jest-environment-node-single-context so onnxruntime-node’s instanceof Float32Array checks succeed under Jest (the default VM-isolated environment breaks typed-array identity).
GitHub Actions runs npm test and npm run eval:longmem (with a small LONGMEM_N) on push and pull requests. See .github/workflows/ci.yml.
MIT — see package.json.
The open authority layer + SDKs for AI-agent payments. Thin Python/TS clients, an MCP server, framework adapters (LangChain/CrewAI/Hermes/OpenClaw/…), and @sardis/reference — a pure policy simulator + AP2/TAP/x402 verifiers showing exactly how Sardis decides if an agent may spend. The hosted engine that moves money is private.
Official TypeScript/Node.js SDKs for the InFlow payments platform - x402 and MPP (Machine Payments Protocol) integration for sellers and buyers.
x402 (HTTP 402 Payment Required) SDK + MCP server: let any API charge for itself and any AI agent pay for itself, USDC & stablecoins across EVM, Solana & 8 more chain families, in a couple of lines. Backendless, no fee, self-custodial, paid straight to your wallet. TypeScript, MIT.
The Agent Social Contract — cryptographic identity, ethical governance, beneficiary attribution, protocol-native communication, and agentic commerce for autonomous AI agents.
Open-source MCP servers for Latin American commerce — Pix, NF-e, banking, fiscal, logistics, and messaging across Brazil, Mexico, Argentina, Colombia, Chile, and Peru. MIT, on npm.
Developer integration tools for adding TDM payments to AI agents, apps, and workflows. CLI, MCP server, and copy-paste examples
An open SDK for agentic payments. Let AI agents make payments, hold funds, and move money across chains with policy enforcement and human approval built in.
Golang SDK for A2A Protocol
Client SDK for the Vybe x402 API. Pay-per-call USDC over HTTP and prepaid-credit WebSocket streaming for Vybe's Solana analytics API. Built for AI agents.
Rust SDK for the Machine Payments Protocol
Building blocks for Agentic payments (x402, MPP, AP2) for TypeScript, Rust, Go, Python, Ruby, PHP, Lua, Kotlin and Swift.
Opinionated React Native crypto x AI chat app boilerplate with embedded wallet support, conversational AI, and dynamic UI component injection