RAG向量服务

一个基于RAG(检索增强生成)技术的向量服务,用于本地部署和查询API。

  • by AppliNH
  • Go
  • 本地部署
  • 更新于
在 GitHub 查看 AppliNH/mcp-rag-vector

使用说明

mcp-rag矢量

使用Claude Desktop配置MCP

  1. 在GOBIN中生成代码安装:
make generate-code-design
make install-bin
  1. 在Claude Desktop设置中配置以下内容:
{
  "mcpServers": {
    "greetingmcp": {
      "command": "$GOPATH/bin/mcp-rag-vector",
      "args": ["mcp"]
    }
  }
}

本地使用ollama

  1. 安装ollama并运行 ollama serve

  2. 启动堆栈

docker compose up -d --build
  1. 等待模型下载(2 GB)

  2. 查询API

curl -X POST http://localhost:8000/api/chat \
  -H "Content-Type: application/json" \
  -d '{
    "model": "llama3.2:3b",
    "messages": [
      { "role": "user", "content": "Use the greet tool with my name thomas, return what it says" }
    ],
    "stream": false
  }'

通过cURL查询MCP

  1. 启动API

docker-commpose up 或 make run-server

  1. 使用 make http-call-mcp