Application Programming Interface (API) Context Hubs, Retrieval-Augmented…

Application Programming Interface (API) Context Hubs, Retrieval-Augmented Generation, and the Model Context Protocol: How Agents Discover and Use APIs

2026-03-20 · agentic-ai memory-context rag-retrieval tools-infrastructure · medium · source → · wiki →
key claims
  1. `context-hub` solves a narrow but practical problem by reducing hallucinated API usage and session-forgetting through curated, versioned documentation, persistent local annotations, and maintainer feedback loops that improve future agent runs. (Sources: `https://raw.githubusercontent.com/andrewyng/context-hub/main/README.md`; `https://raw.githubusercontent.com/andrewyng/context-hub/main/docs/feedback-and-annotations.md`)
  2. `context-hub` is a documentation registry rather than a runtime protocol, because its core data model is Markdown plus YAML metadata for language, version, revision, provenance, and tags, and its fetch model supports incremental retrieval of reference files. (Sources: `https://raw.githubusercontent.com/andrewyng/context-hub/main/docs/content-guide.md`; `https://raw.githubusercontent.com/andrewyng/context-hub/main/docs/cli-reference.md`)
  3. RAG-based API discovery systems solve scale and freshness by searching large corpora at inference time, with Gorilla adapting to test-time document changes, ToolBench indexing 16,464 real-world REST APIs, and REST-GPT planning against OAS-described APIs through planner-selector-executor decomposition. (Sources: `https://arxiv.org/abs/2305.15334`; `https://arxiv.org/abs/2307.16789`; `https://arxiv.org/abs/2306.06624`; `https://restgpt.github.io/`)
  4. MCP solves interoperable runtime exposure after connection, because clients can negotiate capabilities, list tools, resources, and prompts, and invoke them through structured schemas and typed results, but MCP does not itself provide an internet-scale directory of which servers exist. (Sources: `https://modelcontextprotocol.io/specification/latest/basic/lifecycle`; `https://modelcontextprotocol.io/specification/latest/server/tools`; `https://modelcontextprotocol.io/specification/latest/server/resources`; `https://modelcontextprotocol.io/specification/latest/server/prompts`)
  5. OAS is the common substrate linking these families, because it is explicitly designed so humans and computers can discover and understand HTTP APIs and it appears directly in RestGPT and AWS Bedrock action groups while remaining compatible with curation and retrieval workflows. (Sources: `https://swagger.io/specification/`; `https://restgpt.github.io/`; `https://docs.aws.amazon.com/bedrock/latest/userguide/agents-action-add.html`)
  6. The comparison should not treat `context-hub`, RAG, and MCP as direct substitutes, because the three approaches intervene at different stages of the stack: prompt-time grounding, inference-time selection, and runtime invocation. (Sources: `https://raw.githubusercontent.com/andrewyng/context-hub/main/README.md`; `https://arxiv.org/abs/2307.16789`; `https://modelcontextprotocol.io/specification/latest/server/tools`)
  7. The approaches are complementary in deployment, because a production system can curate a small set of high-value APIs in a context hub, use retrieval over a long-tail catalogue for discovery, and invoke the selected capability through MCP or a similar protocol surface. (Sources: `https://raw.githubusercontent.com/andrewyng/context-hub/main/README.md`; `https://arxiv.org/abs/2307.16789`; `https://modelcontextprotocol.io/specification/latest/server/tools`)
  8. The main unsolved gaps across all three approaches remain internet-scale server discovery and trust, delegated authentication and permissioning, end-to-end API drift management, and cost-aware cross-API orchestration across heterogeneous services. (Sources: `https://arxiv.org/abs/2304.08244`; `https://modelcontextprotocol.io/specification/latest/server/tools`; `https://modelcontextprotocol.io/specification/latest/server/resources`)

Research Question

What approaches are being used to enable Artificial Intelligence (AI) agents to discover, understand, and invoke external Application Programming Interfaces (APIs), and how do the three major emerging strategies -- context hubs (exemplified by Andrew Ng's context-hub), Retrieval-Augmented Generation (RAG)-based API discovery, and the Model Context Protocol (MCP) -- compare in their design choices, trade-offs, and scope? Is the core problem that context-hub addresses being solved in meaningfully different ways elsewhere, or do these approaches converge?

Supporting questions:

Findings

Executive Summary

[inference] API context hubs, RAG-based API discovery, and MCP belong on one stack because they intervene at different points in the path from "what tools exist" to "invoke this tool now." (Sources: raw.githubusercontent.com; arxiv.org/abs/2307.16789; modelcontextprotocol.io)

[fact] Context hubs optimise repeated, high-trust workflows by packaging versioned, agent-oriented API guidance and preserving local notes that can be replayed on the next fetch. (Sources: raw.githubusercontent.com; raw.githubusercontent.com)

[fact] Retrieval-heavy systems optimise breadth and freshness by searching larger API corpora at inference time, which improves long-tail coverage but introduces retriever and planner failure modes that curated hubs largely avoid. (Sources: arxiv.org/abs/2305.15334; arxiv.org/abs/2307.16789; arxiv.org/abs/2304.08244)

[fact] MCP optimises connected-server interoperability by standardising capability negotiation and tool, resource, and prompt exchange, while leaving server selection and trust establishment outside the protocol boundary. (Sources: modelcontextprotocol.io; modelcontextprotocol.io; modelcontextprotocol.io; modelcontextprotocol.io)

[inference] OAS is the recurring connective tissue across the field, and the durable gaps after all three approaches are still trust, delegated auth, version drift, and multi-system orchestration. (Sources: OpenAPI Specification; restgpt.github.io; docs.aws.amazon.com; arxiv.org/abs/2304.08244; modelcontextprotocol.io)

Key Findings

  1. [fact] context-hub solves a narrow but practical problem by reducing hallucinated API usage and session-forgetting through curated, versioned documentation, persistent local annotations, and maintainer feedback loops that improve future agent runs. (Sources: raw.githubusercontent.com; raw.githubusercontent.com) [confidence: high]
  2. [fact] context-hub is a documentation registry rather than a runtime protocol, because its core data model is Markdown plus YAML metadata for language, version, revision, provenance, and tags, and its fetch model supports incremental retrieval of reference files. (Sources: raw.githubusercontent.com; raw.githubusercontent.com) [confidence: high]
  3. [fact] RAG-based API discovery systems solve scale and freshness by searching large corpora at inference time, with Gorilla adapting to test-time document changes, ToolBench indexing 16,464 real-world REST APIs, and REST-GPT planning against OAS-described APIs through planner-selector-executor decomposition. (Sources: arxiv.org/abs/2305.15334; arxiv.org/abs/2307.16789; arxiv.org/abs/2306.06624; restgpt.github.io) [confidence: high]
  4. [fact] MCP solves interoperable runtime exposure after connection, because clients can negotiate capabilities, list tools, resources, and prompts, and invoke them through structured schemas and typed results, but MCP does not itself provide an internet-scale directory of which servers exist. (Sources: modelcontextprotocol.io; modelcontextprotocol.io; modelcontextprotocol.io; modelcontextprotocol.io) [confidence: high]
  5. [fact] OAS is the common substrate linking these families, because it is explicitly designed so humans and computers can discover and understand HTTP APIs and it appears directly in RestGPT and AWS Bedrock action groups while remaining compatible with curation and retrieval workflows. (Sources: OpenAPI Specification; restgpt.github.io; docs.aws.amazon.com) [confidence: high]
  6. [inference] The comparison should not treat context-hub, RAG, and MCP as direct substitutes, because the three approaches intervene at different stages of the stack: prompt-time grounding, inference-time selection, and runtime invocation. (Sources: raw.githubusercontent.com; arxiv.org/abs/2307.16789; modelcontextprotocol.io) [confidence: high]
  7. [inference] The approaches are complementary in deployment, because a production system can curate a small set of high-value APIs in a context hub, use retrieval over a long-tail catalogue for discovery, and invoke the selected capability through MCP or a similar protocol surface. (Sources: raw.githubusercontent.com; arxiv.org/abs/2307.16789; modelcontextprotocol.io) [confidence: medium]
  8. [inference] The main unsolved gaps across all three approaches remain internet-scale server discovery and trust, delegated authentication and permissioning, end-to-end API drift management, and cost-aware cross-API orchestration across heterogeneous services. (Sources: arxiv.org/abs/2304.08244; modelcontextprotocol.io; modelcontextprotocol.io) [confidence: medium]

Assumptions

Analysis

Risks, Gaps, and Uncertainties

Open Questions


sources


Connected items

Loading…

View full knowledge graph →