The QdrantHandshake class provides seamless integration between Chonkie’s chunking system and Qdrant, a high-performance vector database.Embed and store your Chonkie chunks in Qdrant without ever leaving the Chonkie SDK.
from chonkie import QdrantHandshake, SemanticChunker # Initialize the handshakehandshake = QdrantHandshake( url="YOUR_CLOUD_URL", api_key="YOUR_API_KEY", collection_name="my_documents",)# Create some chunkschunker = SemanticChunker()chunks = chunker.chunk("Chonkie loves to chonk your texts!")# Write chunks to Qdranthandshake.write(chunks)
You can retrieve the most similar chunks from your Qdrant collection using the search method:
Copy
Ask AI
from chonkie import QdrantHandshake# Initialize the handshakehandshake = QdrantHandshake( url="YOUR_CLOUD_URL", api_key="YOUR_API_KEY", collection_name="my_documents",)results = handshake.search(query="chonk your texts", limit=2)for result in results: print(result["score"], result["text"])