1

To get started, install the @helicone/helpers package

npm install @helicone/helpers
2

Set up your Helicone API key in your .env file

Log into Helicone or create an account. Once you have an account, you can generate an API key here.
export HELICONE_API_KEY=<your-helicone-api-key>
3

Create a new HeliconeManualLogger instance

import { HeliconeManualLogger } from "@helicone/helpers";

const heliconeLogger = new HeliconeManualLogger({
  apiKey: process.env.HELICONE_API_KEY, // Can be set as env variable
  headers: {} // Additional headers to be sent with the request
});
4

Log your request

const res = await heliconeLogger.logRequest(
  {
    _type: "vector_db",
    operation: "search", // The operation performed. In this case, search.
    // ...include any other data about the vector db request here (look at the API reference for more details)
  },
  async (resultRecorder) => {
    // Your vector db operation here. In this case, search
    const searchResults = await vectorDB.search({
      query: "Find similar products to iPhone",
      limit: 3
    });

    // Log the results
    resultRecorder.appendResults({
      // These are the results of the operation that Helicone will log
      products: searchResults.map(result => ({
        name: result.name,
        price: result.price
      }))
    });

    return searchResults;
  }
);
5

Verify your requests in Helicone

With the above setup, any calls to any Vector DB will automatically be logged and monitored by Helicone. Review them in your Helicone dashboard.
To learn more about the HeliconeManualLogger API, see the API Reference here.