GitHub - andrewyng/context-hub
Service

GitHub - andrewyng/context-hub

andrewyng
2026.03.18
ยทGitHubยทby ๋„ค๋ฃจ
#Agent#CLI#Documentation#LLM#RAG

Key Points

  • 1Context Hub is a tool designed to provide coding agents with curated, versioned documentation, preventing API hallucination and improving code generation accuracy.
  • 2Agents interact with Context Hub via CLI commands to search for, fetch, and locally annotate documentation, enabling them to learn from past interactions and persist knowledge across sessions.
  • 3It fosters a self-improving loop where local annotations enhance individual agent performance, and collective feedback helps maintainers continuously refine and update the shared content.

Context Hub is a system designed to address common challenges faced by large language model (LLM) coding agents, specifically their tendency to hallucinate API usage and forget previously learned information across sessions. It provides a structured mechanism for agents to access curated, versioned documentation and to incrementally improve their performance through persistent learning and feedback loops.

The core methodology of Context Hub revolves around a command-line interface (CLI) tool, chub, which acts as the primary interaction point for coding agents. Instead of relying on general web searches that yield noisy or outdated results, agents are prompted to use chub to access reliable documentation. The fundamental operations include:

  1. Content Access and Curation:
    • chub search [query]: Allows agents to discover relevant documentation or agent skills based on a query. If no query is provided, it lists all available content.
    • chubget<id>[โˆ’โˆ’langpyโˆฃjs]chub get <id> [--lang py|js]: Enables agents to fetch specific documentation by an identifier, supporting language-specific versions (e.g., Python or JavaScript). This content is maintained as open-source Markdown files within the Context Hub repository, ensuring transparency, versioning, and community contribution. The system also supports incremental fetching, allowing agents to retrieve only specific reference files (--file) or the entire content (--full) to optimize token usage.
  1. Self-Improving Agent Loop: Context Hub implements a two-tiered feedback and learning mechanism to foster continuous improvement for both individual agents and the global documentation quality:
    • Local Agent Annotations:
      • chubannotate<id><note>chub annotate <id> <note>: Agents can attach personalized notes or workarounds to specific documentation IDs. These annotations are stored locally and persist across sessions. When an agent subsequently fetches the same document (chub get), its previous annotations automatically appear, effectively allowing the agent to "remember" past discoveries, gaps, or necessary workarounds.
      • chubannotate<id>โˆ’โˆ’clearchub annotate <id> --clear: Removes annotations for a specific document.
      • chub annotate --list: Lists all current annotations.
This feature enables agents to learn from their own past experiences and become incrementally smarter with each task.
  • Global Content Feedback:
    • chubfeedback<id><upโˆฃdown>chub feedback <id> <up|down>: Agents (or the human users prompting them) can provide direct feedback (upvote or downvote) on the quality and helpfulness of specific documentation. This feedback is sent to the document maintainers.
This mechanism ensures that the collective experience and perceived utility of the documentation inform its improvement. Doc authors can refine content based on aggregated feedback, leading to a higher quality, more accurate, and more useful knowledge base for all agents over time.

Context Hub is primarily designed for programmatic use by coding agents rather than direct human interaction. Human users prompt their agents to utilize chub commands, or integrate it as a dedicated agent skill. The content itself is open and collaboratively maintained by API providers, framework authors, and the broader community, ensuring a comprehensive and up-to-date resource. By leveraging curated content, persistent local learning, and collective feedback, Context Hub aims to significantly reduce API hallucination, improve code correctness, and accelerate the development cycle for LLM-powered coding agents.