Tuck Shop
The capability layer your AI services share.
Building or Improving Your Own LLM Harness?
One HTTP endpoint. 40 tools. Web search, URL fetching, academic papers, currency, statistics, units — everything your agents need to touch the real world, without each service solving it from scratch.
The Problem
You're building a multi-service AI ecosystem. Your WhatsApp bot needs to fetch URLs. Your memory system needs web search. Your morning briefing pulls articles. Each one is about to implement its own fetch logic, its own search integration, its own PDF parser.
That's the problem. You end up with four copies of the same brittle code, four places to maintain Readability, four ways a SPA breaks the fetch, four sets of fallback rules nobody remembers to update.
Tuck Shop is one shared service they all call. Write the capability once. Wire every consumer to the same endpoint. Fix it once when a platform changes its markup.
What You Get
Web Search
SearXNG as primary — self-hosted, no API key needed — with automatic fallback to Serper then Brave. Recency filters. Your agent calls one endpoint; the fallback chain is invisible.
Smart Fetch
Fetches any URL as clean readable text. JS-renders SPAs automatically (Puppeteer). Extracts articles via Readability. Reads PDFs up to 20MB. Platform-specific readers for Reddit, YouTube transcripts, GitHub, Hacker News, X/Twitter. Falls back to Internet Archive when pages are gone.
Academic Search
Searches across arXiv, Semantic Scholar, and Hugging Face papers in one call. For people building research-aware agents that need primary sources, not blog summaries.
Cognitive Tools
Calculator, date arithmetic, statistics, probability, unit conversion, hypothesis testing. Imported directly from the training tools — same signatures at runtime as at training time.
Why These Choices
SearXNG over Google/Bing APIs
Rationale:
Self-hosted, no API key, no rate limits, no billing surprises. Aggregates multiple engines. When it's down, Serper and Brave catch it. Zero vendor lock-in.
Puppeteer for SPA rendering
Rationale:Modern web is JavaScript-rendered. A fetch that returns empty HTML from a React app is useless. Puppeteer with chrome-headless-shell renders the page, then Readability extracts the content. The semaphore (width-2) stops Chrome processes from eating the machine. Pipe mode means no orphaned Chrome even on kill -9.
Readability extraction over raw HTML
Rationale:Your LLM doesn't need nav bars and cookie banners. Readability pulls the article body. But it also guts list pages — index pages, search results — so there's a length-comparison guard that falls back to raw HTML when Readability would lose content. That guard was earned by debugging.
Wayback Machine fallback
Rationale:Links die. Papers move. Pages get region-blocked. Before returning a 404 to your agent, Tuck Shop checks the Internet Archive. It's not a feature you'd think to add — until your agent hits a dead link in a two-year-old conversation.
Training-runtime tool parity
Rationale:If your model learns to call a calculator during training, the calculator at runtime should have the same interface. Tuck Shop imports tool definitions directly from the training pipeline. No translation layer. No drift.
How It Works
GET /health GET /tools
- Stateless. 5-minute TTL cache. No session, no memory between calls.
- SSRF-safe. Your agent can't be prompt-injected into fetching internal endpoints. Loopback and private ranges are blocked.
- Self-hosted. No external API keys required for the core path. SearXNG, Puppeteer, Readability — all run on your machine.
- Designed as a launchd service — kill it and it restarts. Consumers get a
25-secondtimeout budget.
Built for Builders
If you're wiring up an AI system that needs to search, fetch, and compute — this is the boring middleware that handles it so you can focus on the interesting parts.