This is a demo project for a chatbot that queries Pinecone and OpenAI to provide responses based on a design system documentation site.
- Node.js (v14 or higher)
- npm (v6 or higher)
- Pinecone API key
- OpenAI API key
- Zeroheight API credentials
- Clone the repository:
sh
git clone https://github.com/zeroheight-demos/zhapi-chatbot.git
cd zhapi-chatbot
- Install the dependencies:
npm install
- Create a .env file in the root directory and add your API keys:
PINECONE_API_KEY=your-pinecone-api-key
PINECONE_INDEX_NAME=your-pinecone-index-name
PINECONE_URL=your-pinecone-url
OPENAI_API_KEY=your-openai-api-key
API_KEY=your-zeroheight-api-key
API_CLIENT=your-zeroheight-api-client
STYLEGUIDE_ID=your-styleguide-id
- Run the script to fetch data from Zeroheight and format it:
node fetchFromZeroheight.js
- Push the formatted data to Pinecone:
node pushToPinecone.js
- Start the server:
node app.js
- Open your browser and navigate to http://localhost:3000 to interact with the chatbot.
- app.js: Main server file that handles chat queries.
- fetchFromZeroheight.js: Script to fetch and format data from Zeroheight.
- pushToPinecone.js: Script to push formatted data to Pinecone.
- index.html: Frontend for interacting with the chatbot.
This project is licensed under the MIT License.