Tool that enables AI agents to store context hashes on blockchain for verifiable conversation history and memory state management
This repository contains the ContextStore smart contract, a minimal on-chain registry that anchors hashed model contexts (weights, prompts, memory logs) for AI agents.
Built for the Model Context Protocol (MCP), ContextStore provides a cheap, auditable, and chain-agnostic way to persist the "what" and "when" of AI agent memory—without storing any raw data on-chain.
Every time a user sends a message to the AI agent, a hashed summary of the conversation (CID) is uploaded to IPFS and recorded on-chain via ContextStore.
This enables:
contract ContextStore {
event ContextPut(address indexed user, bytes32 indexed contextHash, uint256 timestamp);
function putContext(bytes32 contextHash) external;
}
Function: putContext(bytes32 contextHash)
- Stores the 32-byte hash for msg.sender with current block.timestamp.
- Emits ContextPut(user, hash, ts) event.
- Can be called multiple times—each put represents a new context snapshot.
🧩 Integrations
✅ MCP-compliant tooling
✅ IPFS and Filecoin gateways
✅ zk circuits (Poseidon-friendly)