https://github.com/sebi75/embeddings-searching
How to search long documents using OpenAI embeddings
https://github.com/sebi75/embeddings-searching
embeddings microservice openai python vite
Last synced: 8 months ago
JSON representation
How to search long documents using OpenAI embeddings
- Host: GitHub
- URL: https://github.com/sebi75/embeddings-searching
- Owner: sebi75
- Created: 2023-05-05T19:36:58.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-06T14:49:49.000Z (almost 3 years ago)
- Last Synced: 2025-04-07T02:37:18.429Z (12 months ago)
- Topics: embeddings, microservice, openai, python, vite
- Language: TypeScript
- Homepage:
- Size: 4.8 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Searching Documents Using Natural Language
This project is a web application that offers a modern user interface for uploading and searching documents using natural language. It consists of two main components: a Vite React app for the user interface, and a Python Flask server for handling all the logic.

## Folder Structure
The project is organized into two main folders:
ui: Contains the Vite React app for the user interface. Users can upload documents and search through them using an intuitive, modern UI.
server: Contains the Python Flask server, which has several endpoints defined for fetching already indexed documents, indexing new documents using the OpenAI embeddings API, and searching documents using natural language.
## Getting Started
Follow these steps to set up the project and run it locally:
Prerequisites
Make sure you have Node.js (version 18.x or later) and Python (version 3.7 or later) installed on your system.
### UI Setup
From the project root navigate to the ui folder:
```bash
cd ui
```
Install the dependencies:
```bash
npm install
```
Start the Vite React app:
```bash
npm run dev
```
The app should now be running at http://localhost:5173.
Server Setup
From the project root, navigate to the server folder:
```bash
cd server
```
(Optional) Create a virtual environment:
```bash
python -m venv embeddings-search
```
Activate the virtual environment:
On macOS and Linux:
```bash
source my_project_env/bin/activate
```
On Windows:
```bash
.\my_project_env\Scripts\activate
```
Install the dependencies:
```bash
pip install -r requirements.txt
```
Create a .env file in the server folder and add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_here
Start the Flask server:
```bash
python app.py
```
The server should now be running at http://localhost:5000.
Usage
With both the UI and server running, you can now access the web application at http://localhost:5173. Upload documents and search through them using natural language queries.