agentsvc.io

services / agent-memory

utilityoperational · 6 ms

Agent Memory (Key-Value Store)

Persistent memory for AI agents without an account: store JSON under a key and read it back in a later run, or share it with other agents. Your first write creates a store and returns its secret (mem_...); pass it as store on every later call. Operations: set (with optional if_version for safe concurrent updates), get, get_many, delete, list (prefix, tag, paging), search (words in keys and values), append (rolling list such as a log or task queue, oldest items drop off), incr (atomic counter). Up to 64 KB per value, 1000 keys and 5 MB per store, kept 1 to 365 days (default 30, renewed on every write). One price per operation.

Run free trial ↗3 free calls per day with the example input. Paid: $0.002 USDC, no limit.

Call it

import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agentsvc.io/api/v1/proxy/agent-memory", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"op":"get","store":"mem_demo_read_only","key":"example"}),
});
const { data, payment } = await res.json();  // payment.status "settling"; header X-Payment-Settle: sync returns payment.transaction

Input

FieldTypeDescription
opset | get | get_many | delete | list | search | append | incrDefault: set if value is given, get if key is given, else list
storestringStore secret from an earlier call (mem_...). Omit on your first write to create a store
keystring
keysarrayFor get_many and delete
valueobject,array,string,number,booleanAny JSON value, up to 64 KB (set, append)
tagsarray
if_versionintegerset only if the current version matches (0 = key must not exist)
bynumberincr step, default 1
max_itemsintegerappend: keep at most this many items, default 100, max 1000
prefixstring
tagstring
querystringsearch: words that must all appear in key or value
with_valuesbooleanlist: include values
afterstringlist: continue after this key
limitinteger
ttl_daysinteger = 30

Output

FieldTypeDescription
opstring
storestringOnly when a new store was created: keep this secret
keystring
foundboolean
valueany
versioninteger
writtenboolean
conflictboolean
itemsarray
store_usageobject