重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
npx skills add https://github.com/vm0-ai/vm0-skills --skill qdrant通过直接使用 curl 调用 Qdrant REST API,为 RAG、语义搜索和推荐系统存储和搜索向量嵌入。
官方文档:
https://qdrant.tech/documentation/
在以下场景中使用此技能:
export QDRANT_URL="https://xyz-example.aws.cloud.qdrant.io:6333"
export QDRANT_TOKEN="your-api-key"
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
使用 Docker 在本地运行 Qdrant:
docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant
export QDRANT_URL="http://localhost:6333"
export QDRANT_TOKEN="" # 本地运行时可选
以下所有示例均假设您已设置 QDRANT_URL 和 QDRANT_TOKEN。
验证与 Qdrant 的连接:
curl -s -X GET "$(printenv QDRANT_URL)" --header "api-key: $(printenv QDRANT_TOKEN)"
获取所有集合:
curl -s -X GET "$(printenv QDRANT_URL)/collections" --header "api-key: $(printenv QDRANT_TOKEN)"
创建一个用于存储向量的集合:
写入 /tmp/qdrant_request.json:
{
"vectors": {
"size": 1536,
"distance": "Cosine"
}
}
然后运行:
curl -s -X PUT "$(printenv QDRANT_URL)/collections/my_collection" --header "api-key: $(printenv QDRANT_TOKEN)" --header "Content-Type: application/json" -d @/tmp/qdrant_request.json
距离度量标准:
Cosine - 余弦相似度(推荐用于归一化向量)Dot - 点积Euclid - 欧几里得距离Manhattan - 曼哈顿距离常见向量维度:
text-embedding-3-small:1536text-embedding-3-large:3072获取集合的详细信息:
curl -s -X GET "$(printenv QDRANT_URL)/collections/my_collection" --header "api-key: $(printenv QDRANT_TOKEN)"
添加带有有效载荷(元数据)的向量:
写入 /tmp/qdrant_request.json:
{
"points": [
{
"id": 1,
"vector": [0.05, 0.61, 0.76, 0.74],
"payload": {"text": "Hello world", "source": "doc1"}
},
{
"id": 2,
"vector": [0.19, 0.81, 0.75, 0.11],
"payload": {"text": "Goodbye world", "source": "doc2"}
}
]
}
然后运行:
curl -s -X PUT "$(printenv QDRANT_URL)/collections/my_collection/points" --header "api-key: $(printenv QDRANT_TOKEN)" --header "Content-Type: application/json" -d @/tmp/qdrant_request.json
查找与查询向量相似的向量:
写入 /tmp/qdrant_request.json:
{
"query": [0.05, 0.61, 0.76, 0.74],
"limit": 5,
"with_payload": true
}
然后运行:
curl -s -X POST "$(printenv QDRANT_URL)/collections/my_collection/points/query" --header "api-key: $(printenv QDRANT_TOKEN)" --header "Content-Type: application/json" -d @/tmp/qdrant_request.json
响应:
{
"result": {
"points": [
{"id": 1, "score": 0.99, "payload": {"text": "Hello world"}}
]
}
}
通过有效载荷字段筛选结果:
写入 /tmp/qdrant_request.json:
{
"query": [0.05, 0.61, 0.76, 0.74],
"limit": 5,
"filter": {
"must": [
{"key": "source", "match": {"value": "doc1"}}
]
},
"with_payload": true
}
然后运行:
curl -s -X POST "$(printenv QDRANT_URL)/collections/my_collection/points/query" --header "api-key: $(printenv QDRANT_TOKEN)" --header "Content-Type: application/json" -d @/tmp/qdrant_request.json
筛选器操作符:
must - 所有条件必须匹配(AND)should - 至少一个条件必须匹配(OR)must_not - 不应匹配任何条件(NOT)检索特定点:
写入 /tmp/qdrant_request.json:
{
"ids": [1, 2],
"with_payload": true,
"with_vector": true
}
然后运行:
curl -s -X POST "$(printenv QDRANT_URL)/collections/my_collection/points" --header "api-key: $(printenv QDRANT_TOKEN)" --header "Content-Type: application/json" -d @/tmp/qdrant_request.json
通过 ID 删除:
写入 /tmp/qdrant_request.json:
{
"points": [1, 2]
}
然后运行:
curl -s -X POST "$(printenv QDRANT_URL)/collections/my_collection/points/delete" --header "api-key: $(printenv QDRANT_TOKEN)" --header "Content-Type: application/json" -d @/tmp/qdrant_request.json
通过筛选器删除:
写入 /tmp/qdrant_request.json:
{
"filter": {
"must": [
{"key": "source", "match": {"value": "doc1"}}
]
}
}
然后运行:
curl -s -X POST "$(printenv QDRANT_URL)/collections/my_collection/points/delete" --header "api-key: $(printenv QDRANT_TOKEN)" --header "Content-Type: application/json" -d @/tmp/qdrant_request.json
完全删除一个集合:
curl -s -X DELETE "$(printenv QDRANT_URL)/collections/my_collection" --header "api-key: $(printenv QDRANT_TOKEN)"
获取总数或筛选后的数量:
写入 /tmp/qdrant_request.json:
{
"exact": true
}
然后运行:
curl -s -X POST "$(printenv QDRANT_URL)/collections/my_collection/points/count" --header "api-key: $(printenv QDRANT_TOKEN)" --header "Content-Type: application/json" -d @/tmp/qdrant_request.json
常见的筛选条件:
{
"filter": {
"must": [
{"key": "city", "match": {"value": "London"}},
{"key": "price", "range": {"gte": 100, "lte": 500}},
{"key": "tags", "match": {"any": ["electronics", "sale"]}}
]
}
}
匹配类型:
match.value - 精确匹配match.any - 匹配列表中的任意项match.except - 不匹配列表中的任何项range - 数值范围(gt, gte, lt, lte)每周安装次数
64
代码仓库
GitHub 星标数
51
首次出现
2026年1月24日
安全审计
安装于
gemini-cli56
opencode53
github-copilot52
codex52
cursor52
cline50
Use the Qdrant REST API via direct curl calls to store and search vector embeddings for RAG, semantic search, and recommendations.
Official docs:
https://qdrant.tech/documentation/
Use this skill when you need to:
export QDRANT_URL="https://xyz-example.aws.cloud.qdrant.io:6333"
export QDRANT_TOKEN="your-api-key"
Run Qdrant locally with Docker:
docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant
export QDRANT_URL="http://localhost:6333"
export QDRANT_TOKEN="" # Optional for local
All examples below assume you have QDRANT_URL and QDRANT_TOKEN set.
Verify connection to Qdrant:
curl -s -X GET "$(printenv QDRANT_URL)" --header "api-key: $(printenv QDRANT_TOKEN)"
Get all collections:
curl -s -X GET "$(printenv QDRANT_URL)/collections" --header "api-key: $(printenv QDRANT_TOKEN)"
Create a collection for storing vectors:
Write to /tmp/qdrant_request.json:
{
"vectors": {
"size": 1536,
"distance": "Cosine"
}
}
Then run:
curl -s -X PUT "$(printenv QDRANT_URL)/collections/my_collection" --header "api-key: $(printenv QDRANT_TOKEN)" --header "Content-Type: application/json" -d @/tmp/qdrant_request.json
Distance metrics:
Cosine - Cosine similarity (recommended for normalized vectors)Dot - Dot productEuclid - Euclidean distanceManhattan - Manhattan distanceCommon vector sizes:
text-embedding-3-small: 1536text-embedding-3-large: 3072Get details about a collection:
curl -s -X GET "$(printenv QDRANT_URL)/collections/my_collection" --header "api-key: $(printenv QDRANT_TOKEN)"
Add vectors with payload (metadata):
Write to /tmp/qdrant_request.json:
{
"points": [
{
"id": 1,
"vector": [0.05, 0.61, 0.76, 0.74],
"payload": {"text": "Hello world", "source": "doc1"}
},
{
"id": 2,
"vector": [0.19, 0.81, 0.75, 0.11],
"payload": {"text": "Goodbye world", "source": "doc2"}
}
]
}
Then run:
curl -s -X PUT "$(printenv QDRANT_URL)/collections/my_collection/points" --header "api-key: $(printenv QDRANT_TOKEN)" --header "Content-Type: application/json" -d @/tmp/qdrant_request.json
Find vectors similar to a query vector:
Write to /tmp/qdrant_request.json:
{
"query": [0.05, 0.61, 0.76, 0.74],
"limit": 5,
"with_payload": true
}
Then run:
curl -s -X POST "$(printenv QDRANT_URL)/collections/my_collection/points/query" --header "api-key: $(printenv QDRANT_TOKEN)" --header "Content-Type: application/json" -d @/tmp/qdrant_request.json
Response:
{
"result": {
"points": [
{"id": 1, "score": 0.99, "payload": {"text": "Hello world"}}
]
}
}
Filter results by payload fields:
Write to /tmp/qdrant_request.json:
{
"query": [0.05, 0.61, 0.76, 0.74],
"limit": 5,
"filter": {
"must": [
{"key": "source", "match": {"value": "doc1"}}
]
},
"with_payload": true
}
Then run:
curl -s -X POST "$(printenv QDRANT_URL)/collections/my_collection/points/query" --header "api-key: $(printenv QDRANT_TOKEN)" --header "Content-Type: application/json" -d @/tmp/qdrant_request.json
Filter operators:
must - All conditions must match (AND)should - At least one must match (OR)must_not - None should match (NOT)Retrieve specific points:
Write to /tmp/qdrant_request.json:
{
"ids": [1, 2],
"with_payload": true,
"with_vector": true
}
Then run:
curl -s -X POST "$(printenv QDRANT_URL)/collections/my_collection/points" --header "api-key: $(printenv QDRANT_TOKEN)" --header "Content-Type: application/json" -d @/tmp/qdrant_request.json
Delete by IDs:
Write to /tmp/qdrant_request.json:
{
"points": [1, 2]
}
Then run:
curl -s -X POST "$(printenv QDRANT_URL)/collections/my_collection/points/delete" --header "api-key: $(printenv QDRANT_TOKEN)" --header "Content-Type: application/json" -d @/tmp/qdrant_request.json
Delete by filter:
Write to /tmp/qdrant_request.json:
{
"filter": {
"must": [
{"key": "source", "match": {"value": "doc1"}}
]
}
}
Then run:
curl -s -X POST "$(printenv QDRANT_URL)/collections/my_collection/points/delete" --header "api-key: $(printenv QDRANT_TOKEN)" --header "Content-Type: application/json" -d @/tmp/qdrant_request.json
Remove a collection entirely:
curl -s -X DELETE "$(printenv QDRANT_URL)/collections/my_collection" --header "api-key: $(printenv QDRANT_TOKEN)"
Get total count or filtered count:
Write to /tmp/qdrant_request.json:
{
"exact": true
}
Then run:
curl -s -X POST "$(printenv QDRANT_URL)/collections/my_collection/points/count" --header "api-key: $(printenv QDRANT_TOKEN)" --header "Content-Type: application/json" -d @/tmp/qdrant_request.json
Common filter conditions:
{
"filter": {
"must": [
{"key": "city", "match": {"value": "London"}},
{"key": "price", "range": {"gte": 100, "lte": 500}},
{"key": "tags", "match": {"any": ["electronics", "sale"]}}
]
}
}
Match types:
match.value - Exact matchmatch.any - Match any in listmatch.except - Match none in listrange - Numeric range (gt, gte, lt, lte)Weekly Installs
64
Repository
GitHub Stars
51
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli56
opencode53
github-copilot52
codex52
cursor52
cline50
超能力技能使用指南:AI助手技能调用优先级与工作流程详解
53,700 周安装