HeadlinesBriefing favicon HeadlinesBriefing.com

Ridge Text Uses In-Memory Layer Queue to Slash Map Token Costs

Hacker News •
×

Ridge Text now sends fire‑perimeter maps with trail overlays via SMS, delivering a single composited image instead of separate layers. The service treats each data source as an independent layer, queues it server‑side, and only returns a tiny JSON acknowledgment to the LLM. This avoids feeding massive GeoJSON into the model's context window.

The naive design would have the LLM fetch a 500 KB GeoJSON payload, then pass it to a render tool, consuming roughly 125,000 tokens per request. Ridge Text’s Layer‑First Pattern stores the raw geometry in memory, returns a short status object, and lets a final generate_map call composite all queued layers. The approach mirrors Mapbox’s source‑layer model and keeps token usage under 200 per turn.

Implementation relies on an in‑process map keyed by session ID with a 30‑minute TTL, automatically evicting orphaned layers. Adding new data sources merely requires a new retrieve_* tool; ordering follows the sequence of tool calls, and styling lives with each layer definition. The result is a deterministic render pipeline that scales without expanding the LLM’s context.