> ## Documentation Index
> Fetch the complete documentation index at: https://docs-classic.cognigy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Extract Output

[Updated in 2026.20.0](https://docs-classic.cognigy.com/release-notes/2026.20.md)

![Search Extract Output Node configuration panel](https://mintcdn.com/cognigy-docs-legacy/sbu8K_1z3Hht9e7i/_assets/ai/develop/node-reference/other/search-extract-output.png?fit=max\&auto=format\&n=sbu8K_1z3Hht9e7i\&q=85\&s=1ed243655e408772bcbac00f3697aaca)

## Description

> [!WARNING]
>
> As of Cognigy 4.69.0, the `topK.order` property of Knowledge Chunks in the search result generated by [Search Extract Output](https://docs-classic.cognigy.com/ai/agents/develop/node-reference/other-nodes/search-extract-output.md) Nodes is deprecated.

> [!WARNING]
>
> As of Cognigy 2026.18.0, the **Temperature**, **Maximal Tokens**, **Presence Penalty**, **Frequency Penalty**, **Use Stops**, and **Stops** parameters are deprecated. The removal is planned for April 2027. For models that don't support these parameters, activate the **Ignore deprecated parameters** toggle to exclude them from the request to the LLM provider. Otherwise, the request to the LLM provider might fail. If you plan to use these parameters, migrate them to the [Custom Options section](#custom-options) and activate the **Ignore deprecated parameters** toggle. Otherwise, Custom Options might not override them for every provider and model combination.
>
> For example, OpenAI models such as `gpt-5`, `gpt-5.1`, and `gpt-5.2` don't support these parameters. Similar models from other LLM providers might also not support these parameters. Check your LLM provider's documentation for model-specific support.

This Node searches through data within the Knowledge AI solution, extracts a relevant answer via a generative AI model, and creates an output.

## Prerequisites

* Configure a model that supports [Knowledge Search](https://docs-classic.cognigy.com/ai/agents/develop/gen-ai-and-llms/model-support-by-feature.md) in the **Knowledge AI Settings** section in **Manage > Settings**.

## Parameters

### Mode

There are three modes that offer different levels of data extraction and presentation:

> [tab] Search & Extract & Output
>
> Performs a search, extracts an answer, and outputs the result as text or adaptive card.
>
> In the Search & Extract & Output mode, the following steps are involved:
>
> 1. The system performs a knowledge search and retrieves relevant information.
> 2. The retrieved data is sent to a Language Model (LLM) for further processing.
> 3. The LLM extracts key points or answers from the search results, filtering out unnecessary details.
> 4. The extracted information is stored in the Input or Context objects.
> 5. The system automatically outputs the result from the LLM as either plain text or an adaptive card.
>
> For this mode, select models from the [list of supported providers](https://docs-classic.cognigy.com/ai/agents/develop/gen-ai-and-llms/model-support-by-feature.md) that cover the `LLM Prompt Node`, `Answer Extraction`, and `Knowledge Search` cases.

> [tab] Search & Extract
>
> Performs a search, extracts an answer, but doesn't perform an automatic output. Our customers can then manually create the output they desire.
>
> In the Search & Extract mode, the following steps are involved:
>
> 1. The system performs a knowledge search and retrieves relevant information.
> 2. The retrieved data is directly sent to the LLM for extraction of key points or answers.
> 3. The LLM extracts the relevant information and writes it to the Input or Context objects.
>
> For this mode, select models from the [list of supported providers](https://docs-classic.cognigy.com/ai/agents/develop/gen-ai-and-llms/model-support-by-feature.md) that cover both the `LLM Prompt Node`, `Answer Extraction`, and `Knowledge Search` cases.

> [tab] Search Only
>
> Performs a knowledge search and retrieves information without extraction or automatic output.
>
> In the Search only mode, the following steps are involved:
>
> 1. The system performs a knowledge search and retrieves relevant information.
> 2. The search response is stored in the Input or Context objects.
>
> For this mode, select models from the [list of supported providers](https://docs-classic.cognigy.com/ai/agents/develop/gen-ai-and-llms/model-support-by-feature.md) that cover the `Knowledge Search` case.

### Knowledge Store

Select a store from the list to allow the Node to retrieve the data.

> [accordion] Search Settings
>
> | Parameter | Type | Description |
> | - | - | - |
> | Context-Aware Search | Select | Considering the transcript's context for the search. It allows an AI Agent to answer follow-up questions. You can select one of the following options:<ul><li>**On** — is the default option. When this setting is enabled, it affects tokenization costs, which impact the amount of memory, computational power, and overall expenses needed for running an OpenAI or Azure OpenAI model. To get a better understanding of how the feature works in practice, see [Examples](#examples).</li><li>**Off** — the setting is turned off.</li></ul> |
> | Transcript Steps | Slider | Number of prior transcript steps to use in a context-aware search. This parameter is active when the Context-Aware Search setting is enabled. One transcript step consists of a pair: one user input and one AI Agent output. For example, if you select a quantity of 2, the system considers the 2 most recent pairs of user input and AI Agent output. |
> | Where to store the result | Select | The storage for the search results. Select a storage:<ul><li>**default** — the content is stored in the Input object (`input.knowledgeSearch`).</li><li>**Input** — the content is stored in the Input object.</li><li>**Context** — the content is stored in the Context.</li></ul> |
> | String to search for | CognigyScript | The string to search for in the Knowledge Store. A default value is stored in `input.text`. |
> | Top K | Slider | Sets how many of the knowledge search results are returned. The default value is 5, and the maximum value is 15. The results are stored under `input.knowledgeSearch.topK`. Any `\n` and `\t` instances in the [Knowledge Chunk text](https://docs-classic.cognigy.com/ai/agents/develop/knowledge-ai/knowledge-chunk/knowledge-chunk#knowledge-chunk-text) are replaced with spaces in the results. |
> | Source Tags | CognigyScript | The tags serve to refine the scope of your knowledge search, allowing you to include only the most pertinent sections of the knowledge base and, as a result, improve the accuracy of search outputs.   Before specifying tags, ensure that they were provided during the creation of the Knowledge Sources. Add Tags by specifying each Tag separately and pressing <kbd>Enter</kbd>. The maximum number of tags is 5.  When you specify multiple Source Tags, the Search Extract Output Node defaults to an `AND` operator, meaning it only considers Sources that have all the specified Tags. This approach ensures the search results are precise and highly relevant to the end user's query. To change this behavior, go to the **Match Types for Source Tags** parameter. |
> | Match type for Source Tags | Select | The operator to filter Knowledge Sources by Source Tags. Select one of the following options:<ul><li>**AND** — the default value, requires all tags to match across multiple Knowledge Sources. Consider the following example: there are Knowledge Sources with Tags `S-a`, `S-b`, and `S-c`. When you use the `AND` operator to filter by `S-a` and `S-b`, only Sources with both Tags `S-a` and `S-b` are included in the search results.</li><li>**OR** — requires at least one tag to match across multiple Knowledge Sources. Consider the following example: there are Knowledge Sources with Tags `S-a`, `S-b`, and `S-c`. When you use the `OR` operator to filter by `S-a` or `S-b`, any Source with either Tag `S-a` or `S-b` is included in the search results.</li></ul> |
>
> > [accordion] Source Tags
> >
> > * You can add CognigyScript within Source Tags.
> > * Source Tags are always lower-case, only alpha-numerics (a-z, 0-9), underscores, and hyphens are allowed.
> > * When using CognigyScript for Source Tags, it is important to lowercase them. For example, by using the following: `{{input.text.toLowerCase()}}`.

> [accordion] Extract Settings
>
> | Parameter | Type | Description |
> | - | - | - |
> | Ignore deprecated parameters | Toggle | Excludes the deprecated **Temperature**, **Maximal Tokens**, **Presence Penalty**, **Frequency Penalty**, **Use Stops**, and **Stops** parameters from the request to the LLM provider. Activate this toggle if your model doesn't support these parameters. If you activate this toggle for a model that supports them, the model uses default values. |
> | Prompt | CognigyScript | The prompt for generating completions. This prompt is designed for ChatGPT-based models. The behavior of this prompt may vary depending on the model used. You can change the prompt at your discretion.   In the prompt, the following tags are used to retrieve information from the Knowledge Store and Input object to ensure that the LLM receives all the necessary information to generate the most accurate response: <ul><li>`@answerLanguage` – the language that refers to the `input.language` value from the Input object for the current locale.</li><li>`@foundDocuments` – the top-k knowledge results determined from the end user's question.</li><li>`@userInput` – the message that the end user sent to the AI Agent in the conversation.</li></ul> |
> | Temperature | Slider | The appropriate sampling temperature for the model. Higher values mean the model takes more risks. |
> | Maximal Tokens | Slider | The maximum number of tokens to generate in the completion. |
> | Presence Penalty | Slider | Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood of talking about new topics. |
> | Frequency Penalty | Slider | Number between -2.0 and 2.0. The penalty assigns a lower probability to tokens frequently appearing in the generated text, encouraging the model to generate more diverse and unique content. |
> | Use Stops | Toggle | Whether to use a list of stop words to let Generative AI know where the sentence stops. |
> | Stops | Text | Up to 4 sequences where the API stops generating further tokens. The returned text doesn't contain the stop sequence. |
> | Timeout | Number | The maximum number of milliseconds to wait for a response from the LLM provider. |
> | Timeout Message | CognigyScript | The message to output if the timeout is reached. |

> [accordion] Output Settings
>
> | Parameter | Type | Description |
> | - | - | - |
> | OutputMode | Select | This parameter allows you to choose between two options for the output:<ul><li>**Text** — select this option if you want the system to provide a basic text-based response as the output.</li><li>**Adaptive Card** — select this option if you want a visual representation of an Adaptive Card as the output. Adaptive Cards are interactive and display rich content with buttons, images, and more.</li></ul> |
> | Output Fallback Text | CognigyScript | The text to output if no answer was found. |

> [accordion] Error Handling
>
> | Parameter | Type | Description |
> | - | - | - |
> | Select Error Handling Approach | List | Sets how Flow execution behaves if the AI Agent throws an error. You can select one of the following options:<ul><li>**Stop Flow Execution** — terminates the current Flow execution.</li><li>**Continue Flow Execution** — allows the Flow to continue executing, bypassing the error and proceeding to the next steps.</li><li>**Go to Node** — redirects Flow execution to a specific Node, which can be useful for error recovery or customized error handling.</li></ul> |
> | Error Message (optional) | Text | This parameter appears when you select **Continue Flow Execution** in **Select Error Handling Approach**. Add a message to output if the AI Agent fails. |
> | Select Flow | List | This parameter appears when you select **Go to Node** in **Select Error Handling Approach**. Sets the Flow that includes the Node to which you want to redirect Flow execution. |
> | Select Node | List | This parameter appears when **Go to Node** in **Select Error Handling Approach** is selected. Sets the Node to which you want to redirect Flow execution. |

> [accordion] Custom Options
>
> These options let you use parameters that aren't included in the Search Extract Output Node or overwrite set configurations.
>
> | Parameter | Type | Description | Example |
> | - | - | - | - |
> | Custom Options | JSON | Set custom parameters for the LLM configuration. You can set individual parameters as well as entire functions. These parameters customize the behavior of the model, such as adjusting `temperature`, `top_k`, or `presence_penalty`. This field overrides only the parameters set to generative models in the Search Extract Output Node; the field doesn't support custom options for embedding models used in the knowledge search. To view the full list of available parameters for your model, refer to the LLM provider's API documentation, for example, [OpenAI](https://platform.openai.com/docs/api-reference/chat/create) or [Azure OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/). For Amazon Bedrock and Anthropic models, you must use the `output_config` parameter to [customize the JSON structure in the output](#custom-options). | `{ "model": "gpt-4o", "temperature": 0.7, "max_tokens": 4000 }` |
> | Custom Request Options | JSON | Set custom parameters to customize the request to the LLM provider. These parameters override the configurations set in this Node. For example, setting a `{ "stream": true }` parameter overrides the **Output result immediately** option. For more information, refer to the LLM provider's API documentation. | `{ "stream": true }`, `{ "headers": { "Authorization": "Bearer <token>" } }` |
>
> **Forcing Model Versions**
>
> You can force the Search Extract Output Node to use a specific model version by including it in the Custom Options.
> This means that the Search Extract Output Node will use the specified version of the language model instead of the default or any other available version. This allows for more control over the behavior of the Search Extract Output Node, ensuring it uses the desired model version for generating prompts or responses.
>
> You can use models from any LLM provider supported by Cognigy, including those that aren't yet directly integrated.
> However, you can only replace a model with another from the same provider.
>
> Let's consider an example with Anthropic:
> You can force the Search Extract Output Node to use the model version `claude-opus-4-1-20250805`, although the LLM resource defaults to the `claude-opus-4-5-20251101` model:
>
> 1. [Create an Anthropic LLM resource](https://docs-classic.cognigy.com/ai/agents/develop/gen-ai-and-llms/providers/anthropic.md) for Claude, for example, `claude-opus-4-5-20251101`.
> 2. Create a Flow and add a Search Extract Output Node to it.
> 3. In the Search Extract Output Node, select the model `claude-opus-4-5-20251101` from the **Large Language Model** list.
> 4. In the **Custom Options** field, add `{ "model": "claude-opus-4-1-20250805" }` to force the use of the `claude-opus-4-1-20250805` model.
> 5. Click **Save Node**.
>
> The Search Extract Output Node now utilizes the `claude-opus-4-1-20250805` model.
>
> Below, you'll find documentation for supported models:
>
> * [Aleph Alpha Models](https://docs.aleph-alpha.com/)
> * [Anthropic Models](https://docs.anthropic.com/claude/docs/models-overview)
> * [Azure OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models)
> * [OpenAI Models](https://platform.openai.com/docs/models)
>
> **Forcing JSON Output on Amazon Bedrock and Anthropic**
>
> For [Amazon Bedrock](https://docs-classic.cognigy.com/ai/agents/develop/gen-ai-and-llms/providers/amazon-bedrock.md) and [Anthropic](https://docs-classic.cognigy.com/ai/agents/develop/gen-ai-and-llms/providers/anthropic.md) models, add the `output_config` parameter to the **Custom Options** field to force the model to return a specific JSON response.
>
> For example, to force the model to return JSON matching a specific schema:
>
> ```json theme={null}
> {
>   "output_config": {
>     "format": {
>       "type": "json_schema",
>       "schema": {
>         "type": "object",
>         "properties": { "answer": {} },
>         "required": ["answer"]
>       }
>     }
>   }
> }
> ```
>
> With this configuration, a prompt such as `What is 1+1?` returns a response like `{"answer": 2}` instead of plain text.

### Debugging Options

| Parameter | Type | Description |
| - | - | - |
| Show Token Count | Toggle | Send a debug message containing the input, output, and total token count. The message appears in the Interaction Panel when Debug Mode is enabled. Cognigy uses the GPT-3 tokenizer algorithm, so actual token usage may vary depending on the model used. This parameter is inactive by default. |
| Log Request and Completion | Toggle | Send a debug message containing the request sent to the LLM provider and the subsequent completion. The message appears in the Interaction Panel when Debug Mode is enabled. This parameter is inactive by default. |

## Examples

### Context-Aware Search

By considering the context,
the search can help users find information within a transcript more quickly,
as it understands the nuances of the content.
When enabling a context-aware search system,
you can configure the number of prior transcript steps to use in the search to suit your specific requirements.
The number of prior transcript steps affects the depth of context considered when retrieving search results.

In the following table, a dialogue between the user and the AI Agent is presented, showing the agent's responses in both the enabled and disabled modes of the Context-Aware Search feature.

| Context-Aware Search is off | Context-Aware Search is on |
| - | - |
| **user:** What animals are allowed on a plane? **AI Agent:** Passengers are allowed to bring a maximum of two animals (dogs or cats) on the plane, either in the cabin or in the cargo hold, as long as they are in approved transport containers. **user:** Give me more details! **AI Agent:** Unfortunately, I can't answer your question. | **user:** What animals are allowed on a plane? **AI Agent:** Passengers are allowed to bring a maximum of two animals (dogs or cats) on the plane, either in the cabin or in the cargo hold, as long as they are in an approved transport container. **user:** Give me more details! **AI Agent:** The approved transport container for animals on a plane must have a maximum size of 118 cm (55 x 40 x 23 cm) or 47 in (22 x 16 x 9 in) and a total weight, including the animal, not exceeding 8 kg. The container should be escape-proof, leak-proof, bite-proof, and lined with absorbent material. Only one transport container per passenger is allowed in the cabin, and the number of animals per container is limited to one, with exceptions for specific cases. |

## More Information

* [Knowledge Search Overview](https://docs-classic.cognigy.com/ai/agents/develop/knowledge-ai/overview)
* [LLM](https://docs-classic.cognigy.com/ai/agents/develop/gen-ai-and-llms/llms.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.