Skip to main content
This guide will help you set up and run a demo using a sample job listing dataset on the Trieve platform. Follow the steps below to get everything working.

Steps to Set Up the Demo

  1. Clone the repository:
  2. Install the required dependencies:
    This demo uses Bun as a runtime. Install Bun by running:
    Install the dependencies by running:
  3. Create an account on Trieve: Go to Trieve Dashboard and create an account.
  4. Create a new dataset and copy the dataset ID. You can either create a dataset on the Trieve Dashboard or use our CLI
  5. Create a new API key and copy the API key.
  6. Create an .env file in the root of the project and add the following environment variables:
  7. Download the dataset
  8. Run the demo:
  9. View the results Head over to https://search.trieve.ai and select your dataset. Try out a few sample queries like software engineer at google title or show me some listings knowing I have experience as a mechanic title

Breakdown of the script

Creating a data model to represent the data

When we receive the CSV data, we need to turn it into a data model to be able to effectively pull the data out of it. The data model for this CSV looks like:

Creating the Searchable Chunk HTML

The Chunk HTML should contain the data that we want to be searchable. In this case, we include the job title, description and other text fields that provide more context to the embedding model so that it can generate a better embedding to represent the job.
It is typically best practice to put a \n\n between each field to separate them so that the model can differentiate between them.
The following function transforms job data into the searchable chunk HTML:

Creating a Chunk

When possible, use our bulk upload API to upload data in chunks of up to 120 to take advantage of the speed of the API.
To efficiently upload data, we divide it into chunks. Here’s the code snippet for creating a chunk with the data:
Checkout the api reference for the upload API to view all of the parameters that can be passed in with the chunk. By following this guide, you should be able to set up and run the demo successfully. If you encounter any issues, refer back to the steps and ensure all configurations are correctly set up.