In this section I will walk you through how to deploy and run this app.
To run this app, you need the following:
To run the app locally, follow these steps:
- Clone this repo
git clone git@github.com:dabit3/semantic-search-nextjs-pinecone-langchain-chatgpt.git
-
Change into the directory and install the dependencies using either NPM or Yarn
-
Copy
.example.env.local
to a new file called.env.local
and update with your API keys and environment.Be sure your environment is an actual environment given to you by Pinecone, like
us-west4-gcp-free
-
(Optional) - Add your own custom text or markdown files into the
/documents
folder. -
Run the app:
npm run dev
When creating the embeddings and the index, it can take up to 2-4 minutes for the index to fully initialize. There is a settimeout function of 180 seconds in the utils
that waits for the index to be created.
If the initialization takes longer, then it will fail the first time you try to create the embeddings. If this happens, visit the Pinecone console to watch and wait for the status of your index being created to finish, then run the function again.
To add more data, add text files to the /documents
folder. These can be text, markdown, or PDF files.