You’ll need Node.js 18+ to run this code. Download it here.
You'll also need to have Docker Compose installed.
To get started, copy the `.env` file and set up required environment variables:
To create the containers, install the required dependencies, and launch the server, run:
This will create the following containers:
- Redis (cache)
- Unstructured (handles images, PPT, text, markdown)
- OpenSearch (search engine)
- OpenSearch-dashboards (search engine dashboard)
OpenSearch dashboard can be accessed at http://localhost:5601
There are several API endpoints available for various tasks:
Add content to OpenSearch: `POST /api/add`
Get a response using a live webpage as context: `POST /api/live`
Get a response using the vector store: `POST /api/question`
Clear Redis cache: `GET /api/clearcache`
Delete a collection: `DELETE /api/collection`
Using live data
You can also use the `/api/live` endpoint to get a response using a live webpage as context without vectorizing the content.
Using the knowledge base
Once you've added content to OpenSearch, you can use the `/api/question` endpoint to get answers based on your knowledge base.
Now you can easily set up and use your knowledge base to answer questions and provide valuable information for your users using the API Step in your Voiceflow Assistants.