Untitled

Concerning the use of embeddings, you can use the “Queries tab” to ensure they are being used in the context of your chatbot. You should also see a request made from the ada model that is used to fetch the data from the vector database.

Untitled

Untitled

Make sure you can find the embedding you are expecting by using the Search mode in the embeddings tab. If nothing appears, make sure your settings for the minimum score are low enough; if it’s too high, no embedding at all might be picked up.

Untitled

You can use the following filter to ensure that the embeddings are being used. This will write in your logs the embedding that is being added to your chatbot context.

add_filter( "mwai_context_search", 'my_web_search', 10, 3 );

function my_web_search( $context, $query, $options = [] ) {

  if ( !empty( $context ) ) {
    error_log( "Context: " . print_r( $context, true ) );
    return $context;
  } else {
		error_log( "Empty Context." );
	}

  return null;
}

🗒️ Please ensure that there is adequate space within your context for your embeddings. In the settings, you will find the context max tokens parameter, which determines the number of tokens your embeddings will occupy. If this setting is empty, it will be considered as 0, which means that the embeddings will occupy 0 tokens and, consequently, won't be used.

Untitled

Sometimes your query might not be precise enough for a vector to be returned. Be sure to use terms that match what you are looking for. 😊