Docs

Integrate in a few lines

One SDK, two lanes. Web2 spends credits against an API key; Web3 pays per call over x402 and needs no account.

// npm i @decentrify/memory-sdk
import { DecentrifyMemory } from "@decentrify/memory-sdk";

// create an API key on the Account page once you're signed in
const memory = new DecentrifyMemory({
  baseUrl: "https://memory.decentrifylabs.com",
  apiKey: process.env.DECENTRIFY_API_KEY,
  encryptionKey: process.env.DECENTRIFY_ENCRYPTION_KEY,
});

const saved = await memory.save("User prefers concise answers.", ["prefs"]);
await memory.search("prefs");     // matches topics
await memory.get(saved.id);       // decrypted locally
await memory.verify(saved.id);    // integrity proof
await memory.delete(saved.id);
Important

Encryption changes what search can see

With client-side encryption on — the SDK default — the server stores ciphertext and cannot index your content. Search matches topics only. Tag anything you intend to find later.

Topics stay plaintext by design, which is the trade that keeps search working at all. Lose the passphrase and the content is unrecoverable, including by us.

Two ways to pay

Credits — sign in, create a key, spend prepaid credits. Free to start, and you can request more from inside the app.

x402 — an agent signs a micropayment per call and settles on Algorand, Base or Solana. No account, no key. Base is the easiest rail: payments are gasless via EIP-3009, so the wallet needs only test USDC.

Get an API key

Endpoints

CallWeb2 (credits)Web3 (x402)Credits
SavePOST /gw/memory/savePOST /v1/memory/save5
SearchGET /gw/memory/searchGET /v1/memory/search2
GetGET /gw/memory/:idGET /v1/memory/:id2
VerifyPOST /gw/memory/verifyPOST /v1/memory/verify1
DeleteDELETE /gw/memory/:idDELETE /v1/memory/:id1

Free and unauthenticated: GET /health, GET /catalog. Web2 calls also accept your browser session, which is how the console works.