Overview

Trieve Analytics is a powerful tool that allows you to analyze your queries and gain insights from them.

Setting Up Trieve Analytics

Trieve automatically collects all of the searches and RAG chats that are made in your dataset. You don’t have to worry about manually tracking them.

Automatically Tracked Analytics

Search Analytics

We provide extensive analytics on your searches all of which can be found in the search analytics route. These analytics include:

  • Head Queries: Head queries is a collection of the most common queries.
  • Low Confidence Queries: The queries where all your results have scores, which can be useful for improving your search results.
  • No Results Queries: This table shows the queries that returned no results, which can be useful for improving your search results.
  • Popular Filters: This table shows the most popular filters used in searches.
  • Latency / time: This graph shows the average latency of searches over time.
  • Searches / time: This graph shows the number of searches made over time.

You can see all of this data on the dashboard in the analytics section, as well as be able to export them to a CSV so that you can analyze them in your own tools.

RAG Chat Analytics

We provide extensive analytics on your RAG chats all of which can be found in the RAG analytics route. These analytics include:

  • Usage over time: This graph shows the number of RAG chats made over time.
  • All RAG Chats: This table shows all of the RAG chats made in your dataset.

You can see all of this data on the dashboard in the analytics section, as well as be able to export them to a CSV so that you can analyze them in your own tools.

Custom Metrics

Getting the Search ID

All V2 Searches Return an id, this id is will be used for all search event types

search_response.json
{
    "chunks" : [
        // ... Your Chunk Data
    ], 
    id: "" // UUID used to track
    // ... other data
}

RAG requests return a TR-QueryID Header in the Response Headers.

Track Click Through Rate data

Send Clik-Through Rate data to Trieve using the send CTR data route. Referencing your search id from the previous step.

chunk_id in this case is the chunk the user clicked on from the search

You can also send user feedback to the Trieve API using the rate search query route or rate RAG query route.

The rating parameter can be any number of your choosing. Feel free to make your own rating scales

Custom event types

You can send custom events to the Trieve API using the send event route. Referencing your search id from the previous step

Querying Custom Metrics

You can query this custom event data using the get all events route. This will return all of the custom events that you have sent to the Trieve API.

curl
curl --request POST \
  --url https://api.trieve.ai/api/analytics/events \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "filter": {
    "date_range": {
      "gt": "2021-08-10T00:00:00Z",
      "lt": "2021-08-11T00:00:00Z"
    },
    "event_type": "your_custom_event_type",
    "is_conversion": true,
    "metadata_filter": "path = \"value\"",
    "user_id": "user1"
  }
}'