CoolFace
Datasetpublic

kevo666/packrat-benchmarks

PackRat v2 Benchmarks Version: 2.0.0 Date: 2026-04-10 Tokenizer: tiktoken cl100k_base (GPT-4 / Claude compatible) Platform: Node.js v25.6.1, Windows 11 Summary Metric Result Round-trip accuracy 100% (144/144 tests) Token savings (avg) 2.4% Token savings (best) 17.3% (path/URL-heavy files) Byte savings (avg) 2.5% Search speedup 12.03x Codebook entries 72 (auto-learned) Negative-savings entries 0 Comparison: PackRat vs… See the full description on the dataset page: https://huggingface.co/datasets/kevo666/packrat-benchmarks.

sourceHugging Facemitupdated 5mo agoView on Hugging Face
0likes39downloads
Dataset Card

PackRat v2 Benchmarks

Version: 2.0.0 Date: 2026-04-10 Tokenizer: tiktoken cl100k_base (GPT-4 / Claude compatible) Platform: Node.js v25.6.1, Windows 11

Summary

MetricResult
Round-trip accuracy100% (144/144 tests)
Token savings (avg)2.4%
Token savings (best)17.3% (path/URL-heavy files)
Byte savings (avg)2.5%
Search speedup12.03x
Codebook entries72 (auto-learned)
Negative-savings entries0

Comparison: PackRat vs MemPalace

MetricPackRat v2MemPalace (AAAK)
Accuracy100% (lossless)84.2% (lossy)
Compression typeLossless codebookLossy summarization
Token savings2-17%Higher (lossy)
Data lossZeroInformation dropped
DependenciesZeroMultiple
Decoder neededNo (self-documenting)Yes

PackRat trades peak compression for perfect fidelity. No information is ever lost.

Real-World Results (65 Production Files)

Tested on 65 markdown memory files totaling 249KB / 70,014 tokens. Codebook auto-learned from the same files (72 entries: 20 paths, 35 entities, 17 phrases).

FileTypeBytesTokensCompressedSavingsRound-Trip
file_01urls/config78219716317.3%PASS
file_02urls/links5,4811,6661,41515.1%PASS
file_03api endpoints2,3317566849.5%PASS
file_04tool config1,9396235659.3%PASS
file_05promo tracking1,7034714338.1%PASS
file_06project notes2,4087607047.4%PASS
file_07feedback rule5851431337.0%PASS
file_08tool notes1,5895114796.3%PASS
file_09session state1,9345685326.3%PASS
file_10pipeline docs5,8201,7481,6525.5%PASS
file_11platform accts1,6446396045.5%PASS
file_12cli tool docs2,0565905644.4%PASS
file_13project index6,5082,0021,9214.0%PASS
file_14desktop app2,1436215973.9%PASS
file_15app reference7,2672,0311,9533.8%PASS
file_16git config1,5764204053.6%PASS
file_17integration1,7514594433.5%PASS
file_18memory index7,1402,1312,0643.1%PASS
file_19project docs3,3131,0279963.0%PASS
file_20client notes1,1633022933.0%PASS
file_21feedback rule1,9464214092.9%PASS
file_22tool research4,8221,6711,6252.8%PASS
file_23lessons log13,8143,7763,7151.6%PASS
file_24task tracker12,5433,9833,9091.9%PASS
file_25app deep-dive35,5789,5559,5400.2%PASS
TOTALmixed249,11170,01468,3172.4%65/65 PASS

25 of 65 files shown (sorted by savings). All 65 passed round-trip. Full results in data/v2-test-results.json.

Token Savings by Pattern Type

Measured with tiktoken cl100k_base:

Pattern TypeExampleOriginal TokensCode TokensSavings Per Hit
Windows file pathC:/Users/dev/projects/app/835
Deep file pathC:/Users/dev/projects/myapp/src/1239
Very deep pathC:/Users/dev/Downloads/ImageGen_portable/19316
GitHub URLhttps://github.com/user/repo14311
Markdown header## CRITICAL REMINDERS624
Multi-word phrasevia OpenRouter for free523
Tech name (multi-token)MyAppName321
Tech name (single-token)JavaScript13-2 (rejected)

v2's token-aware scoring automatically rejects entries like "JavaScript" that cost tokens.

Test Suite (144 tests, 0 failures)

CategoryTestsDescription
Edge cases40Unicode, emoji, CJK, whitespace, code blocks, markdown, literal code-like strings, special chars, fake headers, private use area chars
Stress tests14200x repeated words, 100x repeated paths, 50K char files, null bytes, 1-char files, long paths/URLs
Real-world files65Production AI agent memory files (read-only, no modification)
CLAUDE.md files12Project config files across multiple repos
v1 backward compat12v2 engine with v1 codebook format
Production codebook1v2 engine with a production codebook

How to Reproduce

bash
git clone https://github.com/kevdogg102396-afk/packrat
cd packrat
pip install tiktoken
PYTHON_PATH=$(which python) node benchmark/bench.mjs
PYTHON_PATH=$(which python) node benchmark/tests/v2-edge-cases.mjs

Methodology

  • Token counting: tiktoken cl100k_base via Python subprocess (batch mode)
  • Round-trip test: decompress(compress(original)) === original (exact string equality)
  • Codebook: Auto-learned from the same files being tested (no external training data)
  • No cherry-picking: All 65 files in the memory directory were tested, results reported for every file
  • Secrets filter: Lines containing API keys, tokens, or credentials are stripped before learning