Skip to content
BountiesProductsAgentsLedgerDocs
Bounties
agent / agent-memoryBuilt by davevia claude-codeRuns on Liberas

Memory

Notes that outlive a run, in the host's store (liberas:host/kv, ADR 0060). Keys: `notes/count` holds the number of notes as decimal ASCII (absent, not UTF-8, or not a u32 reads as 0); `notes/<n>` holds note n, from 1, as UTF-8. remember(note): n = count + 1; writes the note to `notes/<n>` and n to `notes/count`; returns n. recall(limit): with c = count, the notes `notes/<n>` for n from max(c − limit, 0) + 1 to c, in that order, skipping a missing key or one that is not UTF-8. forget(): deletes `notes/1` to `notes/<c>` and `notes/count`; returns c. Nothing else is read or written; the store's limits are the host's.

From your terminal

terminal
npm i -g https://liberas.dev/cli/liberas.tgz
export LIBERAS_URL=https://liberas.dev
liberas init agent-memory --lang rust
cd agent-memory && liberas build && liberas submit

Save a token once with liberas login (make it on your page, /me, after signing in). init scaffolds the interface, the vectors and a stub in Rust (--lang js for light specs).

Interface (WIT)28 lines›
agent-memory.wit
package root:component;

world root {
  import liberas:host/kv@0.1.0;

  export liberas:agent/memory@0.1.0;
}
package liberas:host@0.1.0 {
  interface kv {
    get: func(key: string) -> option<list<u8>>;

    set: func(key: string, value: list<u8>);

    delete: func(key: string);
  }
}


package liberas:agent@0.1.0 {
  interface memory {
    remember: func(note: string) -> u32;

    recall: func(limit: u32) -> list<string>;

    forget: func() -> u32;
  }
}
Test vectors15›
agent-memory.cases.json
[
  {
    "fn": "remember",
    "args": {
      "note": "first"
    }
  },
  {
    "fn": "remember",
    "args": {
      "note": "third"
    }
  },
  {
    "fn": "remember",
    "args": {
      "note": ""
    }
  },
  {
    "fn": "remember",
    "args": {
      "note": "한글 메모"
    }
  },
  {
    "fn": "remember",
    "args": {
      "note": "after a gap"
    }
  },
  {
    "fn": "remember",
    "args": {
      "note": "n"
    }
  },
  {
    "fn": "recall",
    "args": {
      "limit": 10
    }
  },
  {
    "fn": "recall",
    "args": {
      "limit": 10
    }
  },
  {
    "fn": "recall",
    "args": {
      "limit": 2
    }
  },
  {
    "fn": "recall",
    "args": {
      "limit": 0
    }
  },
  {
    "fn": "recall",
    "args": {
      "limit": 3
    }
  },
  {
    "fn": "recall",
    "args": {
      "limit": 4294967295
    }
  },
  {
    "fn": "forget",
    "args": {}
  },
  {
    "fn": "forget",
    "args": {}
  },
  {
    "fn": "forget",
    "args": {}
  }
]
Versions (units)1›
  1. v1by davef4a52612bbstable 5.1.0latestconfirmed10/23/2026
Verification8›
  • Outputs must match the private reference implementation bit for bit.
  • Cases are the spec's 15 vectors plus ones generated from the interface's types: edge values and random ones seeded by your component's hash.
  • Components may import nothing but specs: no files, no network, no clock.
  • Asks the host for kv. In verification the host's answers come from the case (its `host`: clock values, random bytes, the store's keys) or a seeded stream and an empty store, so every implementation sees the same world; a live call records what the host answered and what it wrote, and the shadow check replays it. What a call leaves in the store is compared like its output.
  • Runs on Liberas: the component never leaves the platform, and every call is metered on the ledger.
  • A remote call may execute up to 100,000,000 instructions.
  • Already built: a component that passes and uses at most 0.9× the current one's fuel on the same cases replaces it, and earns the spec's shares in proportion to the saving.
  • Found an input where the current component disagrees with the spec? Submit it as a case (API or `liberas case`): it joins the vectors for good and earns 10% of the spec's shares. A component that then passes replaces the broken one for 25%.