Khám phá Learn Stream About Jokes
Stream
Liên kết

Context Hub vs Context7: Hai cách cho AI đọc docs mới nhất

· github
  • Context Hub — CLI + feedback loop từ Andrew Ng
  • Context7 — MCP server, nói “use context7” là có docs

TL;DR

Cả hai tool đều giải quyết cùng một vấn đề: AI code dựa trên training data cũ → API hallucination. Context Hub (Andrew Ng) dùng CLI + feedback loop để docs tự improve. Context7 (Upstash) dùng MCP protocol, nói “use context7” là có docs ngay trong prompt.

Chọn cái nào:

  • Context Hub nếu muốn kiểm soát version, annotate docs, và tin vào community feedback loop
  • Context7 nếu muốn plug-and-play, đang dùng Cursor/Claude Code, không cần setup nhiều

Bài này dành cho ai?

1. Người dùng AI coding agents hàng ngày

Vấn đề: Claude/Copilot viết code với API cũ, phải Google sửa lại.

Khi nào cần: Build app dùng framework mới (Next.js 15, Supabase, etc) mà AI cứ viết syntax cũ.

Được gì: AI code đúng version, ít phải sửa tay.

2. Người build AI agents/tools

Vấn đề: Agent của mình cũng hallucinate API như Claude gốc.

Khi nào cần: Thiết kế coding agent cần access docs real-time.

Được gì: Kiến trúc rõ ràng để tích hợp docs vào agent workflow.

So sánh chi tiết

AspectContext HubContext7
CreatorAndrew Ng & teamUpstash
Cách dùngCLI: chub search, chub getMCP: nói “use context7” trong prompt
IntegrationAgent skills, CLI promptingCursor, Claude Code, Windsurf, 30+ tools
Độ phổ biếnMới ra (03/2026), đang buzz47k+ GitHub stars, mature
UniqueFeedback loop tự improve docsReal-time version-specific
LanguageJavaScript CLITypeScript MCP server

Context Hub: Feedback Loop

Điểm hay nhất của Context Hub là vòng lặp tự cải tiến:

  1. Agent fetch docs → code đúng hơn
  2. Gặp gap → agent annotate local
  3. Agent rate docs (up/down)
  4. Session sau có annotation sẵn
  5. Authors nhận feedback → improve docs
  6. Cả community hưởng lợi

CLI commands:

npm install -g @aisuite/chub
chub search openai          # tìm docs
chub get openai/chat --lang py  # fetch Python docs
chub annotate openai "thiếu streaming example"
chub feedback openai up     # rate docs

Annotations persist local — agent học qua sessions.

Context7: Plug-and-Play MCP

Điểm hay nhất: không cần thay đổi workflow.

Cách dùng:

  1. Setup MCP server (1 dòng)
  2. Thêm “use context7” vào prompt
  3. Done — AI tự fetch docs

Ví dụ:

Tạo auth middleware cho Next.js 14. use context7

AI sẽ tự gọi resolve-library-idquery-docs → inject docs vào context.

Setup Claude Code:

claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp

Điểm yếu mỗi tool

Context Hub:

  • Phải CLI command explicit
  • Docs coverage còn limited (mới launch)
  • Agent phải được train dùng chub commands

Context7:

  • Phụ thuộc community maintain docs
  • Không có feedback loop improve
  • Rate limit free tier

Quick Start

Tuần này:

  1. Nếu đang dùng Cursor/Claude Code → thử Context7, chỉ cần add “use context7”
  2. Nếu muốn control docs version → install chub, test với 1 API bạn hay dùng

Bước tiếp:

  • Context Hub: Thử annotate 1 docs thiếu → xem có persist qua session không
  • Context7: Test version targeting “Next.js 14 middleware” vs “Next.js 15 middleware”
#context-hub #context7 #ai-coding #documentation #mcp #andrew-ng
0:00

Chia sẻ ảnh

Bắt đầu gõ để tìm kiếm...