Context7
ส่งคู่มือการใช้ไลบรารีและเฟรมเวิร์กรุ่นล่าสุดให้ AI อ่านก่อนตอบ ช่วยให้โค้ดที่ AI เขียนไม่ใช้คำสั่งเก่าที่เลิกใช้แล้ว
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
Knowledge-graph RAG for multi-language codebases: index, query and edit code in natural language.
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
ORCHESTRATOR_PROVIDER, ORCHESTRATOR_MODEL, ORCHESTRATOR_API_KEY, CYPHER_PROVIDER, CYPHER_MODEL, CYPHER_API_KEY, MEMGRAPH_HOST, MEMGRAPH_PORT, TARGET_REPO_PATHค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json
{
"mcpServers": {
"code-graph-rag": {
"command": "uvx",
"args": [
"code-graph-rag",
"mcp-server"
],
"env": {
"ORCHESTRATOR_PROVIDER": "ใส่ค่าของคุณ",
"ORCHESTRATOR_MODEL": "ใส่ค่าของคุณ",
"ORCHESTRATOR_API_KEY": "ใส่ค่าของคุณ",
"CYPHER_PROVIDER": "ใส่ค่าของคุณ",
"CYPHER_MODEL": "ใส่ค่าของคุณ",
"CYPHER_API_KEY": "ใส่ค่าของคุณ",
"MEMGRAPH_HOST": "ใส่ค่าของคุณ",
"MEMGRAPH_PORT": "ใส่ค่าของคุณ",
"TARGET_REPO_PATH": "ใส่ค่าของคุณ"
}
}
}
}พิมพ์คำสั่งนี้ใน Terminal
claude mcp add code-graph-rag --env ORCHESTRATOR_PROVIDER='ใส่ค่าของคุณ' --env ORCHESTRATOR_MODEL='ใส่ค่าของคุณ' --env ORCHESTRATOR_API_KEY='ใส่ค่าของคุณ' --env CYPHER_PROVIDER='ใส่ค่าของคุณ' --env CYPHER_MODEL='ใส่ค่าของคุณ' --env CYPHER_API_KEY='ใส่ค่าของคุณ' --env MEMGRAPH_HOST='ใส่ค่าของคุณ' --env MEMGRAPH_PORT='ใส่ค่าของคุณ' --env TARGET_REPO_PATH='ใส่ค่าของคุณ' -- uvx code-graph-rag mcp-serverเติมค่าที่เว้นว่างไว้ก่อนรัน
วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"code-graph-rag": {
"command": "uvx",
"args": [
"code-graph-rag",
"mcp-server"
],
"env": {
"ORCHESTRATOR_PROVIDER": "ใส่ค่าของคุณ",
"ORCHESTRATOR_MODEL": "ใส่ค่าของคุณ",
"ORCHESTRATOR_API_KEY": "ใส่ค่าของคุณ",
"CYPHER_PROVIDER": "ใส่ค่าของคุณ",
"CYPHER_MODEL": "ใส่ค่าของคุณ",
"CYPHER_API_KEY": "ใส่ค่าของคุณ",
"MEMGRAPH_HOST": "ใส่ค่าของคุณ",
"MEMGRAPH_PORT": "ใส่ค่าของคุณ",
"TARGET_REPO_PATH": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"code-graph-rag": {
"type": "stdio",
"command": "uvx",
"args": [
"code-graph-rag",
"mcp-server"
],
"env": {
"ORCHESTRATOR_PROVIDER": "ใส่ค่าของคุณ",
"ORCHESTRATOR_MODEL": "ใส่ค่าของคุณ",
"ORCHESTRATOR_API_KEY": "ใส่ค่าของคุณ",
"CYPHER_PROVIDER": "ใส่ค่าของคุณ",
"CYPHER_MODEL": "ใส่ค่าของคุณ",
"CYPHER_API_KEY": "ใส่ค่าของคุณ",
"MEMGRAPH_HOST": "ใส่ค่าของคุณ",
"MEMGRAPH_PORT": "ใส่ค่าของคุณ",
"TARGET_REPO_PATH": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
ORCHESTRATOR_PROVIDER envORCHESTRATOR_MODEL envCYPHER_PROVIDER envCYPHER_MODEL envMEMGRAPH_HOST envMEMGRAPH_PORT envTARGET_REPO_PATH envค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub vitali87 ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
ต้องใส่ค่าเหล่านี้: ORCHESTRATOR_API_KEY, CYPHER_API_KEY
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.5.0) เข้า registry 3 วันที่ผ่านมา
โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Python (uv) ในเครื่องด้วย
ในหมวดเดียวกันมี Context7, Codebase Memory, Exa
server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว
อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi
ส่งคู่มือการใช้ไลบรารีและเฟรมเวิร์กรุ่นล่าสุดให้ AI อ่านก่อนตอบ ช่วยให้โค้ดที่ AI เขียนไม่ใช้คำสั่งเก่าที่เลิกใช้แล้ว
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Connect AI agents to Exa for web search, content fetching, and multi-step research.
ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
Code-Graph-RAG parses a multi-language codebase with Tree-sitter, sharpened by compiler-grade frontends and runtime traces where available, builds a knowledge graph of its structure in an embedded graph database that needs no server, and lets you query, edit, and optimise that code in plain English. It works across a monorepo of mixed languages under one unified graph schema.
See NEWS.md for the full history.
Point Code-Graph-RAG at a repository and it reads every source file, extracts functions, classes, methods, modules, and the relationships between them, and stores the result as an interconnected graph. Once the graph exists you can:
cgr trace and merge the calls that actually happened into the graph, exposing dispatch that static analysis cannot see.The system has two components:
go/types for Go, and opt-in Roslyn, javac and Jedi for C#, Java and Python), and dynamic tracing merges calls observed at runtime. Tree-sitter stays the backbone: a trace only sees code that ran, and a compiler frontend only covers what its toolchain can build.codebase_rag/). An interactive CLI that turns natural language into Cypher queries, retrieves matching code, and drives AI-powered editing and optimisation.Source Code -> Tree-sitter Parser -> AST Analysis -> Knowledge Graph
| User Query -> AI Model (Cypher Gen) -> Cypher Query -> Graph Results -> Response
The graph is stored in an embedded SQLite file by default. Memgraph and Neo4j are opt-in backends that run the same Cypher; Graph Backends compares them.
See the Architecture Overview and Graph Schema for the full picture.
Python, TypeScript, TSX, JavaScript, Rust, Go, Java, C, C++, C#, PHP, Lua, Dart, and Julia are fully supported. Scala is in development, and Ruby, Kotlin, Swift, Elixir, Haskell, Solidity, Bash, and Nix have structural support (modules, functions, classes where the language has them, and imports) through the pluggable ast-grep tier. See the Language Support matrix for per-language capabilities.
cgr is published to PyPI. Install it system-wide with the treesitter-full (tree-sitter grammars), ast-grep (Ruby, Kotlin, Swift, Elixir, Haskell, Solidity, Bash, Nix) and semantic (vector search) extras:
# with uv (recommended)
uv tool install "code-graph-rag[treesitter-full,ast-grep,semantic]"
pipx install "code-graph-rag[treesitter-full,ast-grep,semantic]"
Three version lines exist and they intentionally differ:
| where | what it tracks |
|---|---|
| git tags | every version, one per merge |
| GitHub Releases (binaries, signatures) | every 50th version, plus any security fix, breaking change or merge labelled release now |
| PyPI | every 50th version, plus any security fix, breaking change or merge labelled release now |
So the newest tag on main usually runs ahead of the newest release, often by tens of patch versions; they coincide only just after a release. Nothing is stuck, the cadences differ by design. A security fix, a breaking change or a merge a maintainer labels release now does NOT wait for the cadence: each ships a release and a PyPI upload immediately.
uv tool install and pipx install give you the newest PyPI version, which is the newest RELEASE, not the newest tag. Interim tags exist so every merge is addressable; binaries and PyPI uploads follow the cadence above.
To run code newer than the latest release, install from git:
uv tool install "code-graph-rag[treesitter-full,ast-grep,semantic] @ git+https://github.com/vitali87/code-graph-rag@main"
To upgrade an existing install, run uv tool upgrade code-graph-rag (with pipx, pipx upgrade code-graph-rag, or pipx reinstall code-graph-rag for a git install). Upgrade covers the other install methods.
You also need Python 3.12+ and ripgrep. The graph lives in an embedded SQLite file by default, so there is no database server to run: no Docker and no cmake. Memgraph and Neo4j remain available as opt-in backends (Graph Backends). Full prerequisites, source installs, and environment setup are in the Installation guide.
[!NOTE]
The wheel is pure Python (
py3-none-any), so it installs on any platform with Python 3.12 or newer. Older system interpreters (Debian Bookworm ships 3.11) need the interpreter pinned explicitly; see Installation for the commands.
# Parse a repository into the graph, then query it
cgr start --repo-path /path/to/repo --update-graph cgr start --repo-path /path/to/repo
The graph is written to ~/.cgr/graph.sqlite (set SQLITE_GRAPH_PATH to move it). To use Memgraph instead, install the driver with the memgraph extra, set GRAPH_BACKEND=memgraph, and start the packaged Memgraph + Qdrant stack with cgr daemon up.
Repeat the first command for each repository you want indexed; the graph is shared, and syncing one project leaves the others alone. To start over from an empty graph, add --clean — it deletes every project in the shared graph, not just this one, and asks for confirmation first when other projects would be destroyed.
A default index leaves out the opt-in capture groups; add them with --capture or CGR_CAPTURE.
The Quick Start guide walks through parsing, querying, and exporting in five minutes.
Code-Graph-RAG runs as an MCP server so Claude Code and other MCP clients can query and edit your codebase directly. See the MCP Server guide for setup.
Getting Started
User Guide
Architecture
Python SDK
Advanced
Code-Graph-RAG is open source and free to use. For organisations that need more, we offer fully managed cloud-hosted solutions and on-premise deployments:
-
ตัดมาแค่ช่วงต้น อ่านต่อใน repo