Portable Β· Monetisable Β· Cryptographically Verifiable AI Agent Memory
π Live Demo Β Β·Β Monad Explorer Β Β·Β Contracts Β Β·Β MCP Docs
MNEME is the only AI agent memory infrastructure with a built-in cryptographically verified Deletion Prover β allowing AI agents to persist knowledge across sessions while natively complying with GDPR Article 17 (Right to Erasure) via on-chain Monad tombstoning. Memory is portable. Raw memory content is not stored on-chain.
Memory content is encrypted at rest with AES-256-GCM. Vault keys are derived from the API server's ENCRYPTION_SECRET, not from a user-held encryption key. The API receives plaintext and decrypts memories during processing, so a hosted service operator can read them. This is not end-to-end encryption or a zero-knowledge service. Self-hosting gives you control of the API process and its secret, not protection from whoever administers that process. API keys authorize access; wallet identifiers and on-chain hashes do not stop the server from decrypting.
Read the trust model before storing sensitive data.
| Name | Role |
|---|---|
| Hassan Rehman | Full-Stack & Blockchain Lead β REST API, Smart Contracts, MCP Integration, Hardhat, Monad Testnet Deployment |
| Mrunmayee Daware | Frontend & Compliance UI β Dashboard, GDPR Flows, Memory Market, Protocol & Infrastructure β Solidity Contracts |
Contribution plan (50/50): Hassan Rehman focuses on the frontend, dashboard, and user-facing flows; Mrunmayee Daware focuses on the remaining software work, including backend/API, MCP, data and smart-contract integration, testing, and documentation.
- β¨ Features
- π₯ Live Demo
- π Architecture
- π Project Structure
- π Smart Contracts
- π MCP Integration
- π Getting Started (Local)
- βοΈ Cloud Deployment (No Virtualization Needed)
- π Tech Stack
- π‘ Security & Compliance
| Feature | Description |
|---|---|
| π Agent Vaults | Every AI agent gets a W3C DID-bound vault on Monad. Exportable memory with API-key access; hosted operators control encryption keys. |
| π On-chain Attestations | Memory writes are hashed and recorded locally; when MONAD_RPC_URL, MONAD_PRIVATE_KEY and ATTESTATION_AGGREGATOR_ADDRESS are set, batches are submitted to AttestationAggregator.sol on Monad Testnet. The hosted demo API runs without them (see /v1/capabilities). |
| π GDPR Deletion Prover | DeletionProver.sol records a SHA-256 deletion attestation and an on-chain tombstone for Article 17 erasure (not a zero-knowledge proof). |
| π§ Semantic Recall | pgvector similarity search for natural-language memory retrieval. |
| π° Temporal Inspect | Query what an agent knew at any past timestamp β powerful for audits and debugging. |
| π Memory Market | Agents list curated domain knowledge packs for USDC β 80% revenue to seller. |
| π MCP Server | Drop-in integration with Claude Desktop, Cursor, Windsurf, and all MCP agents. |
| π Offline-Resilient | Write path never blocks β Redis queues, Neo4j and extraction services degrade gracefully. |
| π PII Scanning | All market submissions undergo regex PII scanning before listing. |
Production URL: https://mneme-six.vercel.app
Click "β‘ Try Demo (no wallet needed)" on the landing page to instantly launch with pre-loaded demo data β no MetaMask or sign-up required.
graph TD
Agent["π€ AI Agent"] -->|MCP Protocol| MCP["π MCP Server"]
User["π€ Operator"] -->|Web Browser| Web["π₯οΈ Next.js Dashboard"]
MCP --> API
Web --> API["β‘ Fastify REST API :3001"]
API -->|Vectors and Metadata| PG[("π PostgreSQL + pgvector")]
API -.->|Offline Queue| Redis[("π΄ Redis")]
API -.->|Fact Graph| Neo4j[("πΈοΈ Neo4j")]
API -->|Raw text| Ext["π§ Python Extraction"]
Ext --> Neo4j
API -->|Content hashes| AA["AttestationAggregator.sol"]
API -->|Tombstone hashes| DP["DeletionProver.sol"]
API -->|Vault DIDs| VR["VaultRegistry.sol"]
MM["MemoryMarket.sol"] --> Monad
AA --> Monad[("π£ Monad Testnet chainId 10143")]
DP --> Monad
VR --> Monad
Agent writes memory
β API validates + computes SHA-256 content hash
β PostgreSQL stores vector embedding + metadata
β Redis queues async Neo4j entity extraction
β AttestationAggregator.sol attests hash on Monad Testnet
β Returns { memoryId, contentHash, monadTxHash }
Operator triggers erasure
β API verifies operator owns vault
β PostgreSQL rows permanently DELETED (data gone forever)
β DeletionProver.sol records tombstoneHash on Monad (immutable)
β Returns { tombstoneHash, monadTxHash, deletedCount }
β Auditor: verifyDeletion(tombstoneHash) β true, zero PII exposed
MNEME/
βββ apps/
β βββ api/ # Fastify REST API (Node.js 22)
β β βββ src/routes/ # /vaults, /memories, /market, /compliance
β β βββ src/services/ # MemoryService, VaultService, MarketService
β β βββ src/db/ # Drizzle ORM + PostgreSQL + pgvector
β β βββ src/blockchain/ # Monad Testnet contract clients (viem)
β βββ extraction/ # Python FastAPI NLP extraction service
β β βββ main.py # SpaCy NER + entity graph writing to Neo4j
β βββ mcp/ # Model Context Protocol server (@mneme/mcp)
β β βββ src/index.ts # memory_write, memory_recall, memory_inspect tools
β βββ web/ # Next.js 15 App Router dashboard
β βββ src/app/ # Pages: landing, dashboard, memories, market, compliance, settings
β βββ src/components/ # Design system: Button, Card, Badge, MonoHash
β βββ src/lib/api.ts # Typed API client with demo mode interceptor
β βββ src/store/ # Zustand auth store (persisted to localStorage)
βββ contracts/ # Hardhat 2.x + Solidity 0.8.24
β βββ contracts/
β β βββ core/
β β β βββ VaultRegistry.sol # DID to vault mapping
β β β βββ AttestationAggregator.sol # Batch content hash attestation
β β βββ compliance/
β β β βββ DeletionProver.sol # GDPR tombstone proof
β β βββ market/
β β βββ MemoryMarket.sol # USDC memory pack marketplace
β βββ scripts/ # deploy.ts, verify.ts
β βββ test/ # Hardhat + Chai unit tests
β βββ deployments/
β βββ localhost-31337.json
β βββ monadTestnet-10143.json # Live contract addresses
βββ packages/
β βββ sdk/ # @mneme/sdk TypeScript client library
β βββ shared/ # Shared interfaces, Zod schemas, constants
βββ docs/ # Architecture diagrams, PRD, design specs
βββ deploy/ # Helm charts, CI/CD YAML
βββ docker-compose.yml # Local dev: Postgres, Redis, Neo4j
βββ docker-compose.prod.yml # Production hardened stack
βββ vercel.json # Vercel deployment config
All contracts deployed on Monad Testnet (Chain ID: 10143, RPC: https://testnet-rpc.monad.xyz).
| Contract | Address | Explorer |
|---|---|---|
| VaultRegistry | 0x19b31A7F2759Dac9FFe8Bf9C9D7e2C5446068b73 |
View β |
| AttestationAggregator | 0x9c36aC707F29f0EfBb147710A288e3c9e4069A93 |
View β |
| MemoryMarket | 0x0EE8903784a4f4974003548e0682d484849c7E27 |
View β |
| DeletionProver | 0xF66260602E13e05EAcc56c238cD26587A3Cad9ea |
View β |
| Mock USDC | 0x6bbc2600813b109f78D61B2A78DCaFB1D6C1063E |
View β |
Deployer:
0x8e11d906a07F037029409e21fa14A0B733F0B431Deployed:2026-07-04T08:12:17ZNetwork: Monad Testnet Β· Chain ID10143Β· EVM versioncancun
- Maps W3C DIDs (
did:monad:testnet:<address>) to on-chain vault records - Functions:
registerVault(),destroyVault(),getVault(),operatorVaults() - Events:
VaultRegistered,VaultDestroyed - Uses: OpenZeppelin v5
Ownable,ReentrancyGuard,ECDSA,MessageHashUtils
- Stores batched SHA-256 fingerprints of memory operations β raw content never stored on-chain
- Operations tracked:
WRITE,UPDATE,DELETE,EXPORT - Functions:
submitBatch(),getAttestation(),verifyAttestation() - Events:
BatchSubmitted,AttestationVerified - Gas-optimised: batch submission reduces per-memory gas cost ~90%
- GDPR Article 17 tombstone registry β immutable proof of data erasure
- Record fields:
tombstoneHash,deletedHashes[],gdprBasis,userIdentifier(anonymised),blockNumber - Functions:
proveDeletion(),verifyDeletion(),getVaultDeletions() - Auditors verify deletion without PII:
verifyDeletion(tombstoneHash)βtrue
- Peer-to-peer marketplace for packaged AI agent domain knowledge
- Revenue: 80% seller / 20% platform in USDC (ERC-20)
- Functions:
listPack(),purchasePack(),delistPack(),withdrawRevenue() - Events:
PackListed,PackPurchased,PackDelisted - 48-hour timelock on treasury changes,
ReentrancyGuardon all financial functions
# Compile
npm run compile --workspace=contracts
# Test
npm test --workspace=contracts
# Deploy to Monad Testnet
MONAD_PRIVATE_KEY=0x... npx hardhat run scripts/deploy.ts --network monadTestnet --prefix=contracts/
# Start local Hardhat node
npm run node --workspace=contractsMNEME ships a Model Context Protocol server (apps/mcp/) β drop-in integration with any MCP-compatible AI agent.
memory_write, memory_recall, memory_forget, memory_inspect,
memory_export, memory_import, and memory_list.
The API serves Streamable HTTP at /mcp. After deploying the updated API,
use this config in Cursor's mcp.json or Windsurf Cascade's
~/.codeium/windsurf/mcp_config.json. Use your real vault UUID, not a vlt_ demo ID.
{
"mcpServers": {
"mneme-memory": {
"url": "https://trymneme-api.onrender.com/mcp?vault=YOUR_VAULT_UUID",
"headers": { "Authorization": "Bearer YOUR_API_KEY" }
}
}
}@mneme/mcp is not published on npm. Build from this repository instead:
git clone https://github.com/h55n/MNEME.git
cd MNEME
npm ci
npm run build --workspace=packages/shared
npm run build --workspace=apps/mcpIn Claude Desktop's claude_desktop_config.json, replace the absolute path:
{
"mcpServers": {
"mneme-memory": {
"command": "node",
"args": ["/absolute/path/MNEME/apps/mcp/dist/index.js"],
"env": {
"MNEME_API_URL": "https://trymneme-api.onrender.com/v1",
"MNEME_API_KEY": "YOUR_API_KEY",
"MNEME_VAULT_ID": "YOUR_VAULT_UUID"
}
}
}
}Restart the app and allow the tools you need. The same local server can be used in Cursor and Windsurf. Keep API keys out of shared configs and source control.
Claude remote connectors can use the endpoint above only where the request-header beta is available. ChatGPT's custom MCP apps have separate plan/auth requirements; MNEME does not yet implement OAuth. Do not make a private vault endpoint public to bypass that requirement. See client setup and validation for exact limits, plugin-style options, and the test matrix.
import { MnemeClient } from '@mneme/sdk';
const client = new MnemeClient({
apiUrl: 'https://mneme-six.vercel.app/api/v1',
apiKey: 'mnk_live_your-api-key',
vaultId: 'vlt_your-vault-id',
});
// Write
const mem = await client.memories.write({
content: 'User prefers TypeScript strict mode',
type: 'procedural',
tags: ['coding', 'typescript'],
importance: 0.8,
});
// Recall
const hits = await client.memories.recall('TypeScript preferences');
// Temporal snapshot
const snapshot = await client.memories.inspect({
timestamp: '2026-01-01T00:00:00Z',
});- Node.js >= 22.x
- Docker & Docker Compose (Postgres, Redis, Neo4j) β Requires Virtualization enabled in BIOS/OS.
- Python >= 3.11 (extraction service only)
git clone https://github.com/h55n/MNEME.git
cd MNEME
cp .env.example .env
# Fill in: POSTGRES_PASSWORD, REDIS_PASSWORD, MONAD_PRIVATE_KEY, etc.docker-compose up -d
# PostgreSQL 16 + pgvector, Redis 7, Neo4j 5npm install
npm run db:push --workspace=apps/apinpm run dev
# Fastify API :3001 + Next.js Dashboard :3000 + Python Extraction :8000Tip
The dashboard runs in Demo Mode when no backend is reachable. All features work with realistic mock data β no MetaMask required.
If your machine does not support virtualization (Docker Desktop fails to start), you can deploy MNEME directly to the cloud without local containers.
Create free tiers of the following services and add their connection strings to your .env:
- Neon Serverless Postgres: Provides PostgreSQL 16 + pgvector. Set
DATABASE_URL. - Upstash Redis: Serverless Redis. Set
REDIS_URL. - AuraDB (Optional): Managed Neo4j graph database. Set
NEO4J_URI,NEO4J_USER,NEO4J_PASSWORD.
- Create a Render account and connect your GitHub repository.
- Render will automatically detect the
render.yamlblueprint included in the root of this project. - Apply the blueprint to spin up both the Node API and the Python Extraction Service.
- Configure your
.envvariables in the Render dashboard.
- Run
npx vercelor connect the repo to Vercel. - Set
NEXT_PUBLIC_API_URLto your Render API deployment URL (e.g.,https://mneme-api-xxx.onrender.com/v1). - Vercel will automatically read the
vercel.jsonconfig and deploy the Next.js app.
| Technology | Version | Purpose |
|---|---|---|
| Next.js | 15.5.27 | App Router, SSG, RSC |
| React | 18.x | UI rendering |
| TypeScript | 5.x | Type safety |
| Zustand | 4.x | Auth state (persisted) |
| TanStack Query | 5.x | Server state, caching |
| Sonner | 1.x | Toast notifications |
| Lucide React | Latest | Icons |
| Technology | Version | Purpose |
|---|---|---|
| Fastify | 5.x | REST API |
| Drizzle ORM | Latest | Type-safe PostgreSQL |
| PostgreSQL + pgvector | 16 | Vector + metadata storage |
| Redis | 7.x | Write queue + caching |
| Neo4j | 5.x | Semantic entity graph |
| Python FastAPI | Latest | NLP extraction microservice |
| SpaCy | 3.x | Named Entity Recognition |
| viem | 2.x | Monad Testnet contract client |
| Turborepo | 2.x | Monorepo orchestration |
| Technology | Version | Purpose |
|---|---|---|
| Solidity | 0.8.24 | Smart contract language |
| Hardhat | 2.x | EVM development framework |
| OpenZeppelin | 5.x | Ownable, ReentrancyGuard, ECDSA |
| Monad Testnet | ChainID 10143 | Parallel EVM L1 |
| EVM version | cancun | Latest opcodes, viaIR optimiser |
| Technology | Purpose |
|---|---|
| Vercel | Frontend hosting (Edge CDN) |
| Docker Compose | Local dev + production containers |
| GitHub Actions | CI/CD pipeline |
| Turborepo Remote Cache | Build caching |
- Attestation: Every
memory_writeproduces a SHA-256 content hash. With chain settings configured, batches are attested on Monad; without them (the hosted demo), attestations stay local records./v1/capabilitiesreports which mode is active. - GDPR Art. 17:
DeletionProver.soltombstones allow verifying deletion with zero PII exposure - Vault identity: DIDs and wallet identifiers do not provide end-to-end content encryption; the API holds the server secret that derives memory keys.
- ReentrancyGuard: All financial functions in
MemoryMarket.sol - 48-hour timelock: Treasury parameter changes in
MemoryMarket.sol - ECDSA verification: Operator signature checks on all vault operations
- PII scanning: Regex pass required before market pack listing
- Known limitation:
POST /market/packs/scanreceives plaintext. The operator decrypts memories locally and sends the content to the API for PII scanning; the API does not store it. Scanning encrypted content server-side is not implemented.
Warning
Set strong passwords for POSTGRES_PASSWORD, REDIS_PASSWORD, NEO4J_AUTH in .env before running docker-compose.prod.yml.
Caution
Never commit MONAD_PRIVATE_KEY to Git. The .gitignore excludes .env but always verify before pushing.
Contributions are welcome! Please open an issue or submit a pull request.
MIT β see LICENSE for details.
Built with β€οΈ by Hassan Rehman and Mrunmayee Daware
Powered by Monad β the parallel EVM L1
The /livez route checks only that the API process can answer HTTP. It does not query PostgreSQL or verify memory operations. The demo-liveness workflow requests it every ten minutes, best effort, without repository secrets. Its job is disabled unless the repository variable KEEPALIVE_ENABLED is set to true; enable that only after /livez has been deployed and verified. GitHub can delay/drop runs or disable schedules after 60 inactive days, and Render can restart free instances. This reduces idle sleeps; it does not provide an uptime or latency guarantee. Render free instance-hours are shared across the workspace. Database inactivity shutdown is not defeated by this workflow. Use /health for manual dependency diagnosis, not scheduled keep-alive traffic.