The Mammoth Problem (Why JSON bad)
Imagine Caveman Aditya want to tell Caveman Agent about mammoths in valley. Aditya write note on heavy stone tablet.
Aditya write in JSON format:
๐ฅ Caveman Aditya cry:
"Why write size, tusks, angry every time?! Hand hurt. Stone too heavy. Courier pterodactyl tired."
In AI world, note size is called tokens. Every token cost berries (money). JSON repeat keys over and over. Agent eat all your berries just to read size of mammoth!
The PACK Solution (Few word do trick)
Aditya think. Aditya make FactsPack (.pack) format. Aditya say layout once at top, then just send data:
โ JSON Note
โข Heavy stone (Bloated)
โข Repeat same words
โข Eat many berries
โ PACK Note
โข Light wood (Compressed)
โข Say schema once
โข Save berries when herd BIG!
Caveman honest about berries:
When only 3 mammoth, pack NOT lighter than JSON โ legend and trailer weigh little bit. Pack win when herd BIG: hundred mammoth, thousand mammoth, whole valley of code. Then pack save about 2 of every 5 berries vs JSON (and about half vs HTML stone). More mammoth, more berries saved.
Few word, SAME answer:
Aditya worry: "If I write few word, agent get confused, point at wrong mammoth?" Aditya test it. Agent read pack and answer hunting questions just as right as from heavy JSON stone โ same correct answers, fewer berries. (One agent tested so far; Aditya still testing more agents before big claim.)
The Magic Dictionary (@)
Sometimes, words are very long. Like file name: src/components/MammothDetector.tsx.
If we write this name 50 times, stone tablet break. So PACK use dictionary interning:
We declare mapping once under @. Then in rows, we just write F1. Agent look at painting, know F1 mean MammothDetector. Very fast, very cheap!
The Cave Painting Legend (Self-describing)
AI agent smart, but cold data confuse agent. Agent might hallucinate mammoth that not there.
So every .pack carry Legend in plain caveman talk (the ; meta lines). Legend explain columns and rules. Trailer at end prove courier not drop half of tablet:
If the last line is missing, the agent knows: "Pterodactyl dropped the tablet! Truncated! Do not trust!"
Agent Recipes (How Agent Eat PACK)
Here is how AI coding agents survive in the stone age using .pack:
๐ Recipe 1: Find Important Mammoth (PageRank)
Agent read top table. See which file has highest "importance" rank. Agent know: "Ah, this is Chief Cave file. Start reading here."
๐ Recipe 2: Call Path Resolution
Agent match caller symbol (S) to callee (T) in the calls table. Agent trace how data flow from hunting party to chief cave instantly, no searching.
โบ Recipe 3: Save Berries (Prompt Caching)
Agent keep big master.pack stone tablet in cave. When files change, tool just send tiny + (new mammoth) and x (mammoth dead) lines. Agent patch memory. Agent keep eating cheap cached berries instead of buying fresh ones!