# KnowledgeBaseFlowNodeConfigurationProperty

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](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) in the Amazon Bedrock User Guide.

- Source: Generated code
- Type last changed: v2.201.0 · 13 Jun 2025

## 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

- `guardrailConfiguration`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFlowVersion.GuardrailConfigurationProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_bedrock.CfnFlowVersion.GuardrailConfigurationProperty.html) — Contains configurations for a guardrail to apply during query and response generation for the knowledge base in this configuration.

- `inferenceConfiguration`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFlowVersion.PromptInferenceConfigurationProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_bedrock.CfnFlowVersion.PromptInferenceConfigurationProperty.html) — Contains inference configurations for the prompt.

- `knowledgeBaseId`: string (required) — The unique identifier of the knowledge base to query.

- `modelId`: 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.

- `numberOfResults`: number — The number of results to retrieve from the knowledge base.

- `orchestrationConfiguration`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFlowVersion.KnowledgeBaseOrchestrationConfigurationProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_bedrock.CfnFlowVersion.KnowledgeBaseOrchestrationConfigurationProperty.html) — The configuration for orchestrating the retrieval and generation process in the knowledge base node.

- `promptTemplate`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFlowVersion.KnowledgeBasePromptTemplateProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_bedrock.CfnFlowVersion.KnowledgeBasePromptTemplateProperty.html) — A custom prompt template to use with the knowledge base for generating responses.

- `rerankingConfiguration`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFlowVersion.VectorSearchRerankingConfigurationProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_bedrock.CfnFlowVersion.VectorSearchRerankingConfigurationProperty.html) — The configuration for reranking the retrieved results from the knowledge base to improve relevance.
