This project provides a service to upload a PDF file and create a Retrieval-Augmented Generation (RAG) system. A chatbot is included to answer questions based on the PDF content.
- Upload a PDF file and process its content.
- Create a RAG pipeline for efficient information retrieval.
- Chatbot interface to interact with the extracted content.
Ensure you have the following dependencies installed:
- Node.js (v20)
- NPM
- Serverless Framework
- Docker Compose
- Weaviate Database
- AWS Account
Set up the following environment variables before running the project:
OPENAI_API_KEY=<your_openai_api_key>
WEAVIATE_SCHEME=<http_or_https>
WEAVIATE_HOST=<your_weaviate_host>
WEAVIATE_API_KEY=<your_weaviate_api_key>
AWS_SECRET_KEY=<your_aws_secret_key>
AWS_ACCESS_KEY=<your_aws_access_key>
-
Clone the repository:
git clone <repository-url> cd <project-directory>
-
Install dependencies:
npm install
-
Set up your environment variables as mentioned above.
-
Start the required services using Docker Compose:
docker-compose up -d
-
Install dependencies:
npm install
-
Set up your environment variables as mentioned above (You can use .env file).
-
Run follow command:
npm start
-
Set up your environment variables as mentioned above (You can use .env file).
-
Deploy the serverless functions:
npm install
serverless deploy
- After running deploy, you should see output similar to:
Deploying "aws-node-express-api" to stage "dev" (us-east-1)
✔ Service deployed to stack aws-node-express-api-dev (96s)
endpoint: ANY - https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com
functions:
api: aws-node-express-api-dev-api (2.3 kB)
-
Access the chatbot via the provided endpoint.
-
Upload a PDF file and start querying its content.
This project is licensed under the MIT License.