yksanjo/gmem
Provides EVM support for persistent memory, enabling ingestion of Hardhat deployments and storage of Contract entities with reorder-invariant ABI hashes and classification of networks into canonical chain ids (e.g., ethereum-mainnet).
Classifies Optimism L2 networks (e.g., optimism-mainnet) and stores contract artifacts with chain-aware context as part of EVM memory support.
Classifies Polygon L2 networks (e.g., polygon-mainnet) and stores contract artifacts with chain-aware context as part of EVM memory support.
Provides persistent project memory for Solana AI agents, enabling storage and recall of program IDs, IDLs, PDA seeds, deployment state, architectural decisions, and audit findings, with tools for auto-ingesting Anchor workspaces and capturing Solana CLI context.
gmem
Persistent project memory for Solana AI agents.
A Model Context Protocol (MCP) server that gives AI coding agents — Claude Code, Cursor, or anything that speaks MCP — durable, Solana-aware memory of a project across sessions: program IDs, IDLs, PDA seeds, deployment state, architectural decisions, audit findings. So agents stop forgetting what they built yesterday.
Status: v1.1 — stable, with EVM support. Seven MCP tools, real implementations (no stubs), backward-compatible wire format:
Storage: SQLite via better-sqlite3, one db file per project (auto-resolved from
Anchor.toml/ workspaceCargo.toml, override withGMEM_DB)Ranking: SQLite FTS5 BM25 with a recency boost
Versioning: append-only — every write inserts a new
(kind, natural_id, version)row; reads return the latest; full history available via the in-processStoreAPIAnchor ingest:
gmem.ingest_anchorparsesAnchor.toml, captures IDL sha256s, records git HEAD assourceCommitper ProgramSolana CLI context:
gmem.solana_contextreads~/.config/solana/cli/config.yml, classifies the cluster, derives the active keypair's pubkey (secret never leaks).gmem.writeon a Decision auto-attributesauthor+authorClusterGit-aware diff:
gmem.diffaccepts both ISO timestamps and git refs (HEAD, HEAD~3, branch names, full and short SHAs)EVM support (v1.1):
gmem.ingest_hardhatparses Hardhat /hardhat-deployworkspaces, classifies networks into canonical chain ids (base-mainnet 8453, optimism-mainnet 10, polygon-mainnet 137, arbitrum-one 42161, ethereum-mainnet 1, plus testnets), captures a reorder-invariant ABI SHA-256. NewContractentity kind for EVM smart contracts.License: MIT
Spec: see
SPEC.mdEntity schemas: see
schema/
Why
Solana has moved decisively toward an agent-first developer experience. The Foundation's
awesome-solana-ai repo indexes a strong layer of stateless reference skills —
solana-dev-skill, magicblock-dev-skill, metaplex-skill, helius-phantom-skill,
solana-game-skill, and more — that teach agents how to do things. The Solana
Developer MCP exposes documentation. What's missing is the layer above: persistent
project memory.
Today every Claude Code session on a Solana project starts cold. The agent doesn't remember the program ID it deployed yesterday, the PDA seeds it chose two weeks ago, the audit finding from last sprint, or why a specific Jupiter integration was rejected. The developer compensates by pasting context, hand-maintaining NOTES files, or re-explaining the project every session. That is a tax on every agent-assisted Solana developer.
gmem fixes this by being opinionated about Solana primitives — programs, accounts,
instructions, PDAs, IDLs, cluster state, Anchor configs — rather than being a generic
key-value store. It complements every existing skill in awesome-solana-ai rather than
competing with any of them.
Install
npm install -g @yksanjo/gmemOr, to run it without a global install:
npx @yksanjo/gmemThe installed binary is still called gmem.
Or, to hack on the source:
git clone https://github.com/yksanjo/gmem.git ~/gmem
cd ~/gmem && npm install && npm run buildThen point your MCP client at it. For Claude Code:
// ~/.claude/mcp_servers.json
{
"mcpServers": {
"gmem": {
"command": "node",
"args": ["/absolute/path/to/gmem/dist/index.js"],
"env": { "GMEM_DB": "~/.gmem/memory.db" }
}
}
}Tools exposed (v0.1)
Tool | Purpose |
| Retrieve memory entries relevant to a natural-language query, ranked by BM25 + recency |
| Persist a typed memory entry (Program / Account / Instruction / Decision / Finding / Integration); append-only |
| Show how memory state changed between two points in time — accepts ISO timestamps OR git commit refs (HEAD, HEAD~3, branch names, full or short SHAs) |
| List all |
| Auto-ingest an Anchor workspace: parse |
| Read the active Solana CLI config ( |
| v1.1 — Auto-ingest a Hardhat / EVM workspace: parses |
Full input/output JSON schemas are in SPEC.md.
Out of scope for v1.0
To keep the v1 scope honest, gmem v1.0 does NOT include: hosted multi-user sync,
cross-project search, agent reputation, on-chain memory anchoring. These are tracked in
ROADMAP.md for v1.x / v2.
Roadmap
v0.1 — Open spec + JSON schemas + MCP server stub
v0.2 — SQLite backend, BM25 ranking, append-only versioning
v0.3 — Anchor workspace auto-ingest
v0.4 — Solana CLI context capture + Decision auto-attribution
v0.5 — git ref resolution in
gmem.diffv1.0 — Stable release with three worked examples (DeFi vault, cNFT mint, AI agent) — see also PR #168 in
solana-foundation/awesome-solana-aiv1.1 — EVM / Hardhat support (Base, Optimism, Polygon, Arbitrum, Ethereum, plus testnets), new
Contractentity,gmem.ingest_hardhattool, worked example 04-evm-vault
Contributing
This is an early-stage spec. The most useful thing right now is feedback on
SPEC.md — does the entity model cover the Solana primitives that matter
to your project? Open an issue or PR.
License
MIT — see LICENSE.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/yksanjo/gmem'
If you have feedback or need assistance with the MCP directory API, please join our Discord server