A collection of deep dives, adversarial audits, architecture notes, and ground-truth benchmarks on Tahsin Reza's TAH (Take a Hint) knowledge cartridge standard.
TAH (Take a Hint) is a binary knowledge cartridge standard invented by Tahsin Reza. It encodes domain expertise locally so language models can retrieve targeted knowledge without loading massive context windows.
Key architectural concepts from the SunsetWars and SunsetPulse repositories — patterns that emerge from using TAH in production systems.
Each specialized agent or worker gets its own private domain cartridge rather than a shared mega-context. A lead-scorer agent loads only lead-scoring knowledge; a neighborhood-explainer loads only neighborhood data. Cartridges are swapped at spawn time via a single query, not rebuilt per request. This enables horizontal scaling: many parallel specialized workers, each carrying exactly what they need and nothing they don't.
Rather than maintaining a single large shared context or hard-coding prompts with domain facts, the TAH pattern assembles exactly the knowledge an agent needs at the moment it spawns — pulling the relevant shards from a cartridge, not reloading the full source. This decouples the knowledge base (which can grow) from the agent's context window (which must stay bounded). Changing domain knowledge means rebuilding the cartridge, not touching the agent code.
When the right cartridge for a query isn't known in advance, meta_query.py
routes the query across multiple cartridges simultaneously and returns the highest-ranked
shards regardless of source. Useful for general-purpose agents that operate across
several domains — they ask once and get back the best match from whichever
cartridge actually contains the answer.
Adversarial audit work that identified and corrected defects in the TAH retrieval implementation — including a critical BM25 ranking bug that caused degenerate results across all queries for an extended period.
Critical defect discovered and fixed (promoted to canonical path 2026-06-17): the BM25 query ranker returned the same shortest shard for every query regardless of content. Root cause: document frequency hardcoded to 0 and tf=1.0, meaning score depended on shard length alone. The correct fix (real term-frequency + per-term IDF) existed in the upstream repository but had never been deployed to the live query path.
Impact: Any conclusion drawn about TAH retrieval quality before 2026-06-17 was based on degenerate results. BM25 is now verified correct.
Real-world integrations of the TAH standard across different domains and platforms, drawn from the public SunsetWars ecosystem and other implementations.
SunsetWars includes production-ready integration scripts for Telegram bots powered by TAH cartridges backed by Ollama (local LLM), Groq (fast inference), and standard OpenAI-compatible endpoints. The pattern: a user message arrives via Telegram, triggers a TAH query for domain context, and that context is injected into the LLM prompt alongside the message. No full-document loading; no context overflow. All integration code is in the public repository.
Tahsin's own flagship integration: private TAH cartridges encoding real estate domain knowledge (neighborhood data, comp analysis patterns, lead scoring heuristics) deployed inside SunsetPulse. Specialized Claude workers (lead-scorer, follow-up-writer, neighborhood-explainer, comp-analyst) each query their own private cartridge rather than loading raw context. Result: sub-second domain expertise at a fraction of the API cost.
An experimental game engine inside the SunsetPulse monorepo demonstrating TAH at its most
granular: each character is a single tiny .tah shard. The game runs a village
simulation where residents generate music (Strudel.cc patterns, produced via a local LLM)
and vote each other out through a "Musical Tribunal" each round. The loser is banished
by "THE SILENCE"; a replacement spawns. Ghosts of the banished persist as a separate character class.
The TAH pattern here is inverted from the knowledge-retrieval use case. Each shard does not encode a domain knowledge base — it encodes a single character's identity and accumulated history. At each game tick, the character's shard is loaded to seed the LLM prompt, allowing the model to become that character rather than merely know about them. Three TAH type variants cover distinct character classes:
Because each shard is tiny (a single JSON object), loading a character's full context costs essentially nothing. The LLM receives exactly who this character is — name, role, recent history — and nothing else. State evolves each tick: punishments, credits lost, and suspicion accumulate in the shard over the game's lifetime.
A separate game-assistant scaffold built around Bread Factory Inferno, a desktop JRPG / management-horror prototype: an underground "miracle" bread factory that could end world hunger, but corrupts into metric-gaming, dehumanization, and weaponization when human attention drops. The in-world terminal assistant is TAH-backed — grounding an in-game AI character in structured cartridge knowledge rather than a free-floating prompt.
Additional domains where the cartridge pattern has been applied or is well-suited:
Ground-truth performance measurements comparing TAH retrieval against raw context injection across representative domain queries.
| Test Case | Raw Context | TAH (BM25 fixed) | Result |
|---|---|---|---|
| 400-page architecture textbook query | ~$5.20 / query | ~$0.12 / query | 40x cheaper |
| Session log history search ("did we discuss X?") | Impossible (context limit) | < 2s retrieval | Enabled |
| Skills discovery (which skill handles X?) | Read files sequentially | Single BM25 query | Orders of magnitude faster |
| BM25 pre-fix (degenerate ranker) | N/A | Same shortest shard always | Broken until 2026-06-17 |
| BM25 post-fix (correct IDF scoring) | N/A | Correct term-weighted ranking | Verified live |
All TAH work originates from Tahsin Reza's public GitHub repositories. The format specification, builder, and query implementation are open source.
The canonical TAH implementation: builder, query engine, Bloom filter, BM25 ranker, Telegram + Ollama + Groq integrations.
Production deployment of TAH in a real estate AI platform. Next.js 14, TypeScript, monorepo. Best example of domain-cartridge architecture in action.