Context Hub: Give Your AI Agents Curated, Self-Improving Documentation

⬅️ Back to Tools

Context Hub: Stop Your AI Agents from Hallucinating APIs

We’ve all been there. You ask your AI coding assistant to call an API, and it confidently writes code that looks right but completely fails at runtime. Why? Because coding agents hallucinate APIs, forget what they learn in a session, and often rely on outdated or incorrect documentation found through noisy web searches.

Context Hub https://github.com/andrewyng/context-hub solves this by giving your AI agents curated, versioned documentation that actually works; all maintained as open markdown in the repo, so you can inspect exactly what your agent reads. With 3.7k stars, this is quickly becoming essential infrastructure for anyone relying on AI coding agents.

Key Features

📚 Curated Documentation

No more web searches with noisy results. Context Hub provides:

  • Versioned, Language-Specific Docs - Get the exact documentation for Python, JavaScript, or other languages
  • Open Content - All docs are maintained as markdown in the repo, fully auditable
  • Community Driven - API providers, framework authors, and the community can all contribute
chub get openai/chat --lang py       # Python variant
chub get openai/chat --lang js       # JavaScript variant

🔍 Simple Search & Fetch

The core workflow is beautifully simple:

chub search "stripe payments"        # Find relevant docs
chub get stripe/api --lang js       # Fetch the doc
# Agent reads the doc, writes correct code. Done.

📝 Self-Improving Agents

Context Hub is designed for a loop where agents get smarter over time:

Annotations - Agents can attach local notes to docs that persist across sessions:

chub annotate stripe/api "Needs raw body for webhook verification"
# Next session, the annotation appears automatically on chub get.

Feedback - Up/down ratings go to doc authors, so the docs get better for everyone:

chub feedback stripe/api up     # Vote the docs up
chub feedback stripe/api down   # Vote the docs down

🎯 Incremental Fetch

Docs can have multiple reference files. Fetch only what you need. No wasted tokens:

chub get openai/chat --file references.md  # Specific file only
chub get openai/chat --full                # Everything

🔌 Agent Integration

Context Hub is designed for your coding agent to use. You can:

  • Prompt your agent to use it: “Use ‘chub get openai/chat –lang py’ to get the latest API documentation”
  • Create an agent skill - Put the SKILL.md in ~/.claude/skills/get-api-docs/ for Claude Code

Commands

CommandPurpose
chub search [query]Search docs and skills
chub get <id> [--lang py|js]Fetch docs by ID
chub annotate <id> <note>Attach a note to a doc
chub annotate <id> --clearRemove annotations
chub annotate --listList all annotations
chub feedback <id> <up|down>Vote docs up or down

Platforms

  • 🖥️ macOS
  • 🐧 Linux
  • 🪟 Windows

Get Started

Installation

npm install -g @aisuite/chub

Usage

# Search for documentation
chub search openai

# Get current docs (Python version)
chub get openai/chat --lang py

# Get JavaScript version
chub get openai/chat --lang js

# Annotate for future sessions
chub annotate openai/chat "Use max_tokens parameter for response length"

# Give feedback to authors
chub feedback openai/chat up

Setting Up Your Agent

For Claude Code, create the skills directory and add the SKILL.md:

mkdir -p ~/.claude/skills/get-api-docs
# Copy SKILL.md from the repo to this directory

Then prompt your agent: “Use the CLI command chub to get the latest API documentation. Run ‘chub help’ to understand how it works.”

🔗 GitHub: github.com/andrewyng/context-hub

Why This Tool Rocks

  • No More Hallucinations - Agents get curated, working documentation instead of guessing
  • Self-Improving - Annotations persist across sessions, feedback improves docs for everyone
  • Versioned & Language-Specific - Get the exact docs for Python, JavaScript, etc.
  • Open & Auditable - All content is markdown in the repo; you can inspect and contribute
  • Token Efficient - Incremental fetch lets agents grab only what they need
  • Community Driven - Anyone can contribute docs and skills via pull requests
  • Agent-Native - Built specifically for AI agents to use, with skills integration
  • Free & Open Source - MIT licensed, no subscriptions

Crepi il lupo! 🐺