The MilvusHandshake class provides seamless integration between Chonkie’s chunking system and Milvus, a powerful, open-source vector database.Embed and store your Chonkie chunks in a Milvus collection, with automatic schema and index creation, without ever leaving the Chonkie SDK.
from chonkie import MilvusHandshake, SentenceChunker# Initialize the handshake for your deploymenthandshake = MilvusHandshake( uri="http://localhost:19530", collection_name="my_documents",)# Create some chunkschunker = SentenceChunker()chunks = chunker.chunk("Milvus stores data in collections. Chonkie makes ingestion easy!")# Write chunks to the Milvus collectionhandshake.write(chunks)
You can retrieve the most similar chunks from your Milvus collection using the search method.
Copy
Ask AI
from chonkie import MilvusHandshake# Initialize the handshake to connect to your collectionhandshake = MilvusHandshake( uri="http://localhost:19530", collection_name="my_documents",)results = handshake.search(query="easy data ingestion", limit=2)