This is a Next.js 14 project using features like App Router and Server Actions. It showcases the use of the OpenAI Assistants API with the File Search Tool enabled, allowing it to interact with any document supported by OpenAI.
This application does not rely on any provisioned vector database or third-party libraries for Retrieval-augmented generation (RAG). Instead, it exclusively utilizes the OpenAI SDK to manage and interact with proprietary documents.
- Next.js 14 App Router and Server Actions
- OpenAI Assistants API
- With File Search tool to chat with any document supported by OpenAI
- Vercel AI SDK
- Use createStreamableValue and readStreamableValue for streaming OpenAI's response
- shadcn/ui
- Styling with Tailwind CSS
- Radix UI for headless component primitives
- Icons from Lucide Icons
To set up the project locally, follow these steps:
- Clone the repository to your local machine.
- Install the required dependencies with
npm install
. - Set up your environment variables in a
.env.local
file in the root directory of the project. Use the provided.env.example
file as a template. You will need to provide your OpenAI API Key. - Run the development server with
npm run dev
.
Open http://localhost:3000 with your browser to access the app.
- Next.js Documentation - learn about Next.js features and API.
- OpenAI Documentation - learn how to use the OpenAI Assistants API.
This is a proof of concept and should not be used in production as it is. It does not have any rate limiting or security features enabled.