(beta) Agentic Search
Functionality
The Agentic Search module is designed to handle complex user queries by leveraging multiple search types and iterative search runs to provide accurate and comprehensive answers. It can manage single questions, nested questions, or queries containing multiple questions. The module dynamically determines the optimal search strategy and iteratively refines its responses while ensuring hallucination checks and quality control.
The Agentic Search performs the following tasks:
Determines the appropriate search type for the user query:
Based on the input, the assistant decides whether to use internal knowledge search, web search, table search, or other configured search types.
The choice of search type is based on the query’s structure and content.
Executes searches iteratively:
Conducts an initial search using the selected search type.
Evaluates whether additional searches are required based on the initial results.
Repeats the search process until the relevant information for the query is gathered.
Handles nested and multi-question inputs:
Parses the user query into its components.
Conducts separate searches for each component as necessary, combining results to form a comprehensive answer.
Performs hallucination checks:
After streaming an initial response, the module evaluates the response for hallucinations.
If a hallucination is detected, the module iterates to correct its response using previous answers and hallucination check feedback. If required, further information is gathered with additional searches.
Suggstion of follow-up questions:
Appends a configurable number of suggested follow-up questions based on the provided answer and the conversation history.
Input
A user message containing a query, which can be:
A single question
A nested question
A set of multiple questions
Example scenario:
User query: “What is the market trend in Europe for 2024, and how does it compare to the US?”
Process:
The module identifies the need for both internal knowledge search and web search.
It performs separate searches for “market trend in Europe for 2024” and “comparison with the US.”
The results are combined and iteratively refined to ensure accuracy and coherence. The answer is streamed to the user.
A hallucination check validates the response, triggering corrections if necessary.
After a successful hallucination check, follow-up questions are suggested to the user like:
“Would you like a regional breakdown of trends?”
“Do you want details on specific industries?”
Output
A comprehensive, accurate answer to the user query, which:
Combines insights from multiple search types and iterative search runs.
Includes follow-up questions for further exploration.
Configuration:
AI assistant module configuration (see variable explanation below)
{
"languageModel": "AZURE_GPT_4o_2024_0513",
"maxLoopIterations": 5,
"tools": [
{
"name": "InternalSearch",
"configuration": {
"languageModel": "AZURE_GPT_4o_2024_0513",
"scopeIds": ["scope_A", "scope_B"]
"maxTokensForSources": 14000,
"chunkRelevancySortConfig": {
"enabled": true,
"languageModel": "AZURE_GPT_4o_MINI_2024_0718"
}
}
},
{
"name": "WebSearch",
"configuration": {
"languageModel": "AZURE_GPT_4o_2024_0513",
"maxTokensForSources": 14000,
"chunkRelevancySortConfig": {
"enabled": true,
"languageModel": "AZURE_GPT_4o_MINI_2024_0718"
}
}
}
],
"evaluationConfig": {
"maxReviewSteps": 2,
"evaluationPassValues": [
"low",
"medium"
]
},
"followUpQuestionsConfig": {
"languageModel": "AZURE_GPT_4o_MINI_2024_0718",
"numberOfFollowUpQuestions": 2
}
}
Attribute | Description | Type |
---|---|---|
| Defines the default model used by the agent | Text enum (depending on availability): “AZURE_GPT_4o_2024_0513“, … |
| Max. number of loop iterations done by the agent to answer the question | Number |
| List of tools (see below for specific search types and configurations) |
|
| Name of search type | Name of search type:
|
| Configuration of search | Depends on search type. See below for more details |
|
|
|
| Specifies the maximum number of review steps allowed if the evaluation check is not passed. | Number |
| Defines the pass levels for evaluation checks. The levels can be categorised as | Possible Values:
|
|
|
|
| Defines the model used for generation of follow-up questions | Text enum (depending on availability): “AZURE_GPT_4o_2024_0513“, … |
| Specifies the number of follow-up questions to generate | Number |
Internal Knowledge Search
Search in information in the knowledge base
Attribute | Description | Type |
---|---|---|
| Specifies the model used in the internal search tool. | Text enum (depending on availability):
|
| Defines the maximum number of tokens for the returned search results. The search results are provided in chunks. | Number |
| Defines scopes the search is performed on. | List of scope IDs |
|
|
|
| Indicates whether chunk relevancy sorting is activated. | Boolean |
| Specifies the model used for chunk relevancy sorting. | Text enum (depending on availability):
|
Web Search
Search in the internet.
Attribute | Description | Type |
---|---|---|
| Specifies the model used in the internal search tool. | Text enum (depending on availability):
|
| Defines the maximum number of tokens for the returned search results. The search results are provided in chunks. | Number |
|
|
|
| Indicates whether chunk relevancy sorting is activated. | Boolean |
| Specifies the model used for chunk relevancy sorting. | Text enum (depending on availability):
|
(Tool) Definition
Only adjust function definition if you are fully familiar with the code logic. Small changes can break the module or reduce the output quality.
{
"type": "function",
"function": {
"name": "AgenticSearch",
"parameters": {
"type": "object",
"required": [
"instruction",
"language"
],
"properties": {
"language": {
"type": "string",
"description": "The language used by the user in their prompt (e.g. English, French, German, etc.)."
},
"instruction": {
"type": "string",
"description": "The semantic query to search. Should be the form of a semantic query containing all relevant information."
}
},
"description": "Search for information on policies, procedures, benefits, groups, stocks or specific people. This should be your go-to tool if no other tools are applicable."
}
}
}
Author | @Fabian Schläpfer |
---|
© 2024 Unique AG. All rights reserved. Privacy Policy – Terms of Service