mistralai-search-toolkit-plugins-qdrant
Qdrant store for mistralai-search-toolkit.
Same three methods as the other backends: index, search, delete. Navigation and patch work too if you want them.
Install
uv add mistralai-search-toolkit-plugins-qdrant
docker run -p 6333:6333 qdrant/qdrant
Usage
from mistralai.search.toolkit.embedding import CustomEmbeddingModel
from mistralai.search.toolkit.plugins.qdrant import (
QdrantApp,
QdrantCollectionSchema,
QdrantConnectionConfig,
)
from mistralai.search.toolkit.search import VectorSearchQuery
schema = QdrantCollectionSchema(
collection_name="docs",
document_type=MyDoc,
embedding_model=CustomEmbeddingModel(name="my-embedder", dimensions=1024),
)
app = QdrantApp([schema])
config = QdrantConnectionConfig(url="http://localhost:6333")
await app.create_collection(config, "docs")
store = app.get_search_index(config, "docs")
try:
await store.index_document(doc)
results = await store.search(VectorSearchQuery(embedding=vec, top_k=10))
finally:
await store.aclose()
If you already have an AsyncQdrantClient, pass that instead of a config. Tests can skip the server:
QdrantConnectionConfig(path=":memory:")
One Qdrant point per chunk. Reindex writes the new points first, then drops whatever is left from the old version, so a crash does not empty the document.
exclude_ids works. max_candidates becomes hnsw_ef.
Give both embedding and query and you get hybrid search: dense rank fused with full-text over content by weighted RRF. Tune it with QdrantSearchQuery. The fusion score only means anything inside that one result set. distance comes from the vector side. A hit that only the text side found has distance=None.
navigate and read use [start, end) offsets. grep matches tokens. PHRASE cares about order, TERM does not.
patch_chunk and patch_document merge metadata one key at a time. Set a key to None to drop it.
Extra fields on a chunk keep their name. Extra fields on a document get a document_ prefix.
from typing import Annotated
from mistralai.search.toolkit.plugins.qdrant import QdrantField
section: Annotated[str | None, QdrantField(name="section_title")] = None
internal: Annotated[str | None, QdrantField(ignore=True)] = None
Qdrant only accepts integer or UUID point ids. The usual UUID5 chunk ids go through as-is. Anything else is hashed with uuid5, and the original string stays in payload id.
uv sync --group dev
uv run pytest tests/ -q
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mistralai_search_toolkit_plugins_qdrant-0.1.1.tar.gz.
File metadata
- Download URL: mistralai_search_toolkit_plugins_qdrant-0.1.1.tar.gz
- Upload date:
- Size: 98.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a4e25600b54dacdc217cde2022ecb8c52c7c6685904e4aec147004be726a82d
|
|
| MD5 |
1800fb6f37f2b4fe9fb8693c1a2ce248
|
|
| BLAKE2b-256 |
a6701f912b19e13ae25c07f990db9c63970068b2f6cc6d33031fec660f4041a7
|
File details
Details for the file mistralai_search_toolkit_plugins_qdrant-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mistralai_search_toolkit_plugins_qdrant-0.1.1-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f334bb41d9eef6222fb78e8111a7d5473bb21a2b5a4ba45996967ec935cfa9c
|
|
| MD5 |
1bbc2c2a196e640aca29324b8f6f8371
|
|
| BLAKE2b-256 |
fc69789e2a852f0c917984f830d8230a8ea2d3163758fcc03323909a4b78606d
|