WaForgeDevelopers

Reference

Caching and freshness

WaForge keeps a short cache of your answers so replies stay fast, but never longer than the ttl you send and never longer than a cap per kind of data. Separately, a value whose as_of is too old is not quoted at all.

Cache caps #

DataEndpointsWaForge capAlso the max age of as_of?
Stockavailability60 sYes
Prices and product detailsproduct.get, product.by_sku300 sYes
Order statusorder.statusNever cachedNo, always read live
Booking slotsbooking.slots30 sYes
Delivery zonesdelivery.zones1 hYes
Catalog searchcatalog.search24 hNo: search finds items, the quoted price comes from product.get

Effective cache time = min(your ttl, cap). Send ttl: 0 to turn caching off for a response. The cache is per feed and per question; a change event or a passing feed check drops all of it at once.

as_of: when the value was true #

Set as_of to the moment your system knew the value was true. When you read it from your database during the request, that is now. Do not send the date the product was last edited: a price edited yesterday is still current, but an as_of of yesterday tells WaForge it is a day old, and the agent will not quote it.

When stock, price, slot or delivery data reaches WaForge with an as_of older than its cap (for example stock older than 60 seconds), it is marked stale: the agent does not state it and hands the chat to you. Use an older as_of only when you really serve from your own cache, and keep that cache shorter than the caps.

Sheets and CSV #

Stock from a Google Sheet or CSV is trusted for 24 hours after it was last read. After that the agent does not confirm stock and hands the chat to you. Prices from a sheet or CSV stay valid until you change them.

Timeouts and the circuit breaker #

  • Each call gets 1 second to connect and 2.5 seconds in total by default. Set limits.timeout_ms in your manifest to change it, between 1,000 and 5,000 ms.
  • After 5 failures in a row (timeouts, errors, invalid envelopes), WaForge pauses calls to your feed for 60 seconds and the agent hands those chats to your team. The next successful call resets the count.
  • The agent may make up to 8 tool calls for one reply.