This project is a Node.js application that processes documents into embeddings using the OpenAI API and stores them in a Qdrant vector database. It features a modern web interface for file uploads and provides a backend service that can be consumed by chatbot front-ends for enhanced document-based interactions.
Pairs with librai-ui.
Clone the repository:
git clone <repository-url>
cd <repository-directory>Install dependencies:
npm installCreate a .env file in the root directory and add the following environment variables:
PORT=3000
OPENAI_API_KEY=<your-openai-api-key>
OPENAI_EMBEDDINGS_MODEL=<your-openai-embeddings-model>
QDRANT_API_URL=<your-qdrant-api-url>
QDRANT_API_KEY=<your-qdrant-api-key>
QDRANT_COLLECTION=<your-qdrant-collection-name>
Build the project:
npm run buildStart the server:
npm startAccess the web interface:
Open your browser and navigate to http://localhost:3000
Or use the API programmatically:
curl -X POST http://localhost:3000/api/files/upload -F 'file=@/path/to/your/file.pdf'For development purposes, you can run the server in watch mode:
npm run devTo enable hot reloading of CSS, run this command in a separate terminal:
npm run dev:cssContributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE.txt file for more details.