Skip to content
v2.275.0

KnowledgeBaseFlowNodeConfigurationProperty Struct ​

Contains configurations for a knowledge base node in a flow.

This node takes a query as the input and returns, as the output, the retrieved responses directly (as an array) or a response generated based on the retrieved responses. For more information, see Node types in a flow in the Amazon Bedrock User Guide.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_bedrock as bedrock } from 'aws-cdk-lib';

declare const additionalModelRequestFields: any;
const knowledgeBaseFlowNodeConfigurationProperty: bedrock.CfnFlowVersion.KnowledgeBaseFlowNodeConfigurationProperty = {
  knowledgeBaseId: 'knowledgeBaseId',

  // the properties below are optional
  guardrailConfiguration: {
    guardrailIdentifier: 'guardrailIdentifier',
    guardrailVersion: 'guardrailVersion',
  },
  inferenceConfiguration: {
    text: {
      maxTokens: 123,
      stopSequences: ['stopSequences'],
      temperature: 123,
      topP: 123,
    },
  },
  modelId: 'modelId',
  numberOfResults: 123,
  orchestrationConfiguration: {
    additionalModelRequestFields: additionalModelRequestFields,
    inferenceConfig: {
      text: {
        maxTokens: 123,
        stopSequences: ['stopSequences'],
        temperature: 123,
        topP: 123,
      },
    },
    performanceConfig: {
      latency: 'latency',
    },
    promptTemplate: {
      textPromptTemplate: 'textPromptTemplate',
    },
  },
  promptTemplate: {
    textPromptTemplate: 'textPromptTemplate',
  },
  rerankingConfiguration: {
    type: 'type',

    // the properties below are optional
    bedrockRerankingConfiguration: {
      modelConfiguration: {
        modelArn: 'modelArn',

        // the properties below are optional
        additionalModelRequestFields: additionalModelRequestFields,
      },

      // the properties below are optional
      metadataConfiguration: {
        selectionMode: 'selectionMode',

        // the properties below are optional
        selectiveModeConfiguration: {
          fieldsToExclude: [{
            fieldName: 'fieldName',
          }],
          fieldsToInclude: [{
            fieldName: 'fieldName',
          }],
        },
      },
      numberOfRerankedResults: 123,
    },
  },
};

Properties ​

guardrailConfigurationoptionalIResolvable | CfnFlowVersion.GuardrailConfigurationPropertyguardrail_configurationoptionaltyping.Union[IResolvable, GuardrailConfigurationProperty]guardrailConfigurationoptionalIResolvableGuardrailConfigurationoptionalIResolvableGuardrailConfigurationoptionalinterface{}#
Contains configurations for a guardrail to apply during query and response generation for the knowledge base in this configuration.
inferenceConfigurationoptionalIResolvable | CfnFlowVersion.PromptInferenceConfigurationPropertyinference_configurationoptionaltyping.Union[IResolvable, PromptInferenceConfigurationProperty]inferenceConfigurationoptionalIResolvableInferenceConfigurationoptionalIResolvableInferenceConfigurationoptionalinterface{}#
Contains inference configurations for the prompt.
knowledgeBaseIdstringknowledge_base_idstrknowledgeBaseIdStringKnowledgeBaseIdstringKnowledgeBaseId*stringrequired#
The unique identifier of the knowledge base to query.
modelIdoptionalstringmodel_idoptionalstrmodelIdoptionalStringModelIdoptionalstringModelIdoptional*string#
The unique identifier of the model or [inference profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) to use to generate a response from the query results. Omit this field if you want to return the retrieved results as an array.
numberOfResultsoptionalnumbernumber_of_resultsoptionalint | floatnumberOfResultsoptionalNumberNumberOfResultsoptionaldoubleNumberOfResultsoptional*float64#
The number of results to retrieve from the knowledge base.
orchestrationConfigurationoptionalIResolvable | CfnFlowVersion.KnowledgeBaseOrchestrationConfigurationPropertyorchestration_configurationoptionaltyping.Union[IResolvable, KnowledgeBaseOrchestrationConfigurationProperty]orchestrationConfigurationoptionalIResolvableOrchestrationConfigurationoptionalIResolvableOrchestrationConfigurationoptionalinterface{}#
The configuration for orchestrating the retrieval and generation process in the knowledge base node.
promptTemplateoptionalIResolvable | CfnFlowVersion.KnowledgeBasePromptTemplatePropertyprompt_templateoptionaltyping.Union[IResolvable, KnowledgeBasePromptTemplateProperty]promptTemplateoptionalIResolvablePromptTemplateoptionalIResolvablePromptTemplateoptionalinterface{}#
A custom prompt template to use with the knowledge base for generating responses.
rerankingConfigurationoptionalIResolvable | CfnFlowVersion.VectorSearchRerankingConfigurationPropertyreranking_configurationoptionaltyping.Union[IResolvable, VectorSearchRerankingConfigurationProperty]rerankingConfigurationoptionalIResolvableRerankingConfigurationoptionalIResolvableRerankingConfigurationoptionalinterface{}#
The configuration for reranking the retrieved results from the knowledge base to improve relevance.