# Vectara

## Quickstart Tutorial

{% embed url="<https://www.youtube.com/watch?v=rBqpvFcD5XY>" %}

## Prerequisite

1. Register an account for [Vectara](https://vectara.com/integrations/flowise)
2. Click **Create Corpus**

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-575a5236f5440da3bc411eb5b09c774640a8d20f%2F1.png?alt=media" alt=""><figcaption></figcaption></figure>

Name the corpus to be created and click **Create Corpus** then wait for the corpus to finish setting up.

## Setup

1. Click on the **"Access Control"** tab in the corpus view

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-95c6a532b8cb7d1913bb8cb77f0b1d8285ea594c%2F2.png?alt=media" alt=""><figcaption></figcaption></figure>

2. Click on the **"Create API Key"** button, choose a name for the API key and pick the **QueryService & IndexService** option

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-d8236eb37ff87bdcf4cc718b564d4871ce619cfc%2F3.png?alt=media" alt=""><figcaption></figcaption></figure>

3. Click **Create** to create the API key
4. Get your **Corpus ID, API Key, and Customer ID** by clicking the down-arrow under "copy" for your new API key:

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-4170964b034fa20f6fc8d56f7fe36117e9e4ac56%2F4.png?alt=media" alt=""><figcaption></figcaption></figure>

5. Back to Flowise canvas, and create your chatflow. Click **Create New** from the Credentials dropdown ane enter your Vectara credentials.

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-808bbdff3bced0a506153efb55164a682e2659f0%2F5.png?alt=media" alt="" width="500"><figcaption></figcaption></figure>

6. Enjoy!

## Vectara Query Parameters

For finer control over the Vectara query parameters, click on "**Additional Parameters**" and then you can update the following parameters from their default:

* Metadata Filter: Vectara supports meta-data filtering. To use [filtering](https://docs.vectara.com/docs/common-use-cases/filtering-by-metadata/filter-overview), ensure that metadata fields you want to filter by are defined in your Vectara corpus.
* "Sentences before" and "Sentences after": these control how many sentences before/after the matching text are returned as results from the Vectara retrieval engine
* Lambda: defines the behavior of [hybrid search](https://docs.vectara.com/docs/learn/hybrid-search) in Vectara
* Top-K: how many results to return from Vectara for the query
* MMR-K: number of results to use for [MMR](https://docs.vectara.com/docs/api-reference/search-apis/reranking#maximal-marginal-relevance-mmr-reranker) (max marginal relvance)

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-f0d16e32263d20227887c6dfd2ce16cda0737708%2F6.png?alt=media" alt="" width="500"><figcaption></figcaption></figure>

## Resources

* [LangChain JS Vectara Blog Post](https://blog.langchain.dev/langchain-vectara-better-together/)
* [5 Reasons to Use Vectara's Langchain Integration Blog Post](https://vectara.com/5-reasons-to-use-vectaras-langchain-integration/)
* [Max Marginal Relevance in Vectara](https://vectara.com/blog/get-diverse-results-and-comprehensive-summaries-with-vectaras-mmr-reranker/)
* [Vectara Boomerang embedding model Blog Post](https://vectara.com/introducing-boomerang-vectaras-new-and-improved-retrieval-model/)
* [Detecting Hallucination with Vectara's HHEM](https://vectara.com/blog/cut-the-bull-detecting-hallucinations-in-large-language-models/)
