This is a Gradio application that leverages Milvus for semantic search. The embeddings have been generated using Clip-retrieval. The model used for generation of embeddings is Open Clip The app requires a Milvus database with specific collections and uses a Python module for query embeddings generation. Below are the instructions to get the application up and running.
- Docker Compose
- Python 3.11
- Milvus installed via Docker
- Required Python packages:
pymilvus,gradio,all_clip
-
Clone the Repository
git clone https://github.com/awaisnazir08/Semantic-Search-using-Vector-Database.git cd Semantic-Search-using-Vector-Database -
Install Python Packages
pip install pymilvus gradio all_clip
-
Run Milvus Docker Container
You need to have Docker installed on your local machine. To run Milvus in a Docker container, execute the following command:
docker compose -f milvus-standalone-docker-compose.yml up -dEnsure that Milvus is running on port 19530. You may need to specify this port and the IP of your device in the semantic_search_app.py file.
Your application requires a Milvus database named Products with two collections:
- images
- products
If these collections are not present in the Milvus database, the application will encounter errors.
You can create the necessary database and collections via Milvus's CLI or Python SDK.
In the semantic_search_app.py file, specify the IP address of your device and port 19530:
HOST = 'your-device-ip'
PORT = '19530'The code is structured as a Python module. You can run the app using:
python -m App.semantic_search_appAlternatively, you can run the Milvus Docker container on a cloud instance. Update the semantic_search_app.py with the appropriate host and port of the cloud instance:
HOST = 'cloud-instance-ip'
PORT = '19530'Then, run the application as described in the local setup.

