360 Secure SkillHub
360 安全技能中心

Vector Store Shootout

封装numpy、lancedb等8种向量存储实现,提供统一Python VectorStore接口,切换后端仅需修改一行代码。支持向量添加、搜索、删除等核心操作,各后端适配不同场景:如numpy用于小数据原型,qdrant适合生产环境,pgvector适配已有Postgres部署。可用于RAG后端评估、对比,快速构建向量搜索或RAG应用,还给出各后端适用场景与性能结论。

nissan
nissan
热度 60.08
最近更新 2026-05-17 13:36:38
分类:开发依赖:代码执行 / 读写文件 / 第三方 API应用场景:API 集成 / 数据处理 / 研究

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add vector-store-shootout
Metadata
name
vector-store-shootout
version
1.0.0
description
8 vector store implementations behind a common interface — numpy, lancedb, qdrant, pgvector, weaviate, weaviate_hybrid, milvus, lightrag. Use when evaluating RAG backends, building vector search, or comparing embedding stores. Each backend is a drop-in replacement via the base class.
metadata
{"openclaw":{"emoji":"🔍","requires":{"bins":["python3"],"env":[]},"primaryEnv":null,"network":{"outbound":false,"reason":"All backends run locally. Network calls depend on your deployment (e.g. managed Qdrant Cloud)."}}}

Vector Store Shootout

Eight vector store backends with a common VectorStore interface. Swap backends by changing one line — the rest of your code stays the same.

Backends

Backend Type Dependencies Best For
numpy In-memory numpy only Prototyping, small datasets
lancedb File-based lancedb Local persistence, Arrow-native
qdrant Client-server qdrant-client Production, filtering
pgvector Postgres extension psycopg2 Existing Postgres deployments
weaviate Client-server weaviate-client Hybrid search (BM25 + vector)
weaviate_hybrid Client-server weaviate-client BM25-heavy hybrid (alpha=0.1)
milvus Client-server pymilvus Large-scale, GPU-accelerated
lightrag Graph-enhanced lightrag Graph + vector RAG

Common Interface

from base import VectorStore

class MyStore(VectorStore):
    async def add(self, texts, embeddings, metadatas): ...
    async def search(self, query_embedding, k=5): ...
    async def delete(self, ids): ...

Key Finding

Weaviate hybrid search at alpha=0.1 (BM25-heavy) scored avg 0.9940 vs 0.9700 at default 0.5. For technical content with specific terminology, keyword matching matters more than semantic similarity.

Files

  • scripts/base.py — Abstract base class
  • scripts/numpy_store.py through scripts/lightrag_store.py — All 8 implementations