Li

Librarian – Cut token costs by up to 85% for LangGraph and OpenClaw

Hacker News

Librarian – Cut token costs by up to 85% for LangGraph and OpenClaw

Hi HN, I'm building Librarian ( https://uselibrarian.dev/ ), an open-source (MIT) context management tool that stops AI agents from burning tokens by blindly re-reading their entire conversation history on every turn. The Problem: If you're building agentic loops in frameworks like LangGraph or OpenClaw, you hit two walls fast: Financial Cost: Token usage scales quadratically over long conversations. Passing the whole history every time gets incredibly expensive. Context Rot: As the context window fills up, the LLM suffers from the "Lost in the Middle" effect. Response latency spikes, and reasoning accuracy drops. The standard workaround is vector search (RAG) over past messages, but that completely loses temporal logic and conversational dependencies. How Librarian Fixes This: We replaced brute-force context windowing with a lightweight reasoning pipeline: Index: After a message, a smaller model asynchronously creates a compressed summary (~100 tokens), building an index of the conversation. Select: When a new prompt arrives, Librarian reads the summary index and reasons about which specific historical messages are actually relevant to the current turn. Hydrate: It fetches only those selected messages and passes them to the responder. The Results: Instead of passing 2,000+ tokens of noise, you pass a highly curated context of ~800 tokens. In our 50-turn benchmarks, this reduces token costs by up to 85% while actually increasing answer accuracy (82% vs 78% for brute-force) because the distracting noise is removed. It currently works as a drop-in integration for LangGraph and OpenClaw. I'd love for you to check out the benchmark suite, try the integrations, and tear the methodology apart. I'll be hanging out in the comments to answer questions, debug, or hear why this approach is terrible. Thanks!

Share card

Actual performance

8points
7comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: agents, agent, model · Missing: mac, macos, cursor
96%96% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Indie HackersFits the IH revenue-focused audience · Missing: supports, reddit linkedin, podcasting
88%88% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
TrustMRRFits verified-revenue profile · Missing: mobile apps, ios, personal
52%52% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: pipe, 000, io · Missing: https docs, excited, just released
50%50% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
40%40% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Strong signals: arr · Missing: mrr, revenue, profit
21%21% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

AgentReady
AgentReady55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Cut your AI token costs by 40-60% with one API call

Product Hunt+117API
CuToken
CuToken50%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Cut Down Your Token Usage with CuToken.

Indie Hackers1ai
KeksCode
KeksCode12%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Angular bits to cut your product development costs

Indie Hackers
Th
The SC4-HSM is now a FIDO U2F token46%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

The SC4-HSM is now a FIDO U2F token

Hacker News3
Jw
Jwt.show – show the payload of a jwt token46%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Jwt.show – show the payload of a jwt token

Hacker News1
Cr
CryptoTokens.wtf – Token Whitepapers from Highest Grossing ICOs42%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

CryptoTokens.wtf – Token Whitepapers from Highest Grossing ICOs

Hacker News1
To
Token Thermodynamics52%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Token Thermodynamics

Hacker News4
Ex
Extra Headroom – cut Claude Code and Codex token costs by ~50%50%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Extra Headroom – cut Claude Code and Codex token costs by ~50%

Hacker News2
AI
AI Token Counter and API - input token counts and costs for LLMs47%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

AI Token Counter and API - input token counts and costs for LLMs

Hacker News1
We
Webrale.com – Cut your SEO crawling costs by 90%!50%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Webrale.com – Cut your SEO crawling costs by 90%!

Hacker News4