This Flask application integrates with Qdrant for vectorized storing of posts and searching similar posts. It provides endpoints for both storing data and searching for similar content.
- Python 3.x
- Flask
- Qdrant Client
-
Clone the repository:
git clone https://github.com/LiveWiresSRM2023/Curious-Bees
-
Install dependencies:
pip install -r requirements.txt
-
Set up Qdrant:
- Obtain API key and URL from Qdrant
- Create
password.py
with your API key and URL stored in the variables of the same name
-
Start the Flask server:
python SE&DB_API.py
-
Send POST requests to store data:
POST /data Content-Type: application/json { "user_id": "<user_id>", "type": "post", "content": "<content>", "id_token": "<id_token>" }
-
Send POST requests to search for similar content:
POST /search Content-Type: application/json { "user_id": "<user_id>", "type": "search", "content": "<content>", "id_token": "<id_token>" }
-
Vectorize and Send Data to Database:
We've implemented the
vectorize_content
andsend_db
functions in our Flask application. When sending a POST request with data, we vectorize the content using these functions and store it in the database along with its ID. -
Vectorize Query and Find Similar Posts:
We've also implemented the
similarity
function in our Flask application. When sending a POST request for searching, we vectorize the content of the query and compare it with existing posts in the database to find similar ones. These similar posts are then sent back to the user.
Contributions to improve the versatility and functionality of this project are welcome! Your effort in making this project robust is much appreciated!