- Clone the repo to your local machine. Run
npm install. - Sign up for a free Algolia account and create an application.
- Rename .env.example to .env, and set environment variables
ALGOLIA_APPLICATION_IDandALGOLIA_API_KEYusing the Application ID and Search API Key from the API Keys page in Algolia. Note that you can't use the Search API Key to edit or add to an index - the project as-is only reads the data in the indexes. - Create three indexes in that application in Algolia called
announcements,products, andorders. Seed them with the JSON data from the/searchable_datafolder of the repo, unless you'd like to experiment with your own data. They're super simple to reverse-engineer, and they're mostly only going to get read by the LLM (who doesn't care about structure or consistency), so have fun with it. - Create an OpenAI account and add the minimum amount of funds on the Billing page. The minimum as of August 2024 is $5 USD. You likely won't use all of this though because this application uses the GPT 4o mini model, the most cost effective one at time of writing. The entire development and testing process for this repository used up $0.01 USD, and the other $4.99 USD will just sit there for future development.
- If you plan on making a publicly available version of this demo, make sure to set usage limits for your OpenAI account to prevent abuse.
- Create an API key for your OpenAI account and save it as an environment variable called
OPENAI_API_KEYwhere the application can access it. - From the root folder of the repo, run
node src/index.js. It'll start an Express server which you can access at http://localhost:3000/.
Repository navigation
forked from jadenguitarman/chatbot-db