# qdrant-client - Doramagic AI Context Pack

> 定位：安装前体验与判断资产。它帮助宿主 AI 有一个好的开始，但不代表已经安装、执行或验证目标项目。

## 充分原则

- **充分原则，不是压缩原则**：AI Context Pack 应该充分到让宿主 AI 在开工前理解项目价值、能力边界、使用入口、风险和证据来源；它可以分层组织，但不以最短摘要为目标。
- **压缩策略**：只压缩噪声和重复内容，不压缩会影响判断和开工质量的上下文。

## 给宿主 AI 的使用方式

你正在读取 Doramagic 为 qdrant-client 编译的 AI Context Pack。请把它当作开工前上下文：帮助用户理解适合谁、能做什么、如何开始、哪些必须安装后验证、风险在哪里。不要声称你已经安装、运行或执行了目标项目。

## Claim 消费规则

- **事实来源**：Repo Evidence + Claim/Evidence Graph；Human Wiki 只提供显著性、术语和叙事结构。
- **事实最低状态**：`supported`
- `supported`：可以作为项目事实使用，但回答中必须引用 claim_id 和证据路径。
- `weak`：只能作为低置信度线索，必须要求用户继续核实。
- `inferred`：只能用于风险提示或待确认问题，不能包装成项目事实。
- `unverified`：不得作为事实使用，应明确说证据不足。
- `contradicted`：必须展示冲突来源，不得替用户强行选择一个版本。

## 它最适合谁

- **想在安装前理解开源项目价值和边界的用户**：当前证据主要来自项目文档。 证据：`README.md` Claim：`clm_0002` supported 0.86

## 它能做什么

- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`README.md` Claim：`clm_0001` supported 0.86

## 怎么开始

- `pip install qdrant-client` 证据：`README.md` Claim：`clm_0003` supported 0.86, `clm_0004` supported 0.86, `clm_0005` supported 0.86
- `pip install qdrant-client[fastembed]` 证据：`README.md` Claim：`clm_0004` supported 0.86, `clm_0005` supported 0.86
- `pip install 'qdrant-client[fastembed-gpu]'` 证据：`README.md` Claim：`clm_0005` supported 0.86

## 继续前判断卡

- **当前建议**：仅建议沙盒试装
- **为什么**：项目存在安装命令、宿主配置或本地写入线索，不建议直接进入主力环境，应先在隔离环境试装。

### 30 秒判断

- **现在怎么做**：仅建议沙盒试装
- **最小安全下一步**：先跑 Prompt Preview；若仍要安装，只在隔离环境试装
- **先别相信**：真实输出质量不能在安装前相信。
- **继续会触碰**：命令执行、本地环境或项目文件、宿主 AI 上下文

### 现在可以相信

- **适合人群线索：想在安装前理解开源项目价值和边界的用户**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0002` supported 0.86
- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`README.md` Claim：`clm_0001` supported 0.86
- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`README.md` Claim：`clm_0003` supported 0.86, `clm_0004` supported 0.86, `clm_0005` supported 0.86

### 现在还不能相信

- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。
- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。
- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。
- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。
- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。
- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。
- **安装命令是否需要网络、权限或全局写入？**（unverified）：这影响企业环境和个人环境的安装风险。 证据：`README.md`

### 继续会触碰什么

- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`README.md`
- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。

### 最小安全下一步

- **先跑 Prompt Preview**：用安装前交互式试用判断工作方式是否匹配，不需要授权或改环境。（适用：任何项目都适用，尤其是输出质量未知时。）
- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）
- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）

### 退出方式

- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。
- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。
- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。

## 哪些只能预览

- 解释项目适合谁和能做什么
- 基于项目文档演示典型对话流程
- 帮助用户判断是否值得安装或继续研究

## 哪些必须安装后验证

- 真实安装 Skill、插件或 CLI
- 执行脚本、修改本地文件或访问外部服务
- 验证真实输出质量、性能和兼容性

## 边界与风险判断卡

- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0006` inferred 0.45
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.md` Claim：`clm_0007` supported 0.86
- **待确认**：真实安装后是否与用户当前宿主 AI 版本兼容？。原因：兼容性只能通过实际宿主环境验证。
- **待确认**：项目输出质量是否满足用户具体任务？。原因：安装前预览只能展示流程和边界，不能替代真实评测。
- **待确认**：安装命令是否需要网络、权限或全局写入？。原因：这影响企业环境和个人环境的安装风险。

## 开工前工作上下文

### 加载顺序

- 先读取 how_to_use.host_ai_instruction，建立安装前判断资产的边界。
- 读取 claim_graph_summary，确认事实来自 Claim/Evidence Graph，而不是 Human Wiki 叙事。
- 再读取 intended_users、capabilities 和 quick_start_candidates，判断用户是否匹配。
- 需要执行具体任务时，优先查 role_skill_index，再查 evidence_index。
- 遇到真实安装、文件修改、网络访问、性能或兼容性问题时，转入 risk_card 和 boundaries.runtime_required。

### 任务路由

- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`README.md` Claim：`clm_0001` supported 0.86

### 上下文规模

- 文件总数：156
- 重要文件覆盖：40/156
- 证据索引条目：47
- 角色 / Skill 条目：2

### 证据不足时的处理

- **missing_evidence**：说明证据不足，要求用户提供目标文件、README 段落或安装后验证记录；不要补全事实。
- **out_of_scope_request**：说明该任务超出当前 AI Context Pack 证据范围，并建议用户先查看 Human Manual 或真实安装后验证。
- **runtime_request**：给出安装前检查清单和命令来源，但不要替用户执行命令或声称已执行。
- **source_conflict**：同时展示冲突来源，标记为待核实，不要强行选择一个版本。

## Prompt Recipes

### 适配判断

- 目标：判断这个项目是否适合用户当前任务。
- 预期输出：适配结论、关键理由、证据引用、安装前可预览内容、必须安装后验证内容、下一步建议。

```text
请基于 qdrant-client 的 AI Context Pack，先问我 3 个必要问题，然后判断它是否适合我的任务。回答必须包含：适合谁、能做什么、不能做什么、是否值得安装、证据来自哪里。所有项目事实必须引用 evidence_refs、source_paths 或 claim_id。
```

### 安装前体验

- 目标：让用户在安装前感受核心工作流，同时避免把预览包装成真实能力或营销承诺。
- 预期输出：一段带边界标签的体验剧本、安装后验证清单和谨慎建议；不含真实运行承诺或强营销表述。

```text
请把 qdrant-client 当作安装前体验资产，而不是已安装工具或真实运行环境。

请严格输出四段：
1. 先问我 3 个必要问题。
2. 给出一段“体验剧本”：用 [安装前可预览]、[必须安装后验证]、[证据不足] 三种标签展示它可能如何引导工作流。
3. 给出安装后验证清单：列出哪些能力只有真实安装、真实宿主加载、真实项目运行后才能确认。
4. 给出谨慎建议：只能说“值得继续研究/试装”“先补充信息后再判断”或“不建议继续”，不得替项目背书。

硬性边界：
- 不要声称已经安装、运行、执行测试、修改文件或产生真实结果。
- 不要写“自动适配”“确保通过”“完美适配”“强烈建议安装”等承诺性表达。
- 如果描述安装后的工作方式，必须使用“如果安装成功且宿主正确加载 Skill，它可能会……”这种条件句。
- 体验剧本只能写成“示例台词/假设流程”：使用“可能会询问/可能会建议/可能会展示”，不要写“已写入、已生成、已通过、正在运行、正在生成”。
- Prompt Preview 不负责给安装命令；如用户准备试装，只能提示先阅读 Quick Start 和 Risk Card，并在隔离环境验证。
- 所有项目事实必须来自 supported claim、evidence_refs 或 source_paths；inferred/unverified 只能作风险或待确认项。

```

### 角色 / Skill 选择

- 目标：从项目里的角色或 Skill 中挑选最匹配的资产。
- 预期输出：候选角色或 Skill 列表，每项包含适用场景、证据路径、风险边界和是否需要安装后验证。

```text
请读取 role_skill_index，根据我的目标任务推荐 3-5 个最相关的角色或 Skill。每个推荐都要说明适用场景、可能输出、风险边界和 evidence_refs。
```

### 风险预检

- 目标：安装或引入前识别环境、权限、规则冲突和质量风险。
- 预期输出：环境、权限、依赖、许可、宿主冲突、质量风险和未知项的检查清单。

```text
请基于 risk_card、boundaries 和 quick_start_candidates，给我一份安装前风险预检清单。不要替我执行命令，只说明我应该检查什么、为什么检查、失败会有什么影响。
```

### 宿主 AI 开工指令

- 目标：把项目上下文转成一次对话开始前的宿主 AI 指令。
- 预期输出：一段边界明确、证据引用明确、适合复制给宿主 AI 的开工前指令。

```text
请基于 qdrant-client 的 AI Context Pack，生成一段我可以粘贴给宿主 AI 的开工前指令。这段指令必须遵守 not_runtime=true，不能声称项目已经安装、运行或产生真实结果。
```

## 角色 / Skill 索引

- 共索引 2 个角色 / Skill / 项目文档条目。

- **Python Qdrant Client**（project_doc）：Python Client library for the Qdrant vector search engine. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`README.md`
- **Client update checklist**（project_doc）：Create a new branch from the branch of upcoming release. E.g. git checkout v0.7.0 && git pull && git checkout -b v0.7.0-my-changees 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`tools/DEVELOPMENT.md`

## 证据索引

- 共索引 47 条证据。

- **Python Qdrant Client**（documentation）：Python Client library for the Qdrant vector search engine. 证据：`README.md`
- **License**（source_file）：Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ 证据：`LICENSE`
- **Async Qdrant Fastembed**（source_file）：class AsyncQdrantFastembedMixin AsyncQdrantBase ⋮---- DEFAULT EMBEDDING MODEL = "BAAI/bge-small-en" DEFAULT BATCH SIZE = 8 FASTEMBED INSTALLED: bool def init self, parser: ModelSchemaParser, is local mode: bool ⋮---- @classmethod async def list text models cls - dict str, tuple int, models.Distance ⋮---- @classmethod async def list image models cls - dict str, tuple int, models.Distance ⋮---- @classmethod async def list late interaction text models cls - dict str, tuple int, models.Distance ⋮---- @classmethod async def list sparse models cls - dict str, dict str, Any ⋮---- @property def embedding model name self - str ⋮---- @property def sparse embedding model name self - str None ⋮---- @cl… 证据：`qdrant_client/async_qdrant_fastembed.py`
- **Async Qdrant Remote**（source_file）：class AsyncQdrantRemote AsyncQdrantBase ⋮---- DEFAULT GRPC TIMEOUT = 5 DEFAULT GRPC POOL SIZE = 3 ⋮---- pool size = max 1, pool size ⋮---- url = f"//{url}" parsed url: Url = parse url url ⋮---- timeout = math.ceil timeout if timeout is not None else None ⋮---- limits = kwargs.pop "limits", None ⋮---- limits = httpx.Limits max connections=None, max keepalive connections=0 ⋮---- limits = httpx.Limits max connections=self. pool size ⋮---- http2 = kwargs.pop "http2", False ⋮---- client version = importlib.metadata.version "qdrant-client" python version = platform.python version user agent = f"python-client/{client version} python/{python version}" ⋮---- grpc compression: Compression None = kwar… 证据：`qdrant_client/async_qdrant_remote.py`
- **Parse gRPC client options**（source_file）：class GenericClientInterceptor ⋮---- def init self, interceptor function: Callable ⋮---- response = continuation new details, next new request iterator ⋮---- response it = continuation new details, next new request iterator ⋮---- response = continuation new details, new request iterator ⋮---- response it = continuation new details, new request iterator ⋮---- class GenericAsyncClientInterceptor ⋮---- next request = next new request iterator response = await continuation new details, next request ⋮---- response it = await continuation new details, next new request iterator ⋮---- response = await continuation new details, new request iterator ⋮---- response it = await continuation new details,… 证据：`qdrant_client/connection.py`
- **Fastembed Common**（source_file）：TextEmbedding = None SparseTextEmbedding = None ImageEmbedding = None LateInteractionTextEmbedding = None LateInteractionMultimodalEmbedding = None OnnxProvider = None ImageInput = None class QueryResponse BaseModel, extra="forbid" ⋮---- id: str int embedding: list float None sparse embedding: SparseVector None = Field default=None metadata: dict str, Any document: str score: float class FastEmbedMisc ⋮---- IS INSTALLED: bool = False TEXT MODELS: set str = set IMAGE MODELS: set str = set LATE INTERACTION TEXT MODELS: set str = set LATE INTERACTION MULTIMODAL MODELS: set str = set SPARSE MODELS: set str = set ⋮---- @classmethod def is installed cls - bool ⋮---- @classmethod def import fastem… 证据：`qdrant_client/fastembed_common.py`
- **check if we have fastembed installed**（source_file）：class QdrantFastembedMixin QdrantBase ⋮---- DEFAULT EMBEDDING MODEL = "BAAI/bge-small-en" DEFAULT BATCH SIZE = 8 FASTEMBED INSTALLED: bool def init self, parser: ModelSchemaParser, is local mode: bool ⋮---- @classmethod def list text models cls - dict str, tuple int, models.Distance ⋮---- @classmethod def list image models cls - dict str, tuple int, models.Distance ⋮---- @classmethod def list late interaction text models cls - dict str, tuple int, models.Distance ⋮---- @classmethod def list late interaction multimodal models cls - dict str, tuple int, models.Distance ⋮---- @classmethod def list sparse models cls - dict str, dict str, Any ⋮---- @property def embedding model name self - str ⋮… 证据：`qdrant_client/qdrant_fastembed.py`
- **Qdrant Remote**（source_file）：class QdrantRemote QdrantBase ⋮---- DEFAULT GRPC TIMEOUT = 5 DEFAULT GRPC POOL SIZE = 3 ⋮---- pool size = max 1, pool size ⋮---- url = f"//{url}" parsed url: Url = parse url url ⋮---- timeout = ⋮---- limits = kwargs.pop "limits", None ⋮---- limits = httpx.Limits max connections=None, max keepalive connections=0 ⋮---- limits = httpx.Limits max connections=self. pool size ⋮---- http2 = kwargs.pop "http2", False ⋮---- client version = importlib.metadata.version "qdrant-client" python version = platform.python version user agent = f"python-client/{client version} python/{python version}" ⋮---- grpc compression: Compression None = kwargs.pop "grpc compression", None ⋮---- address = f"{self. host… 证据：`qdrant_client/qdrant_remote.py`
- **Embed Inspector**（source_file）：class InspectorEmbed ⋮---- def init self, parser: ModelSchemaParser None = None - None def inspect self, points: Iterable BaseModel BaseModel - list FieldPath ⋮---- paths = ⋮---- paths = sorted set paths ⋮---- paths = self.parser.path cache.get mod. class . name , if paths is None else paths found paths = ⋮---- accum = current path ⋮---- def inspect recursive member: BaseModel, accumulator: str - list str ⋮---- """Iterates over the set model fields, expand recursive ones and find paths to objects requiring inference Args: member: currently inspected model, which may or may not contain recursive fields accumulator: accumulator for the path, which is a dot separated string assembled recursive… 证据：`qdrant_client/embed/embed_inspector.py`
- **Embedder**（source_file）：T = TypeVar "T" class ModelInstance BaseModel, Generic T , arbitrary types allowed=True ⋮---- model: T options: dict str, Any deprecated: bool = False class Embedder ⋮---- options = { ⋮---- model = TextEmbedding model name=model name, options model instance: ModelInstance TextEmbedding = ModelInstance ⋮---- model = SparseTextEmbedding model name=model name, options model instance: ModelInstance SparseTextEmbedding = ModelInstance ⋮---- model = LateInteractionTextEmbedding model name=model name, options model instance: ModelInstance LateInteractionTextEmbedding = ModelInstance ⋮---- model = LateInteractionMultimodalEmbedding model name=model name, options model instance: ModelInstance LateIn… 证据：`qdrant_client/embed/embedder.py`
- **Model Embedder**（source_file）：class ModelEmbedderWorker Worker ⋮---- def init self, batch size: int, kwargs: Any ⋮---- @classmethod def start cls, batch size: int, kwargs: Any - "ModelEmbedderWorker" def process self, items: Iterable tuple int, Any - Iterable tuple int, Any class ModelEmbedder ⋮---- MAX INTERNAL BATCH SIZE = 64 ⋮---- raw models = raw models ⋮---- is small = False ⋮---- is small = True ⋮---- multiprocessing batch size = 1 raw models batches = iter batch raw models, size=multiprocessing batch size ⋮---- parallel = os.cpu count start method = "forkserver" if "forkserver" in get all start methods else "spawn" ⋮---- pool = ParallelWorkerPool ⋮---- model = deepcopy model if not accumulating else model ⋮---- p… 证据：`qdrant_client/embed/model_embedder.py`
- **Models**（source_file）：NumericVector: TypeAlias = list StrictFloat SparseVector list list StrictFloat NumericVectorInput: TypeAlias = NumericVectorStruct: TypeAlias = all = "NumericVector", "NumericVectorInput", "NumericVectorStruct" 证据：`qdrant_client/embed/models.py`
- **Init**（source_file）：model class = model 1 证据：`qdrant_client/http/__init__.py`
- **Aliases Api**（source_file）：PYDANTIC V2 = PYDANTIC VERSION.startswith "2." Model = TypeVar "Model", bound="BaseModel" SetIntStr = Set Union int, str DictIntStrAny = Dict Union int, str , Any file = None def to json model: BaseModel, args: Any, kwargs: Any - str ⋮---- class AliasesApi ⋮---- def init self, api client: "Union ApiClient, AsyncApiClient " ⋮---- path params = { headers = {} ⋮---- query params = {} ⋮---- body = jsonable encoder change aliases operation ⋮---- class AsyncAliasesApi AliasesApi class SyncAliasesApi AliasesApi 证据：`qdrant_client/http/api/aliases_api.py`
- **Beta Api**（source_file）：PYDANTIC V2 = PYDANTIC VERSION.startswith "2." Model = TypeVar "Model", bound="BaseModel" SetIntStr = Set Union int, str DictIntStrAny = Dict Union int, str , Any file = None def to json model: BaseModel, args: Any, kwargs: Any - str ⋮---- class BetaApi ⋮---- def init self, api client: "Union ApiClient, AsyncApiClient " ⋮---- headers = {} ⋮---- class AsyncBetaApi BetaApi class SyncBetaApi BetaApi 证据：`qdrant_client/http/api/beta_api.py`
- **Collections Api**（source_file）：PYDANTIC V2 = PYDANTIC VERSION.startswith "2." Model = TypeVar "Model", bound="BaseModel" SetIntStr = Set Union int, str DictIntStrAny = Dict Union int, str , Any file = None def to json model: BaseModel, args: Any, kwargs: Any - str ⋮---- class CollectionsApi ⋮---- def init self, api client: "Union ApiClient, AsyncApiClient " ⋮---- path params = { headers = {} ⋮---- query params = {} ⋮---- body = jsonable encoder create collection ⋮---- body = jsonable encoder vector name config ⋮---- body = jsonable encoder update collection ⋮---- class AsyncCollectionsApi CollectionsApi class SyncCollectionsApi CollectionsApi 证据：`qdrant_client/http/api/collections_api.py`
- **Distributed Api**（source_file）：PYDANTIC V2 = PYDANTIC VERSION.startswith "2." Model = TypeVar "Model", bound="BaseModel" SetIntStr = Set Union int, str DictIntStrAny = Dict Union int, str , Any file = None def to json model: BaseModel, args: Any, kwargs: Any - str ⋮---- class DistributedApi ⋮---- def init self, api client: "Union ApiClient, AsyncApiClient " ⋮---- headers = {} ⋮---- query params = {} ⋮---- path params = { ⋮---- body = jsonable encoder create sharding key ⋮---- body = jsonable encoder drop sharding key ⋮---- body = jsonable encoder cluster operations ⋮---- class AsyncDistributedApi DistributedApi class SyncDistributedApi DistributedApi 证据：`qdrant_client/http/api/distributed_api.py`
- **Indexes Api**（source_file）：PYDANTIC V2 = PYDANTIC VERSION.startswith "2." Model = TypeVar "Model", bound="BaseModel" SetIntStr = Set Union int, str DictIntStrAny = Dict Union int, str , Any file = None def to json model: BaseModel, args: Any, kwargs: Any - str ⋮---- class IndexesApi ⋮---- def init self, api client: "Union ApiClient, AsyncApiClient " ⋮---- path params = { query params = {} ⋮---- headers = {} body = jsonable encoder create field index ⋮---- class AsyncIndexesApi IndexesApi class SyncIndexesApi IndexesApi 证据：`qdrant_client/http/api/indexes_api.py`
- **Points Api**（source_file）：PYDANTIC V2 = PYDANTIC VERSION.startswith "2." Model = TypeVar "Model", bound="BaseModel" SetIntStr = Set Union int, str DictIntStrAny = Dict Union int, str , Any file = None def to json model: BaseModel, args: Any, kwargs: Any - str ⋮---- class PointsApi ⋮---- def init self, api client: "Union ApiClient, AsyncApiClient " ⋮---- path params = { query params = {} ⋮---- headers = {} body = jsonable encoder update operations ⋮---- body = jsonable encoder points selector ⋮---- body = jsonable encoder count request ⋮---- body = jsonable encoder delete payload ⋮---- body = jsonable encoder delete vectors ⋮---- body = jsonable encoder facet request ⋮---- body = jsonable encoder point request ⋮----… 证据：`qdrant_client/http/api/points_api.py`
- **Search Api**（source_file）：PYDANTIC V2 = PYDANTIC VERSION.startswith "2." Model = TypeVar "Model", bound="BaseModel" SetIntStr = Set Union int, str DictIntStrAny = Dict Union int, str , Any file = None def to json model: BaseModel, args: Any, kwargs: Any - str ⋮---- class SearchApi ⋮---- def init self, api client: "Union ApiClient, AsyncApiClient " ⋮---- path params = { query params = {} ⋮---- headers = {} body = jsonable encoder discover request batch ⋮---- body = jsonable encoder discover request ⋮---- body = jsonable encoder query request batch ⋮---- body = jsonable encoder query request ⋮---- body = jsonable encoder query groups request ⋮---- body = jsonable encoder recommend request batch ⋮---- body = jsonable e… 证据：`qdrant_client/http/api/search_api.py`
- **Service Api**（source_file）：PYDANTIC V2 = PYDANTIC VERSION.startswith "2." Model = TypeVar "Model", bound="BaseModel" SetIntStr = Set Union int, str DictIntStrAny = Dict Union int, str , Any file = None def to json model: BaseModel, args: Any, kwargs: Any - str ⋮---- class ServiceApi ⋮---- def init self, api client: "Union ApiClient, AsyncApiClient " ⋮---- headers = {} ⋮---- query params = {} ⋮---- class AsyncServiceApi ServiceApi class SyncServiceApi ServiceApi 证据：`qdrant_client/http/api/service_api.py`
- **Snapshots Api**（source_file）：PYDANTIC V2 = PYDANTIC VERSION.startswith "2." Model = TypeVar "Model", bound="BaseModel" SetIntStr = Set Union int, str DictIntStrAny = Dict Union int, str , Any file = None def to json model: BaseModel, args: Any, kwargs: Any - str ⋮---- class SnapshotsApi ⋮---- def init self, api client: "Union ApiClient, AsyncApiClient " ⋮---- query params = {} ⋮---- headers = {} ⋮---- path params = { ⋮---- body = jsonable encoder snapshot recover ⋮---- files: Dict str, IO Any = {} data: Dict str, Any = {} ⋮---- body = jsonable encoder shard snapshot recover ⋮---- class AsyncSnapshotsApi SnapshotsApi class SyncSnapshotsApi SnapshotsApi 证据：`qdrant_client/http/api/snapshots_api.py`
- **in order to do a correct join, url join requires base url to end with /, and url to not start with /,**（source_file）：ClientT = TypeVar "ClientT", bound="ApiClient" AsyncClientT = TypeVar "AsyncClientT", bound="AsyncApiClient" class AsyncApis Generic AsyncClientT ⋮---- def init self, host: str, kwargs: Any async def aclose self - None class SyncApis Generic ClientT ⋮---- def close self - None T = TypeVar "T" Send = Callable Request , Response SendAsync = Callable Request , Awaitable Response MiddlewareT = Callable Request, Send , Response AsyncMiddlewareT = Callable Request, SendAsync , Awaitable Response class ApiClient ⋮---- def init self, host: str, kwargs: Any - None ⋮---- @overload def request self, , type : Type T , method: str, url: str, path params: Dict str, Any = None, kwargs: Any - T ⋮---- @over… 证据：`qdrant_client/http/api_client.py`
- **Configuration**（source_file）：AnyOfstringinteger = Union str, int 证据：`qdrant_client/http/configuration.py`
- **Models**（source_file）：Payload = Dict str, Any SparseVectorsConfig = Dict str, "SparseVectorParams" StrictModeMultivectorConfig = Dict str, "StrictModeMultivector" StrictModeMultivectorConfigOutput = Dict str, "StrictModeMultivectorOutput" StrictModeSparseConfig = Dict str, "StrictModeSparse" StrictModeSparseConfigOutput = Dict str, "StrictModeSparseOutput" VectorsConfigDiff = Dict str, "VectorParamsDiff" class AbortReshardingOperation BaseModel, extra="forbid" ⋮---- abort resharding: Any = Field ..., description="" class AbortShardTransfer BaseModel, extra="forbid" ⋮---- shard id: int = Field ..., description="" to peer id: int = Field ..., description="" from peer id: int = Field ..., description="" class Abort… 证据：`qdrant_client/http/models/models.py`
- **Async Qdrant Local**（source_file）：META INFO FILENAME = "meta.json" class AsyncQdrantLocal AsyncQdrantBase ⋮---- LARGE DATA THRESHOLD = 20000 def init self, location: str, force disable check same thread: bool = False - None ⋮---- @property def closed self - bool async def close self, kwargs: Any - None def load self - None ⋮---- deprecated config fields = "init from", ⋮---- meta path = os.path.join self.location, META INFO FILENAME ⋮---- meta = json.load f ⋮---- config = rest models.CreateCollection config json collection path = self. collection path collection name collection = LocalCollection ⋮---- lock file path = os.path.join self.location, ".lock" ⋮---- def save self - None def get collection self, collection name: str… 证据：`qdrant_client/local/async_qdrant_local.py`
- **directories on import and crashes in read-only systems even if local mode is not used**（source_file）：META INFO FILENAME = "meta.json" class QdrantLocal QdrantBase ⋮---- LARGE DATA THRESHOLD = 20 000 def init self, location: str, force disable check same thread: bool = False - None ⋮---- @property def closed self - bool def close self, kwargs: Any - None ⋮---- import portalocker portalocker can't be imported at the top level: it checks for writeable directories on import and crashes in read-only systems even if local mode is not used ⋮---- except TypeError: sometimes portalocker module can be garbage collected before QdrantLocal instance ⋮---- def load self - None ⋮---- deprecated config fields = "init from", ⋮---- meta path = os.path.join self.location, META INFO FILENAME ⋮---- meta = json… 证据：`qdrant_client/local/qdrant_local.py`
- **Client update checklist**（documentation）：Create a new branch from the branch of upcoming release. E.g. git checkout v0.7.0 && git pull && git checkout -b v0.7.0-my-changees 证据：`tools/DEVELOPMENT.md`
- **.gitignore**（source_file）：venv .DS Store pycache .pytest cache .idea .vscode .devcontainer .coverage htmlcov .iml dist .tar.gz local cache/ / .python-version docs/source/examples/local cache/ docs/source/examples/path/to/db/ .venv 证据：`.gitignore`
- **.Pre Commit Config**（source_file）：default language version: python: python3.10 exclude: 'qdrant client/ grpc http models /' repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-added-large-files - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.4.3 hooks: - id: ruff-format types or: python, pyi args: --line-length=99 证据：`.pre-commit-config.yaml`
- **Mypy**（source_file）：mypy ignore missing imports = True follow imports = skip exclude = qdrant client/grpc qdrant client/http tests venv 证据：`mypy.ini`
- **Netlify**（source_file）：build command = "mkdir -p public" publish = "public" 证据：`netlify.toml`
- **Pyproject**（source_file）：tool.poetry name = "qdrant-client" version = "1.18.0" description = "Client library for the Qdrant vector search engine" authors = "Andrey Vasnetsov " packages = {include = "qdrant client"} license = "Apache-2.0" readme = "README.md" homepage = "https://github.com/qdrant/qdrant-client" repository = "https://github.com/qdrant/qdrant-client" keywords = "vector", "search", "neural", "matching", "client" 证据：`pyproject.toml`
- **Pydantic Compat**（source_file）：PYDANTIC V2 = PYDANTIC VERSION.startswith "2." Model = TypeVar "Model", bound="BaseModel" ⋮---- to jsonable python = pydantic core.to jsonable python ⋮---- def to jsonable python x: Any - Any def update forward refs model class: Type BaseModel , args: Any, kwargs: Any - None def construct model class: Type Model , args: Any, kwargs: Any - Model def to dict model: BaseModel, args: Any, kwargs: Any - dict Any, Any def model fields set model: BaseModel - set def model fields model: Type BaseModel - dict def model json schema model: Type BaseModel , args: Any, kwargs: Any - dict str, Any def model config model: Type BaseModel - dict str, Any 证据：`qdrant_client/_pydantic_compat.py`
- **Async Client Base**（source_file）：class AsyncQdrantBase ⋮---- def init self, kwargs: Any ⋮---- async def get aliases self, kwargs: Any - types.CollectionsAliasesResponse async def get collections self, kwargs: Any - types.CollectionsResponse async def get collection self, collection name: str, kwargs: Any - types.CollectionInfo async def collection exists self, collection name: str, kwargs: Any - bool async def update collection self, collection name: str, kwargs: Any - bool async def delete collection self, collection name: str, kwargs: Any - bool ⋮---- async def list full snapshots self, kwargs: Any - list types.SnapshotDescription async def create full snapshot self, kwargs: Any - types.SnapshotDescription None async def… 证据：`qdrant_client/async_client_base.py`
- **Async Qdrant Client**（source_file）：class AsyncQdrantClient AsyncQdrantFastembedMixin ⋮---- url = location ⋮---- async def close self, grpc grace: float None = None, kwargs: Any - None ⋮---- @property def grpc collections self - grpc.CollectionsStub ⋮---- @property def grpc points self - grpc.PointsStub ⋮---- """gRPC client for points methods Returns: An instance of raw gRPC client, generated from Protobuf """ ⋮---- @property def http self - AsyncApis AsyncApiClient ⋮---- """REST Client Returns: An instance of raw REST API client, generated from OpenAPI schema """ ⋮---- @property def init options self - dict str, Any ⋮---- """ init Options Returns: A dictionary of options the client class was instantiated with """ ⋮---- """Pe… 证据：`qdrant_client/async_qdrant_client.py`
- **Client Base**（source_file）：class QdrantBase ⋮---- def init self, kwargs: Any ⋮---- def get aliases self, kwargs: Any - types.CollectionsAliasesResponse def get collections self, kwargs: Any - types.CollectionsResponse def get collection self, collection name: str, kwargs: Any - types.CollectionInfo def collection exists self, collection name: str, kwargs: Any - bool ⋮---- def delete collection self, collection name: str, kwargs: Any - bool ⋮---- def list full snapshots self, kwargs: Any - list types.SnapshotDescription def create full snapshot self, kwargs: Any - types.SnapshotDescription None def delete full snapshot self, snapshot name: str, kwargs: Any - bool None ⋮---- def close self, kwargs: Any - None ⋮---- def… 证据：`qdrant_client/client_base.py`
- **Context Headers**（source_file）：context headers: ContextVar dict str, str = ContextVar " context headers", default={} def get context headers - dict str, str ⋮---- @contextmanager def headers extra headers: dict str, str - Iterator None ⋮---- current = context headers.get merged = { current, extra headers} token = context headers.set merged ⋮---- @asynccontextmanager async def async headers extra headers: dict str, str - AsyncIterator None def rest headers middleware request: Request, call next: Callable Request , Response - Response 证据：`qdrant_client/context_headers.py`
- **Keep going until you get an item that's None.**（source_file）：processing timeout = 10 60 MAX INTERNAL BATCH SIZE = 200 class QueueSignals str, Enum ⋮---- stop = "stop" confirm = "confirm" error = "error" class Worker ⋮---- @classmethod def start cls, args: Any, kwargs: Any - "Worker" def process self, items: Iterable Any - Iterable Any ⋮---- kwargs = {} ⋮---- worker = worker class.start kwargs Keep going until you get an item that's None. def input queue iterable - Iterable Any ⋮---- item = input queue.get ⋮---- except Exception as e: pylint: disable=broad-except ⋮---- It's important that we close and join the queue here before decrementing num active workers. Otherwise our parent may join us before the queue's feeder thread has passed all buffered it… 证据：`qdrant_client/parallel_processor.py`
- **Py**（source_file）：partial 证据：`qdrant_client/py.typed`
- **Qdrant Client**（source_file）：class QdrantClient QdrantFastembedMixin ⋮---- url = location ⋮---- def del self - None def close self, grpc grace: float None = None, kwargs: Any - None ⋮---- @property def grpc collections self - grpc.CollectionsStub ⋮---- @property def grpc points self - grpc.PointsStub ⋮---- """gRPC client for points methods Returns: An instance of raw gRPC client, generated from Protobuf """ ⋮---- @property def http self - SyncApis ApiClient ⋮---- """REST Client Returns: An instance of raw REST API client, generated from OpenAPI schema """ ⋮---- @property def init options self - dict str, Any ⋮---- """ init Options Returns: A dictionary of options the client class was instantiated with """ ⋮---- """Perf… 证据：`qdrant_client/qdrant_client.py`
- **Generate Async Client**（source_file）：set -e RELATIVE PROJECT ROOT="$ dirname "$0" /.." cd $RELATIVE PROJECT ROOT ABSOLUTE PROJECT ROOT=$ pwd python3 -m tools.async client generator.base client generator python3 -m tools.async client generator.fastembed generator python3 -m tools.async client generator.client generator python3 -m tools.async client generator.remote generator python3 -m tools.async client generator.local generator cd $ABSOLUTE PROJECT ROOT/tools/async client generator mv async client base.py $ABSOLUTE PROJECT ROOT/qdrant client/async client base.py mv async qdrant client.py $ABSOLUTE PROJECT ROOT/qdrant client/async qdrant client.py mv async qdrant fastembed.py $ABSOLUTE PROJECT ROOT/qdrant client/async qdrant f… 证据：`tools/generate_async_client.sh`
- **Generate Docs**（source_file）：set -e cd "$ dirname "$0" /../" poetry run sphinx-apidoc --force --separate --no-toc -o docs/source qdrant client poetry run sphinx-build docs/source docs/html 证据：`tools/generate_docs.sh`
- **Generate Grpc Client**（source_file）：set -euo pipefail PROJECT ROOT="$ cd "$ dirname "${BASH SOURCE 0 }" /.." && pwd " TEMP ENV=$ mktemp -d VENV DIR="$TEMP ENV/grpc generator venv" QDRANT PATH=$ mktemp -d trap "rm -rf \"$TEMP ENV\"; rm -rf \"$QDRANT PATH\"" EXIT if "$ python --version 2 &1 awk '{print $2}' " == "3.10.10" ; then PYTHON BIN="python" elif "$ python3 --version 2 &1 awk '{print $2}' " == "3.10.10" ; then PYTHON BIN="python3" elif "$ python3.10 --version 2 &1 awk '{print $2}' " == "3.10.10" ; then PYTHON BIN="python3.10" fi if -z "$PYTHON BIN" ; then echo "Error: No suitable Python 3.10.10 installation found among {python, python3, python3.10}" &2 exit 1 fi "$PYTHON BIN" -m venv "$VENV DIR" source "$VENV DIR/bin/act… 证据：`tools/generate_grpc_client.sh`
- **Generate Rest Client**（source_file）：set -euo pipefail PROJECT ROOT="$ cd "$ dirname "${BASH SOURCE 0 }" /.." && pwd " TEMP ENV=$ mktemp -d QDRANT PATH=$ mktemp -d GENERATOR PATH=$ mktemp -d VENV DIR="$TEMP ENV/rest generator venv" PYTHON BIN="" if "$ python --version 2 &1 awk '{print $2}' " == "3.10.10" ; then PYTHON BIN="python" elif "$ python3 --version 2 &1 awk '{print $2}' " == "3.10.10" ; then PYTHON BIN="python3" elif "$ python3.10 --version 2 &1 awk '{print $2}' " == "3.10.10" ; then PYTHON BIN="python3.10" fi if -z "$PYTHON BIN" ; then echo "Error: No suitable Python 3.10.10 installation found among {python, python3, python3.10}" &2 exit 1 fi trap 'rm -rf "$TEMP ENV"; rm -rf "$QDRANT PATH"; rm -rf "$GENERATOR PATH"' E… 证据：`tools/generate_rest_client.sh`
- **Create a new module based on the spec**（source_file）：def dynamic import file path: str Path, module name: str - ModuleType ⋮---- spec = importlib.util.spec from file location module name, file path ⋮---- Create a new module based on the spec module = importlib.util.module from spec spec Execute the module to load its contents spec.loader.exec module module type: ignore Optionally, add the module to sys.modules to access it globally ⋮---- semver = PYDANTIC VERSION.split "." ⋮---- current path = Path name file path = current path.parent.parent / "qdrant client" / "embed" / " inspection cache.py" parser = ModelSchemaParser a = time.perf counter ⋮---- model = getattr models, model name ⋮---- config = model config model ⋮---- module name = " inspe… 证据：`tools/populate_inspection_cache.py`
- **Populate Inspection Cache**（source_file）：set -xe RELATIVE PROJECT ROOT="$ dirname "$0" /.." cd $RELATIVE PROJECT ROOT ABSOLUTE PROJECT ROOT=$ pwd rm -f $ABSOLUTE PROJECT ROOT/qdrant client/embed/ inspection cache.py python3 -m tools.populate inspection cache cd $ABSOLUTE PROJECT ROOT/qdrant client/embed autoflake --recursive --imports qdrant client --remove-unused-variables --in-place inspection cache.py ruff format --line-length 99 inspection cache.py 证据：`tools/populate_inspection_cache.sh`

## 宿主 AI 必须遵守的规则

- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`README.md`, `LICENSE`, `qdrant_client/__init__.py`
- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`README.md`, `LICENSE`, `qdrant_client/__init__.py`

## 用户开工前应该回答的问题

- 你准备在哪个宿主 AI 或本地环境中使用它？
- 你只是想先体验工作流，还是准备真实安装？
- 你最在意的是安装成本、输出质量、还是和现有规则的冲突？

## 验收标准

- 所有能力声明都能回指到 evidence_refs 中的文件路径。
- AI_CONTEXT_PACK.md 没有把预览包装成真实运行。
- 用户能在 3 分钟内看懂适合谁、能做什么、如何开始和风险边界。

---

## Doramagic Context Augmentation

下面内容用于强化 Repomix/AI Context Pack 主体。Human Manual 只提供阅读骨架；踩坑日志会被转成宿主 AI 必须遵守的工作约束。

## Human Manual 骨架

使用规则：这里只是项目阅读路线和显著性信号，不是事实权威。具体事实仍必须回到 repo evidence / Claim Graph。

宿主 AI 硬性规则：
- 不得把页标题、章节顺序、摘要或 importance 当作项目事实证据。
- 解释 Human Manual 骨架时，必须明确说它只是阅读路线/显著性信号。
- 能力、安装、兼容性、运行状态和风险判断必须引用 repo evidence、source path 或 Claim Graph。

- **Project Overview & Architecture**：importance `high`
  - source_paths: README.md, qdrant_client/__init__.py, qdrant_client/qdrant_client.py, qdrant_client/async_qdrant_client.py, qdrant_client/client_base.py
- **Connection Modes, Transports & Authentication**：importance `high`
  - source_paths: qdrant_client/connection.py, qdrant_client/qdrant_remote.py, qdrant_client/async_qdrant_remote.py, qdrant_client/local/qdrant_local.py, qdrant_client/local/async_qdrant_local.py
- **Data Operations, Uploaders & Type Conversions**：importance `high`
  - source_paths: qdrant_client/http/api/collections_api.py, qdrant_client/http/api/points_api.py, qdrant_client/http/api/search_api.py, qdrant_client/http/api/snapshots_api.py, qdrant_client/http/api/aliases_api.py
- **Inference API, FastEmbed & Troubleshooting**：importance `high`
  - source_paths: qdrant_client/qdrant_fastembed.py, qdrant_client/async_qdrant_fastembed.py, qdrant_client/fastembed_common.py, qdrant_client/embed/embedder.py, qdrant_client/embed/model_embedder.py

## Repo Inspection Evidence / 源码检查证据

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `326adefcc2158121dd0d04877e1a483b5aa2627b`
- inspected_files: `README.md`, `pyproject.toml`

宿主 AI 硬性规则：
- 没有 repo_clone_verified=true 时，不得声称已经读过源码。
- 没有 repo_inspection_verified=true 时，不得把 README/docs/package 文件判断写成事实。
- 没有 quick_start_verified=true 时，不得声称 Quick Start 已跑通。

## Doramagic Pitfall Constraints / 踩坑约束

这些规则来自 Doramagic 发现、验证或编译过程中的项目专属坑点。宿主 AI 必须把它们当作工作约束，而不是普通说明文字。

### Constraint 1: 来源证据：Qdrant client causes Pydantic validation error if `QDRANT__SERVICE__HARDWARE_REPORTING=true` is passed

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Qdrant client causes Pydantic validation error if `QDRANT__SERVICE__HARDWARE_REPORTING=true` is passed
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/qdrant/qdrant-client/issues/935 | 来源讨论提到 python 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 2: 能力判断依赖假设

- Trigger: README/documentation is current enough for a first validation pass.
- Host AI rule: 将假设转成下游验证清单。
- Why it matters: 假设不成立时，用户拿不到承诺的能力。
- Evidence: capability.assumptions | https://github.com/qdrant/qdrant-client | README/documentation is current enough for a first validation pass.
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 3: 维护活跃度未知

- Trigger: 未记录 last_activity_observed。
- Host AI rule: 补 GitHub 最近 commit、release、issue/PR 响应信号。
- Why it matters: 新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。
- Evidence: evidence.maintainer_signals | https://github.com/qdrant/qdrant-client | last_activity_observed missing
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

- Trigger: no_demo
- Evidence: downstream_validation.risk_items | https://github.com/qdrant/qdrant-client | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 5: 存在评分风险

- Trigger: no_demo
- Why it matters: 风险会影响是否适合普通用户安装。
- Evidence: risks.scoring_risks | https://github.com/qdrant/qdrant-client | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 6: issue/PR 响应质量未知

- Trigger: issue_or_pr_quality=unknown。
- Host AI rule: 抽样最近 issue/PR，判断是否长期无人处理。
- Why it matters: 用户无法判断遇到问题后是否有人维护。
- Evidence: evidence.maintainer_signals | https://github.com/qdrant/qdrant-client | issue_or_pr_quality=unknown
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 7: 发布节奏不明确

- Trigger: release_recency=unknown。
- Host AI rule: 确认最近 release/tag 和 README 安装命令是否一致。
- Why it matters: 安装命令和文档可能落后于代码，用户踩坑概率升高。
- Evidence: evidence.maintainer_signals | https://github.com/qdrant/qdrant-client | release_recency=unknown
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
