我构建了一个API,使大型语言模型(LLMs)能够即时访问1000个库的文档。
嘿,HN,
我开发了 CodeContext API(https://codecontext-api-production.up.railway.app),旨在解决我在构建 AI 编码代理时遇到的一个问题:知识截止日期。
我的代理因为训练数据过时而不断产生虚假的 API,比如 LangChain 或 Next.js。手动抓取文档网站的每个请求既慢又昂贵(令牌费用累积很快!)。
CodeContext API 是一个针对 1000 多个流行库文档的语义搜索层。
输入:{"query": "react hooks"}
输出:干净的 JSON,包含最相关的代码片段和解释。
延迟:亚秒级(针对 RAG 进行了优化)。
为什么要使用这个?
节省令牌:不要将整个手册都放入上下文中。只获取你需要的内容。
准确性:为你的代理提供最新版本的实际文档。
速度:无需构建或维护自己的抓取工具。
如果你想测试延迟,主页上有一个实时演示(无需注册)。
我很想听听你们对 API 结构的反馈,以及你们希望看到哪些其他库被索引!
查看原文
Hey HN,<p>I built CodeContext API (https://codecontext-api-production.up.railway.app) to solve a problem I kept hitting while building AI coding agents: The Knowledge Cutoff.<p>My agents kept hallucinating APIs for libraries like LangChain or Next.js because their training data was stale. Scraping documentation sites manually for every request was slow and expensive (tokens add up!).<p>CodeContext API is a semantic search layer over the documentation of 1000+ popular libraries.<p>Input: {"query": "react hooks"}
Output: Clean JSON with the most relevant code snippets and explanations.
Latency: Sub-second (optimized for RAG).
Why use this?<p>Save Tokens: Don't dump the whole manual into the context. Fetch only what you need.
Accuracy: Give your agent the actual docs from the latest version.
Speed: No need to build/maintain your own scrapers.
There is a Live Demo on the homepage (no signup required) if you want to test the latency.<p>I'd love your feedback on the API structure and what other libraries you'd like to see indexed!