Developer Guid
Install the Decontext Protocol package via npm:
npm install decontext-protocol
Or clone the full repository:
git clone https://github.com/Decontext/decontext-protocol
cd decontext-protocol
npm install
Project Structure
contracts/: Solidity smart contracts implementing DMCP
sdk/: TypeScript SDK to interact with context models
scripts/: Deployment and utility scripts
examples/: Sample code for integration
test/: Unit tests using Hardhat
docs/: Developer documentation and walkthroughs
Hardhat (for testing/deployment)
Metamask-compatible wallet
Infura or Alchemy key for Sepolia testnet (or another RPC)
Environment Setup
Create a .env file in the root directory with the following:
Contract Compilation
Use Hardhat to compile the contracts:
Deploying to Sepolia
You can deploy the DMCP contracts to Sepolia using the included script:
This will deploy the protocol contracts and output the deployed addresses.
Ensure the protocol behaves correctly using the built-in tests:
You can interact with the protocol using the provided TypeScript SDK in sdk/. Example:
The SDK abstracts interaction with DMCP contracts and schema logic, making it easy to build context-aware agents and dApps.
Example Use Case
In the examples/ folder, you'll find templates for:
Registering a context schema
Updating a user's context
Querying an entity's behavior context
Integrating with smart contracts or AI agents
Additional Resources
Docs: Inside the /docs folder or GitHub wiki
Register a new context schema
Deploy your own context-aware dApp or AI agent
Integrate with other Decontext-compatible modules
Need help? Join the Decontext developer community (Discord/Forum coming soon).
Last updated