Skip to main content
1
npm install @helicone/helpers
2
export HELICONE_API_KEY=<your-helicone-api-key>
3
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
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