Show HN: Id-agent – Token efficient UUID alternative for AI agents
Id-agent is a new library designed to create token-efficient, human-readable IDs for AI agents. It offers memorable word-based IDs that are more efficient than traditional UUIDs, reducing token costs while maintaining collision resistance. The library includes features for generating, validating, and parsing IDs, making it suitable for various applications in AI contexts.
- ▪Id-agent produces word-based IDs at approximately 14 tokens, compared to UUIDs which cost around 23 tokens.
- ▪The library allows for configurable entropy from 12 to 192 bits and includes schema validation for public APIs.
- ▪Users can generate deterministic IDs from string inputs and create bidirectional alias maps for token reduction.
Opening excerpt (first ~120 words) tap to expand
id-agent Token efficient IDs for AI agents Where UUIDs cost ~23 tokens and get hallucinated by LLMs, id-agent produces memorable word-based IDs at ~14 tokens with equivalent collision resistance. The first ID library built for the context window, not the database. Human-readable -- word-based IDs that humans and LLMs can actually remember Token-efficient -- every word in the wordlist is exactly 1 BPE token on o200k_base Collision-safe -- configurable entropy from ~12 to ~192 bits Validated inputs -- zod-powered schema validation on all public APIs Token Cost Comparison Format Example Tokens (o200k_base) Collision Resistance UUID v4 89b842d9-6df9-4cf4-8db0-9dc3aed3cfd7 ~23 122 bits id-agent (default, 8 words) urd-antes-sorry-pac-dire-total-expire-going ~14 ~96 bits id-agent (5 words)…
Excerpt limited to ~120 words for fair-use compliance. The full article is at GitHub.