This Next.js application uses Retrieval Augmented Generation (RAG) to answer questions based on the contents of a PDF file. It leverages OpenAI, HuggingFace, and Pinecone APIs to perform natural language processing and semantic search.
- Upload and process PDF files.
- Ask questions and get answers based on the PDF content.
- Uses OpenAI for generating answers.
- Uses HuggingFace for processing.
- Uses Pinecone for efficient semantic search.
These instructions will help you set up and run the project on your local machine for development and testing purposes.
- Node.js (>= 14.x)
- npm (>= 6.x) or yarn
- OpenAI API key
- HuggingFace API key
- Pinecone API key
-
Clone the repository
-
Install dependencies:
npm install
-
Set up environment variables:
Create a
.env.localfile in the root directory and add your API keys:OPENAI_API_KEY=sk-proj- HUGGINGFACE_API_KEY= PINECONE_API_KEY=
To start the development server, run:
npm run devOr with yarn:
yarn devOpen your browser and navigate to http://localhost:3000 to see the application in action.