Skip to content
Fourohtwo

agent.halowerk.com/v1/memory-compact

Takes a message history and a character budget and returns a shortened history together with a full account of what it cost. Four stages run in fixed order: pin protects messages that must survive (roles listed in keep_roles, the last keep_last_n messages, and anything you marked pin), dedupe removes later near-duplicates of an earlier message of the same role using word-overlap similarity, trim s

BaseAnswering
POSThttps://agent.halowerk.com/v1/memory-compact

Uptime100% of 1 check in 30 days

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

// npm install fourohtwo
import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://agent.halowerk.com/v1/memory-compact", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"budget_chars":400,"duplicate_threshold":0.9,"keep_last_n":2,"keep_roles":["system"],"max_message_chars":120,"messages":[{"content":"You are a logistics dispatcher. Always answer with the shipment id first.","role":"system"},{"content":"Where is shipment DE-4471? It left Hamburg on Monday morning and should reach Lyon by Thursday.","role":"user"},{"content":"DE-4471 is in transit and cleared the ),
});
console.log(await res.json());

Example input

{"budget_chars":400,"duplicate_threshold":0.9,"keep_last_n":2,"keep_roles":["system"],"max_message_chars":120,"messages":[{"content":"You are a logistics dispatcher. Always answer with the shipment id first.","role":"system"},{"content":"Where is shipment DE-4471? It left Hamburg on Monday morning and should reach Lyon by Thursday.","role":"user"},{"content":"DE-4471 is in transit and cleared the