Create a knowledge base

更新时间:
复制 MD 格式

Quickly ingest data from Alibaba Cloud Elasticsearch and OpenSearch to build an enterprise-specific knowledge base in OpenSearch-LLM-based Agentic Search. You can then use this knowledge base to create agents with natural language instructions for applications like intelligent Q&A and knowledge retrieval, enhancing your enterprise search efficiency.

Procedure

  1. Log on to the OpenSearch-LLM-based Agentic Search console.

  2. Select the China (Shanghai) region, switch to OpenSearch-LLM-based Agentic Search, and then select the target workspace.

  3. In the left-side navigation pane, click Knowledge Base, click Create Knowledge Base, and then configure the following parameters.

    • Basic Information

      Parameter

      Description

      Knowledge Base Name

      Knowledge base names must be unique within a workspace.

      To switch workspaces, use the navigation pane on the left:

      Source of Knowledge Base

      Knowledge base sources include the following:

      • Alibaba Cloud Elasticsearch

      • Alibaba Cloud OpenSearch Vector Search Edition

      • Alibaba Cloud OpenSearch LLM-Based Conversational Search Edition

      Description

      Enter a description to help you identify the knowledge base.

    • Knowledge Base Connection Parameters

      Parameter

      Description

      Network Type

      By default, the knowledge base is connected over the Internet.

      Domain Name

      Configure the domain information based on the knowledge base source:

      • Alibaba Cloud Elasticsearch: Log on to the Alibaba Cloud Elasticsearch console and click the target instance. In the left navigation bar, click Configuration and Management > Security Settings to obtain the public address. Add the public address to the domain name input box. Example: http:es-xx-xxxxxxxxxxxxxxxxx.public.elasticsearch.aliyuncs.com:9200, where 9200 is the public port number.

        You must add the static IP address 47.100.254.67 to the Elasticsearch public allowlist. This action allows OpenSearch-LLM-based Agentic Search to read data from your instance's public address.

      • Alibaba Cloud OpenSearch Vector Search Edition: Log on to the Alibaba Cloud OpenSearch Vector Search Edition console and click the target instance to get the public address. Enter this address in the Domain field.

        Add the IP address 47.100.254.67 to the public allowlist of the instance. This action allows OpenSearch-LLM-based Agentic Search to read data from the instance's public address.

      Instance Name

      If the knowledge base source is Alibaba Cloud OpenSearch Conversational Search Edition, select the corresponding instance ID.

      Authentication Information

      Configure the authentication credentials for the knowledge base source in the username:password format.

      • Alibaba Cloud Elasticsearch: The username is always elastic. If you forget the password, you can reset it in the console.

      • Alibaba Cloud OpenSearch Vector Search Edition: View the username and password on the Instance Details page.

      Index Name

      Enter the name of the index.

    • Knowledge Base Search Query: This section applies only if the knowledge base source is Alibaba Cloud Elasticsearch or Alibaba Cloud OpenSearch Vector Search Edition.

      Parameter

      Description

      Retrieval Type

      • Hybrid Search: Supported when the knowledge base source is Alibaba Cloud Elasticsearch or Alibaba Cloud OpenSearch Vector Search Edition.

        This type combines traditional text search with semantic, dense, and sparse vector search.

        • Filter Statement

        • Number of Entries

      • Custom Retrieval: Supported when the knowledge base source is Alibaba Cloud Elasticsearch.

        • query_string: The simplest search method, which allows users to enter search queries directly in natural language.

          For example, in q=title:${parameters.query}&size=10&from=0, q is the identifier for the query parameter. The query specifies a search in the title field. parameters.query is a placeholder that is replaced with the user's actual input. size specifies the number of results to return, and from specifies the starting point for pagination. You can modify the parameter values based on your actual business needs.

        • search_template: Uses a predefined query structure where parameters are dynamically populated. You must create the search template in Elasticsearch first.

        • DSL: Use DSL for fine-grained control over search logic and to build complex queries.

          For example, to query for orders from the last 30 days with a sales amount greater than 10,000 and a customer rating of A:

          {
            "query": {
              "bool": {
                "must": [
                  { "range": { "date": { "gte": "now-30d" } } },
                  { "range": { "amount": { "gte": 10000 } } },
                  { "term": { "rating": "A" } }
                ]
              }
            }
          }

    • Embedding Configurations: This section applies only if the knowledge base source is Alibaba Cloud Elasticsearch or Alibaba Cloud OpenSearch Vector Search Edition.

      Parameter

      Description

      Dense Embedding Model

      Select a dense vectorization model to vectorize the knowledge base data. For more information about the models, see Model overview.

      Sparse Embedding Model

      Select a sparse vectorization model to vectorize the knowledge base data. For more information about the models, see Model overview.

      Model Endpoint

      The model service endpoint in the current workspace.

      API KEY

      When a model is called, the caller's identity is authenticated using an API key.

    • Parameter Configuration: This section applies only if the knowledge base source is Alibaba Cloud Elasticsearch or Alibaba Cloud OpenSearch Vector Search Edition. Here, you can specify the Parameter Type and Description for fields in your index.

  4. After configuring the parameters, click Connectivity Test. In the panel that appears on the right, enter a test query. If the Connectivity Status is Test Passed, the knowledge base data can be read. Click OK to save the configuration.

    You can now use this knowledge base in Agentic Search to build agents with natural language instructions. These agents can power enterprise applications for intelligent Q&A and knowledge retrieval, improving search efficiency.