> ## Documentation Index
> Fetch the complete documentation index at: https://doc.rapida.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Knowledge Retrieval Tool

> Configure and use the Knowledge Retrieval Tool to access information from your knowledge base

The Knowledge Retrieval Tool allows your assistant to fetch relevant information from your organization's knowledge base when responding to user queries. This guide will walk you through the process of adding and configuring this tool for your assistant.

## Prerequisites

Before adding the Knowledge Retrieval Tool, ensure that you have:

* [Created an assistant](/assistants/create-assistant)
* [Configured a knowledge base](/knowledge/create-knowledge)

## Adding the Knowledge Retrieval Tool

<Steps>
  <Step title="Navigate to Your Assistant">
    1. Go to the Assistants section in the main navigation menu.
    2. Select the assistant you want to configure.
    3. Click "Configure assistant" in the top right corner.
    4. Select "Tools and MCP" from the left sidebar menu.
    5. Click on **Add Tools**.
  </Step>

  <Step title="Configure the Tool">
    When configuring a Knowledge Retrieval tool, you'll need to provide several key elements:

    1. **Name**: A unique identifier for your tool (e.g., "knowledge\_retrieval\_challenges")
       * Use descriptive names that indicate the tool's purpose
       * Follow a consistent naming convention (e.g., snake\_case)

    2. **Description**: Details on when and how to use the function
       * Example: "retrieve challenges for user role and user industry"
       * Provide clear guidance on the tool's purpose and use cases
       * This helps the model determine when to invoke the tool

    3. **Fields**: Define parameters in JSON format following the OpenAI Function Tool Call schema:

       ```json theme={null}
       {
         "additionalProperties": false,
         "properties": {
           "query": {
             "description": "user role and user industry",
             "type": "string"
           }
         }
       }
       ```

       This schema follows the OpenAI Function Tool Call format where `additionalProperties: false` ensures only defined properties are allowed, `properties` defines the parameters the tool accepts with descriptions and data types for each (like `query`), and the schema validates inputs when the tool is called.

    4. **Expected Action**: From the list select "Knowledge Retrieval".

    5. **Knowledge**: Choose an existing knowledge from the dropdown, or create new.
       * Select from the dropdown list of available sources
       * Or create a [new knowledge](/assistants/knowledge/add-knowledge) source directly

    6. **Retrieval Setting**: Select a search method:
       * **Hybrid Search**: Combines full-text and vector searches for optimal results
       * **Semantic Search**: Uses vector embeddings to find semantically similar content
       * **Full Text Search**: Indexes all terms for keyword-based retrieval

    7. Configure **Top K** results (default: 5) to limit the number of results returned

    8. Set a **Score Threshold** (default: 0.5) for relevance filtering

    After configuring all parameters, click "Save tool" to add it to your assistant.
  </Step>

  <Step title="Save Configuration">
    After configuring the tool, click on the **Configure Tool** button to apply your changes.
  </Step>
</Steps>

## Using the Knowledge Retrieval Tool

Once configured, your assistant will automatically use the Knowledge Retrieval Tool when appropriate. The process typically follows these steps:

1. The assistant analyzes the user's query or conversation context.
2. If relevant, it calls the Knowledge Retrieval Tool with the necessary parameters.
3. The tool fetches information from the knowledge base.
4. The assistant incorporates the retrieved information into its response.

## Managing the Knowledge Retrieval Tool

You can modify or remove the Knowledge Retrieval Tool at any time:

1. Go to your assistant's configuration page.
2. Select "Tools and MCP" from the left sidebar menu.
3. Find the Knowledge Retrieval Tool in the list.
4. Click on **Edit Tool** to modify its configuration or **Delete Tool** to delete it.

## Best Practices

* Regularly update your knowledge base to ensure the assistant provides the most current information.
* Monitor your assistant's performance and adjust the tool's configuration as needed.
* Use clear and specific queries to get the most relevant results from the knowledge base.

By effectively configuring and utilizing the Knowledge Retrieval Tool, your assistant can provide more accurate, up-to-date, and relevant information to users based on your organization's specific knowledge resources.
