运行时依赖
安装命令
点击复制技能文档
向量数据库工具包 用于AI和RAG系统的向量数据库操作工具包。 支持的后端 Qdrant - 开源向量数据库(REST/gRPC API) Chroma - 轻量级嵌入式向量数据库 InMemory - 小型数据集的纯Python回退 快速开始 Qdrant 从 scripts.qdrant_client 导入 VectorClient client = VectorClient(backend="qdrant", url="http://localhost:6333") client.create_collection("docs", dimension=768) client.upsert("docs", ids=["a", "b"], vectors=[[0.1, ...], [0.2, ...]], payloads=[{"title": "A"}, {"title": "B"}]) results = client.search("docs", vector=[0.1, ...], top_k=5) Chroma client = VectorClient(backend="chroma", path="/tmp/chroma") client.create_collection("docs") client.upsert("docs", ids=["a"], vectors=[[0.1, ...]], payloads=[{"title": "A"}]) results = client.search("docs", vector=[0.1, ...], top_k=5) 脚本 scripts/vector_client.py - 所有后端的统一客户端 scripts/qdrant_client.py - Qdrant特定操作 scripts/chroma_client.py - Chroma特定操作 scripts/embedding_utils.py - 文本到嵌入的帮助工具(可选OpenAI,sentence-transformers) 参考 references/qdrant_api.md - Qdrant API 模式 references/chroma_api.md - Chroma API 模式 GitHub (无)