Creating a Knowledge Base in Generative AI Agents

Create a knowledge base in the Generative AI Agents service.

  1. On the Knowledge bases list page, select Create knowledge base.
    If you need help finding the list page, see Listing Knowledge Bases.
  2. Enter the following information:
    • Name: A name that starts with a letter or underscore, followed by letters, numbers, hyphens, or underscores. The length can be from 1 to 255 characters.
    • Compartment: The compartment that you want to store the knowledge base in
    • Description: An optional description
  3. For Data store type, select one of the following options:
  4. If you selected Object storage, perform the following actions:
    1. (Optional) Select Enable hybrid search to combine lexical and semantic search. If you don't select this option, you get lexical search only.
    2. Under Data sources, select Specify data source and enter a name and optional description for the data source.
    3. Select the bucket that contains the data for the knowledge base. Change the compartment if the bucket is in another compartment.
      See Data requirements for Object Storage to ensure that the files in the buckets meet the requirements for Generative AI Agents.
    4. After the contents of the bucket are listed, perform one of the following actions to select the files to use:
      • Select the Select all in bucket checkbox.
      • Select the checkboxes next to the files and folders to include.
      • Expand Add object prefixes manually to type the prefixes for the files and folders to include.
    5. (Optional) Select Show tagging options and add one or more tags to the data source. If you have permissions to create a resource, then you have permission to update its tags. If you need help, see Tags and Tag Namespace Concepts.
    6. Select Create.
    7. (Optional) Select Automatically start ingestion job for above data sources.
      If you don't select this option, you must ingest the data later for your agent to use it.
    Note

    You can have only one data source per knowledge base. See Limits and Limitations for Generative AI Agents.
  5. If you selected OCI OpenSearch for the data source type, enter the following information. See OCI Search with OpenSearch Guidelines for Generative AI Agents, if necessary.
    • OpenSearch cluster: Select the cluster that contains the data for the knowledge base. Change the compartment if the cluster is in another compartment.
    • OpenSearch index: Enter the details of the OpenSearch index. See OCI Search with OpenSearch Guidelines for Generative AI Agents.
    • Secret details: Select one of the following options:
      • Basic auth secret: For this option, select the Vault secret for OCI Search with OpenSearch.
      • IDCS secret: For this option, enter the following information for the IDCS confidential application that you want to use for the agent:
        • Identity domain: Select the identity domain to use to access the cluster. Change the compartment if the identity domain is in another compartment.
        • Client Id: Enter the ID for the OpenSearch cluster's IDCS client application.
        • Client secret vault: Select the vault that contains the client secret. Change the compartment if the secret is in another compartment.
        • Scope URL: Enter the URL that is the API endpoint for the identity domain's resource server application and includes the agent scope. For example, for genaiagent scope, the URL is https://*.agent.aiservice.us-chicago-1.oci.oraclecloud.com/genaiagent.

      To learn about OpenSearch clusters, read about an OpenSearch cluster's detail page.

  6. If you selected Oracle AI Vector Search for the data source type, select the database tool connection and then select Test connection to confirm a successful connection to the database. If successful, the database name and version are displayed. Then, enter the vector search function for the database tool connection.
    Note

    See the Oracle Database Guidelines for Generative AI Agents to help you enter the values for this step.
  7. (Optional) Select Show tagging options and add one or more tags to the knowledge base. If you have permissions to create a resource, then you have permission to update its tags. If you need help, see Tags and Tag Namespace Concepts.
  8. Select Create.

    The knowledge base takes a while to create. After the knowledge base is created, if you don't have ingested data, follow the steps in Ingesting Data Source Data in Generative AI Agents.

    Note

    After a data ingestion job runs for an Object Storage data source, review the status logs to confirm that all updated files were successfully ingested. If the ingestion job fails (for example, because a file was too large), address the issue and restart the job.

    When you restart a previously run ingestion job, the pipeline detects files that were successfully ingested earlier and skips them. The pipeline ingests only files that failed previously and have since been updated. For example, you have 20 files to ingest, and the initial job run results in 2 failed files. When you restart the job, the pipeline recognizes that 18 files have already been successfully ingested and ignores them. It ingests only the 2 files that failed earlier and have since been updated.