Skip to content

Repository files navigation

Project Description

This project is a Python application that implements gRPC-based similarity search
functionality. It consists of both client and server components for adding items to a search
index, searching for similar items, and retrieving search results.

Features

● Add Items:You can add items to the search index by making gRPC requests to the server.
Each item consists of an item_id and a description.

● Search Items: The server allows you to search for items similar to a given query.
The search query consists of a description.

● AGet Search Results: You can retrieve the search results from the server.

📍How to install:

⬇Manual start:


1 - Connect venv:

python3 -m venv venv

2 - Activate it:

For Windows

.\venv\Scripts\activate

For MacOS

source venv/bin/activate 

3 - Install libraries:

pip install -r requirements.txt

Create DB in PostgreSQL:

CREATE TABLE items (
    id SERIAL PRIMARY KEY,
    item_id VARCHAR(255) NOT NULL,
    description TEXT NOT NULL
);

Create Your .env

In order to run the application, you need to set up a .env file with the following configuration:
DB_NAME=<your_database_name>
DB_USER=<your_database_user>
DB_PASSWORD=<your_database_password>
DB_HOST=<your_database_host>
DB_PORT=<your_database_port>

Create pb2:

python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. similarity_search.proto

Run server:

python server.py

Run client:

python client.py

Run tests:

python -m unittest tests/test_server.py

🐳How to connect Docker Compose:


UP Docker-compose:

docker-compose up --build

About

A versatile Python application for gRPC-based similarity search.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages