A Python-based vector search system using Qdrant and PostgreSQL to find employees with specific skills using natural language queries.
✅ Stores employee bios in PostgreSQL
✅ Converts bios into vector embeddings using sentence-transformers
✅ Stores embeddings in Qdrant for fast similarity search
✅ Supports case-insensitive keyword matching
✅ Returns paginated search results
qdrant_search_project/
│── embeddings.py # Generate vector embeddings
│── database.py # PostgreSQL connection setup
│── vector_store.py # Store and search vectors in Qdrant
│── search.py # Query function for similarity search
│── main.py # Run queries from command line
│── run.sh # Automate setup and execution
│── requirements.txt # Dependencies
│── docker-compose.yml # Runs PostgreSQL & Qdrant in containers
│── .env # Database credentials
│── README.md # Documentation
│── init-db.sql # Creates database, user, and table
git clone git@github.com:dev-vivekkumarverma/Qdrant.git
cd Qdrant
Create a .env
file:
POSTGRES_USER=test_user
POSTGRES_PASSWORD=test@123
POSTGRES_DB=test_db
POSTGRES_PORT=5432
QDRANT_HOST=localhost
QDRANT_PORT=6333
change the chmod of the run.sh file
chmod +x run.sh
Execute the run.sh file
./run.sh
This script will:
✅ Start Docker containers (PostgreSQL & Qdrant)
✅ Install dependencies
✅ Populate Qdrant with employee bios
✅ Launch the query system
python main.py
Example input:
Enter query: Databricks SQL
Enter page number: 1
Example output:
[
{
"user_id": 1,
"bio": "Experienced data engineer skilled in Databricks, SQL, and Apache Spark.",
"similarity_score": 0.92,
"keywords_matched": ["databricks", "sql"]
},
{
"user_id": 6,
"bio": "Data scientist with strong skills in SQL, Databricks, and Python.",
"similarity_score": 0.89,
"keywords_matched": ["databricks", "sql"]
}
]
To stop all services:
docker-compose down
To remove all stored data:
docker-compose down -v