Context7
ส่งคู่มือการใช้ไลบรารีและเฟรมเวิร์กรุ่นล่าสุดให้ AI อ่านก่อนตอบ ช่วยให้โค้ดที่ AI เขียนไม่ใช้คำสั่งเก่าที่เลิกใช้แล้ว
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
Generate QA datasets & evaluate RAG systems with failure diagnosis. Any LLM.
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
OPENAI_API_KEY, ANTHROPIC_API_KEYค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json
{
"mcpServers": {
"ragscore": {
"command": "uvx",
"args": [
"ragscore"
],
"env": {
"OPENAI_API_KEY": "ใส่ค่าของคุณ",
"ANTHROPIC_API_KEY": "ใส่ค่าของคุณ"
}
}
}
}พิมพ์คำสั่งนี้ใน Terminal
claude mcp add ragscore --env OPENAI_API_KEY='ใส่ค่าของคุณ' --env ANTHROPIC_API_KEY='ใส่ค่าของคุณ' -- uvx ragscoreเติมค่าที่เว้นว่างไว้ก่อนรัน
วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"ragscore": {
"command": "uvx",
"args": [
"ragscore"
],
"env": {
"OPENAI_API_KEY": "ใส่ค่าของคุณ",
"ANTHROPIC_API_KEY": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"ragscore": {
"type": "stdio",
"command": "uvx",
"args": [
"ragscore"
],
"env": {
"OPENAI_API_KEY": "ใส่ค่าของคุณ",
"ANTHROPIC_API_KEY": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub HZYAI ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
ต้องใส่ค่าเหล่านี้: OPENAI_API_KEY, ANTHROPIC_API_KEY
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.8.6) เข้า registry 6 เดือนที่ผ่านมา
โปรแกรมที่รองรับ 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 รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
Generate QA datasets & evaluate RAG systems in 2 commands
🔒 Privacy-First • ⚡ Lightning Fast • 🤖 Any LLM • 🏠 Local or Cloud • 🌍 Multilingual
English | 中文 | 日本語 | Deutsch
# Step 1: Generate QA pairs from your docs
ragscore generate docs/
ragscore evaluate http://localhost:8000/query
That's it. Get accuracy scores and incorrect QA pairs instantly.
============================================================
✅ EXCELLENT: 85/100 correct (85.0%) Average Score: 4.20/5.0 ============================================================
❌ 15 Incorrect Pairs:
pip install ragscore # Core (works with Ollama)
pip install "ragscore[openai]" # + OpenAI support pip install "ragscore[notebook]" # + Jupyter/Colab support pip install "ragscore[all]" # + All providers
Already installed? Keep up to date — new versions add features like failure diagnosis and retrieved context capture:
`bash
pip install --upgrade ragscore
`
Perfect for Jupyter, Colab, and rapid iteration. Get instant visualizations.
from ragscore import quick_test
result = quick_test( endpoint="http://localhost:8000/query", # Your RAG API docs="docs/", # Your documents n=10, # Number of test questions )
result = quick_test( endpoint="http://localhost:8000/query", docs="docs/", audience="developers", # Who asks the questions? purpose="api-integration", # What's the document for? )
result.plot()
bad_rows = result.df[result.df['score'] < 3] display(bad_rows[['question', 'rag_answer', 'reason']])
Rich Object API:
result.accuracy - Accuracy scoreresult.df - Pandas DataFrame of all resultsresult.plot() - 3-panel visualization (4-panel with detailed=True)result.corrections - List of items to fix# Set API key (or use local Ollama - no key needed!)
export OPENAI_API_KEY="sk-..."
ragscore generate paper.pdf ragscore generate docs/*.pdf --concurrency 10
ragscore generate docs/ --audience developers --purpose faq ragscore generate docs/ --audience customers --purpose "pre-sales" ragscore generate docs/ --audience "compliance auditors" --purpose "security audit"
# Point to your RAG endpoint
ragscore evaluate http://localhost:8000/query
ragscore evaluate http://api/ask --model gpt-4o --output results.json
Go beyond a single score. Add detailed=True to get 5 diagnostic dimensions per answer — in the same single LLM call.
result = quick_test(
endpoint=my_rag, docs="docs/", n=10, detailed=True, # ⭐ Enable multi-metric evaluation )
display(result.df[[ "question", "score", "correctness", "completeness", "relevance", "conciseness", "faithfulness" ]])
result.plot()
================================================== ✅ PASSED: 9/10 correct (90%) Average Score: 4.3/5.0 Threshold: 70% ────────────────────────────────────────────────── Correctness: 4.5/5.0 Completeness: 4.2/5.0 Relevance: 4.8/5.0 Conciseness: 4.1/5.0 Faithfulness: 4.6/5.0 ==================================================
| Metric | What it measures | Scale |
|---|---|---|
| Correctness | Semantic match to golden answer | 5 = fully correct |
| Completeness | Covers all key points | 5 = fully covered |
| Relevance | Addresses the question asked | 5 = perfectly on-topic |
| Conciseness | Focused, no filler | 5 = concise and precise |
| Faithfulness | No fabricated claims | 5 = fully faithful |
CLI:
ragscore evaluate http://localhost:8000/query --detailed
--diagnose)When answers fail, --diagnose tells you why — retriever miss, generator hallucination, incomplete answer, or wrong interpretation:
ragscore evaluate http://localhost:8000/query --diagnose
🔍 Failure Diagnosis:
Retriever Miss: 3 (42.9%) Generator Hallucination: 2 (28.6%) Incomplete Answer: 1 (14.3%) Wrong Interpretation: 1 (14.3%)
Uses the support_span already generated with each QA pair to give the judge grounding context. Combine with --detailed for full diagnostics:
ragscore evaluate http://localhost:8000/query --diagnose --detailed -o results.json
| Category | Meaning |
|---|---|
| Retriever Miss | RAG didn't retrieve the chunk containing the evidence |
| Generator Hallucination | Retrieved correctly but fabricated information |
| Incomplete Answer | Retrieved correctly but answer is partial |
| Wrong Interpretation | Retrieved correctly but misunderstood the content |
📓 Full demo notebook — build a mini RAG and test it with detailed metrics.
🎯 Audience & Purpose demo — generate tailored QA for developers, customers, auditors, and more.
🏠 Ollama local demo — 100% private RAG evaluation with no API keys.
# Use Ollama - no API keys, no cloud, 100% private
ollama pull llama3.1 ragscore generate confidential_docs/*.pdf ragscore evaluate http://localhost:8000/query
Perfect for: Healthcare 🏥 • Legal ⚖️ • Finance 🏦 • Research 🔬
RAGScore generates complex structured QA pairs (question + answer + rationale + support span) in JSON format. This requires models with strong instruction-following and JSON output capabilities.
| Model | Size | Min RAM | QA Quality | Recommended |
|---|---|---|---|---|
llama3.1:70b | 40GB | 48GB VRAM | Excellent | GPU server (A100, L40) |
qwen2.5:32b | 18GB | 24GB VRAM | Excellent | GPU server (A10, L20) |
llama3.1:8b | 4.7GB | 8GB VRAM | Good | Best local choice |
qwen2.5:7b | 4.4GB | 8GB VRAM | Good | Good local alternative |
mistral:7b | 4.1GB | 8GB VRAM | Good | Good local alternative |
llama3.2:3b | 2.0GB | 4GB RAM | Fair | CPU-only / testing |
qwen2.5:1.5b | 1.0GB | 2GB RAM | Poor | Not recommended |
Minimum recommended: 8B+ models. Smaller models (1.5B–3B) produce lower quality support spans and may timeout on longer chunks.
# Recommended: 8B model with concurrency 2 for local machines
ollama pull llama3.1:8b ragscore generate docs/ --provider ollama --model llama3.1:8b
ollama pull qwen2.5:32b ragscore generate docs/ --provider ollama --model qwen2.5:32b --concurrency 5
Expected performance (28 chunks, 5 QA pairs per chunk):
| Hardware | Model | Time | Concurrency |
|---|---|---|---|
| MacBook (CPU) | llama3.2:3b | ~45 min | 2 |
| MacBook (CPU) | llama3.1:8b | ~25 min | 2 |
| A10 (24GB) | llama3.1:8b | ~3–5 min | 5 |
| L20/L40 (48GB) | qwen2.5:32b | ~3–5 min | 5 |
| OpenAI API | gpt-4o-mini | ~2 min | 10 |
RAGScore auto-reduces concurrency to 2 for local Ollama to avoid GPU/CPU contention.
| Provider | Setup | Notes |
|---|---|---|
| Ollama | ollama serve | Local, free, private |
| OpenAI | export OPENAI_API_KEY="sk-..." | Best quality |
| Anthropic | export ANTHROPIC_API_KEY="..." | Long context |
| DashScope | export DASHSCOPE_API_KEY="..." | Qwen models |
| vLLM | export LLM_BASE_URL="..." | Production-grade |
| Any OpenAI-compatible | export LLM_BASE_URL="..." | Groq, Together, etc. |
output/generated_qas.jsonl){
"id": "abc123", "question": "What is RAG?", "answer": "RAG (Retrieval-Augmented Generation) combines...", "rationale": "This is explicitly stated in the introduction...", "support_span": "RAG systems retrieve relevant documents...", "difficulty": "medium", "source_path": "docs/rag_intro.pdf" }
--output results.json){
"summary": { "total": 100, "correct": 85, "incorrect": 15, "accuracy": 0.85, "avg_score": 4.2 }, "incorrect_pairs": [ { "question": "What is RAG?", "golden_answer": "RAG combines retrieval with generation...", "rag_answer": "RAG is a database system.", "score": 2, "reason": "Factually incorrect - RAG is not a database" } ] }
from ragscore import run_pipeline, run_evaluation
run_pipeline(paths=["docs/"], concurrency=10)
run_pipeline( paths=["docs/"], audience="support engineers", purpose="fine-tuning a support chatbot", )
results = run_evaluation( endpoint="http://localhost:8000/query", model="gpt-4o", # LLM for judging ) print(f"Accuracy: {results.accuracy:.1%}")
RAGScore is designed for AI agents and automation:
# Structured CLI with predictable output
ragscore generate docs/ --concurrency 5 ragscore evaluate http://api/query --output results.json
CLI Reference:
| Command | Description |
|---|---|
ragscore generate | Generate QA pairs from documents |
ragscore generate --audience | Tailored QA for specific audience |
ragscore generate --purpose | Focus QA on document purpose |
ragscore evaluate | Evaluate RAG against golden QAs |
ragscore evaluate --detailed | Multi-metric evaluation |
ragscore evaluate --diagnose | Failure root-cause classification |
ragscore --help | Show all commands and options |
ragscore generate --help | Show generate options |
ragscore evaluate --help | Show evaluate options |
Zero config required. Optional environment variables:
export RAGSCORE_CHUNK_SIZE=512 # Chunk size for documents
export RAGSCORE_QUESTIONS_PER_CHUNK=5 # QAs
ตัดมาแค่ช่วงต้น อ่านต่อใน repo