用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/sandraschi/local-llm-mcp --skill rag-expert命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | rag-expert |
| description | Local vector search via LanceDB + sentence-transformers, shared as a service for the whole fleet |
This server hosts an optional RAG-as-a-service endpoint that lightweight fleet MCP repos
can use instead of shipping their own vector stack. The service uses all-MiniLM-L6-v2
embeddings stored in LanceDB.
| Situation | Use shared RAG? |
|---|---|
| Repo has < 500 lines of Python | Yes — skip lanceDB + sentence-transformers dep |
| Repo needs cross-corpus search | Yes — one index, one query |
| Repo has private/sensitive data | No — keep local RAG |
| Repo has custom chunking/metadata | No — keep local RAG |
| Repo already has LanceDB | No — don't change |
| Method | Path | Body / Params | Returns |
|---|---|---|---|
POST | /api/v1/rag/ingest | {"text", "source"?, "metadata"?} | {"success", "total_docs"} |
GET | /api/v1/rag/search | ?query=&limit= | [{text, source, metadata, score}] |
DELETE | /api/v1/rag/clear | — | {"success", "cleared": true} |
GET | /api/v1/rag/status | — | {"available", "model", "total_docs"} |
import httpx
rag = "http://localhost:10833/api/v1/rag"
# Ingest
httpx.post(f"{rag}/ingest", json={"text": "Attention is all you need...", "source": "arxiv:1706.03762"})
# Search
r = httpx.get(f"{rag}/search", params={"query": "transformer paper", "limit": 3})
for hit in r.json():
print(f" [{hit['score']}] {hit['source']}: {hit['text'][:80]}...")
import httpx
def ingest_url(url: str):
resp = httpx.get(url, timeout=30)
resp.raise_for_status()
text = resp.text[:50000] # cap at 50k chars
httpx.post("http://localhost:10833/api/v1/rag/ingest", json={
"text": text,
"source": url,
})
def search_sources(query: str) -> list[str]:
r = httpx.get("http://localhost:10833/api/v1/rag/search", params={"query": query, "limit": 10})
return list(set(h["source"] for h in r.json() if h.get("source")))