VectorSmith
VectorSmith
你的向量数据库,锻造成智能体真正能用的工具。
编写一个 tools.yaml。VectorSmith 会将其编译成带类型、带租户隔离的工具——然后你可以在 Python 中 import 它们,或通过 MCP serve 它们。
它是什么 · 工作原理 · 编写 YAML · Python · Claude / Codex / Cursor · 试试看 · 文档
为什么存在
与你的发票、工单或目录对话的智能体,通常只能得到两个糟糕的选项:
典型做法 | 问题所在 |
厂商 MCP(Qdrant / Pinecone / …) | 集群管理工具。upsert、delete、create-collection。模型可能乱跑。 |
手工将 JSON schema 绑定到 LangChain / OpenAI SDK | 你得在 Python 里重新实现过滤器、限制和租户隔离。每个智能体都复制一遍。 |
“直接在系统提示词里嵌入并 | 没有类型化参数。没有枚举。没有隐藏的 |
VectorSmith 是第三个选项:数据存储仍然是你的。工具是一份 YAML 契约。 编译器将该契约转换为 MCP schema 或进程内工具。智能体永远看不到 URL、API 密钥或租户过滤器。
you write VectorSmith the agent sees
───────────── ───────────────── ────────────────
tools.yaml ──▶ interpolate → validate → compile ──▶ search_invoices
tenant: acme Engine stays internal query, client, status
${QDRANT_URL} (no tenant, no URL)Related MCP server: openapi-mcp-server
工作原理
flowchart LR
subgraph author["You"]
Y["tools.yaml"]
E[".env / ${VAR}"]
end
subgraph vs["VectorSmith"]
L["load + secret lint"]
V["validate VBxxxx"]
C["compile schemas + plan"]
end
subgraph out["Consume once"]
P["load_tools() / connect()"]
M["vectorsmith serve"]
end
subgraph hosts["Hosts"]
A["LangChain · LangGraph · Agents SDK · Anthropic"]
H["Claude · Codex · Cursor · claude.ai"]
end
Y --> L
E --> L
L --> V --> C
C --> P --> A
C --> M --> H一个文件,两个入口。同一套编译后的工具。
Python 应用 | 聊天 / IDE 宿主 | |
安装 |
|
|
调用 |
|
|
进程 | 进程内。无子进程。 | 宿主派生 CLI(MCP stdio 或 HTTP) |
混入 | 你的 | 其他 |
你不需要导入执行器。你不需要把 inputSchema 复制到 LLM SDK 中。
编写工具而非提示词
一个工具包含:名称、描述(让模型选择它)、集合、可选的文本搜索、模型可以传递的参数,以及模型绝不能看到的过滤器:
tds_version: "1"
connections:
invoices:
backend: qdrant
url: ${QDRANT_URL} # secrets only here, only as ${VAR}
api_key: ${QDRANT_API_KEY:-}
tools:
- name: search_invoices
kind: search
description: >
Search invoices by free text and filter by client, status, or amount.
Use when the user asks about invoices, billing, or payments.
target: { connection: invoices, collection: invoices }
query: { param: query, required: false }
static_filters:
- { path: tenant, op: eq, value: acme } # hidden from the model
parameters:
- { name: client, path: client_name, dtype: keyword, op: eq }
- { name: status, path: status, dtype: keyword, op: in,
enum: [draft, sent, paid, overdue] }
- { name: min_amount, path: amount, dtype: float, op: gte }
output:
fields: [invoice_id, client_name, status, amount]
limit_default: 10
limit_max: 50vectorsmith init ./demo 会写入一个入门文件。完整字段列表——种类、运算符、流水线、内置项、每个后端——见 docs/tools-yaml-reference.md。
模型看到的内容
{
"name": "search_invoices",
"description": "Search invoices by free text and filter by client, status, or amount. …",
"inputSchema": {
"type": "object",
"properties": {
"query": { "type": "string" },
"client": { "type": "string" },
"status": {
"type": "array",
"items": { "type": "string", "enum": ["draft", "sent", "paid", "overdue"] }
},
"min_amount": { "type": "number" },
"limit": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 }
}
}
}tenant: acme 不在该 schema 中。引擎在每次调用时都会将其 AND 进去。凭据永远不会离开 connections。
你可以声明的种类
| 用途 | 典型工具 |
| 语义检索 + 过滤器 |
|
| 精确 id,限制 1 |
|
| “有多少逾期?” |
|
| 过滤 / 分页,无 ANN | 列表式工具 |
| 检索 → | 每个客户前 N 条 |
内置项(search_<connection>、get_<connection>_by_id 等)在连接上是可选启用的。如果你已经用相同名称命名了用户工具,就把它们关掉。
在你的智能体中(Python)
pip install "vectorsmith[qdrant,langchain]"from vectorsmith import load_tools
from langchain.agents import create_agent
tools = load_tools("tools.invoices.yaml", "tools.tickets.yaml")
agent = create_agent("openai:gpt-4.1", tools)
# … await tools.aclose()同一份 YAML,其他技术栈:
from vectorsmith.langgraph import load_tools # create_react_agent / ToolNode
from vectorsmith.openai_agents import load_tools # Agent + Runner
from vectorsmith.anthropic import load_tools # messages.create(tools=vs.tools)
from vectorsmith import connect # await vs.call("search_invoices", {…})附加项 | 导入 |
|
|
| 相同工具;LangGraph 图 |
|
|
|
|
可运行的示例应用:examples/langchain_agent · langgraph_agent · openai_agents · anthropic_agent。
在 Claude、Codex、Cursor 中
这些产品无法 import vectorsmith。它们会派生一个进程。让它们指向 serve,使用同一份 YAML。
{
"mcpServers": {
"invoices": {
"command": "vectorsmith",
"args": ["serve", "tools.invoices.yaml", "--name", "invoices"]
}
}
}Codex 使用 TOML(~/.codex/config.toml),不是 JSON。Claude Code 使用 .mcp.json——它不会读取 Desktop 配置文件。
宿主 | 配置 | 指南 |
Claude Desktop |
| |
Claude Code |
| |
OpenAI Codex |
| |
Cursor |
| |
claude.ai |
|
可直接复制的片段:examples/mcp_hosts/。Slack、GitHub、文件系统保持为独立服务器——共存。
存储
连接上的 backend 是六个内置适配器之一。完整矩阵(附加项、混合检索、嵌套路径):向量存储。
qdrant · pgvector · chroma · pinecone · weaviate · milvus
pgvector 可以表模式运行(无向量列),用于 lookup / count / scroll。混合检索按能力门控(Qdrant / Weaviate / Milvus / Pinecone),并用 validate --live 检查。
试试看
发票示例是一个 tools.yaml 加一个环境变量文件。复制 .env.example 并在 validate / test / serve 之前将 QDRANT_URL 设置为你的集群。
# clone, then:
uv sync
uv run vectorsmith validate examples/qdrant_invoices/tools.invoices.yaml \
--env-file examples/qdrant_invoices/.env.example
uv run vectorsmith test examples/qdrant_invoices/tools.invoices.yaml search_invoices \
--args '{"query":"Globex invoice","limit":3}' \
--env-file examples/qdrant_invoices/.env.example
uv run vectorsmith serve examples/qdrant_invoices/tools.invoices.yaml --name invoices \
--env-file examples/qdrant_invoices/.env.example工单是第二个文件 / 第二个 MCP 名称:tools.tickets.yaml → --name tickets。
CLI
命令 | 作用 |
| 写入入门 |
| 编译 + lint。 |
| 不启动服务,直接调用一个编译后的工具 |
| MCP stdio(Desktop / Codex / Cursor; |
| 将集合 / 字段元数据输出到 |
|
|
| 内置 HTTP OAuth 的 |
validate 退出码为 0 / 1(--strict 警告)/ 2(错误)。test 和 introspect 在实时失败时使用 3。serve --http --auth none 在非 localhost 上退出码为 3。
文档
kjgpta.github.io/vectorsmith 是渲染后的手册(Material for MkDocs)。源码在 docs/。
我想…… | 前往这里 |
五分钟内让一个工具跑起来 | |
看看内置了哪些向量存储 | |
理解 | |
接入 Claude、Codex、Cursor、LangChain 等 | |
查一个 CLI 标志 | |
从 Python 调用工具 | |
解决 Desktop 断连 / 环境变量 / HTTP 认证 | |
复制一份宿主配置 | |
查看智能体应用 |
开发
uv sync
uv run ruff check .
uv run pytest -m "not conformance"
uv run lint-imports工作区:packages/core(vectorsmith_core,未发布)· packages/cli(已发布 vectorsmith)。Core 不得导入 CLI。
锻造工具。守住存储。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI-powered generation of production-ready CTP (ConveniencePro Tool Protocol) tools from natural language descriptions, including tool definitions, implementations, tests, and TypeScript validation.512MIT
- Alicense-qualityCmaintenanceConverts any OpenAPI/Swagger API specification into MCP tools that AI assistants can use to interact with the API.247MIT
- AlicenseBqualityCmaintenanceTransforms OpenAPI definitions into MCP tools for seamless LLM-API integration.8391MIT
- Flicense-qualityDmaintenanceAggregates tools from multiple MCP servers, generates TypeScript definitions, and executes custom TypeScript scripts to orchestrate cross-server tool calls.
Related MCP Connectors
Point Gecko at an OpenAPI spec; get first-call-correct, auth-hidden agent tools.
Reliable async execution for agent tool calls: schema gating, retries, idempotency, audit trail.
33 tools that make AI write, implement, and verify intent against explicit, testable constraints.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kjgpta/vectorsmith'
If you have feedback or need assistance with the MCP directory API, please join our Discord server