You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-25
Original file line number
Diff line number
Diff line change
@@ -84,13 +84,7 @@ The below are the features of this solution:
84
84
# Search Parameters
85
85
Multiple Search Parameters have been added to control the behavior of the agent. The below values are all `false`**by default**. This can be tested in Postman or the interacting bot:
86
86
87
-
1.`search_method`: this parameter can take 3 values `'os'`, `'ccr'` and `'zs'`. `'os'` corresponding to the 3 available agents. `'os'` stands for 'One-Pass' agent, `'ccr'` stands for Concersational-Chat-ReAct agent, `'zs'` stands for Zero-Shot-ReAct agent. Both `'ccr'` and `'zs'` use LangChain agents. In terms of performance, `'os'` is fast but with the lowest quality of answers. `'zs'` is the slowest but with the highest quality of anwers, and `'ccr'` is right in the middle in terms of answer quality and latency. For interactive chat bots, `'ccr'` is recommended.
88
-
89
-
1.`enable_unified_search`: Unified Search searches Redis and Cognitive Search at the same time with parallel calls, and interleaves the results.
90
-
91
-
1.`enable_redis_search`: enables search with embeddings in Redis
92
-
93
-
1.`enable_cognitive_search`: enables vector search, semantic search and lookup in Cognitive Search.
87
+
1.`search_method`: all previous agents / search methods have been retired. A new agent has been added which is based on OpenAI Function Calling, and uses Cognitive Search Vector Search exclusively.
94
88
95
89
1.`evaluate_step`: search text results sometimes have the answer to the question but the results might be so long that OpenAI completion call might miss that information (too much noise). `evaluate_step` was created to address this problem. This is a separate call to the OpenAI Completion API to identify the facts that are relevant only to the question.
96
90
@@ -105,37 +99,25 @@ Multiple Search Parameters have been added to control the behavior of the agent.
105
99
1.`use_bing`: enables the use of Bing Search in the results. Bing Search will result snippets from the highest matching websites (or only from the supplied restricted list), and those snippets will be inserted in the Completion API prompt.
106
100
107
101
102
+
**Note:** the below image needs updating. "enable_cognitive_search" is turned on by default.
103
+
<br>
104
+
105
+
108
106
<palign="center">
109
107
<imgsrc="images/search_params.jpg"width="500"/>
110
108
</p>
111
109
<br />
112
110
113
-
In general, `zs` will get you better results but is considerably slower than `os` since the LangChain agent might make several calls to the OpenAI APIs with the different tools that it has, and `'ccr'` is right in the middle in terms of answer quality and latency.
114
-
115
-
<br />
116
-
<br />
117
-
118
-
## Comparative Example of the 3 Agents with GPT-4
119
-
120
-
All 3 agents do well when the queries are simple and / or the information can be retrieved from a single document. However, where the Zero-Shot-ReAct Agent really shines is when the query is complicated with multiple parts to it, and the information is spread over multiple documents in the Knowledge Base.
121
-
122
-
The below is a simple illustrative example. The knowledge base consists of the sample documents around "Margie's Travel" agency and thus include 6 brochures about fictional hotels. The Wikipedia page about Sherlock Holmes has also been downloaded and ingested. To run this test, we came up with a question of 2 parts that are not directly related: `"did Sherlock Holmes live in the same country as where the Volcano hotel is located?"`. From the question, the first part asks about Sherlock Holmes, the second asks about the Volcano Hotel, and the LLM needs to deduce whether they have both lived or are located in the same country.
123
-
124
-
Here are the results:
125
-
126
-
1. The One-Pass Agent searched Cognitive Search for the full question, and got all the top ranking results about Sherlock Holmes. The final answer is `"I'm sorry, I could not find any information about the Volcano Hotel in the provided context."`
127
-
128
-
1. The Conversational-Chat-ReAct Agent gave a mixed bag of results. Because it has not been explicitly instructed in the prompt how many iterations it can do, sometimes it did one search in Cognitive Search, and sometimes two searches. The first search is almost always about Sherlock Holmes, with the search string `"Sherlock Holmes country"`. If it did go for a second search iteration, then it looks for `"Volcano hotel country"`. The final answer is either `"Sherlock Holmes is a fictional character from the United Kingdom. However, I do not have information about the location of the Volcano hotel."` or, when it does 2 searches, then it gets `"The Volcano Hotel is located in Las Vegas, United States. Sherlock Holmes lived in London, England . Therefore, Sherlock Holmes did not live in the same country as the Volcano Hotel."`.
129
111
130
-
1. The Zero-Shot-ReAct Agent really shines here because it is explicitly told that it can do multiple searches in the context of answering a single query. It first searches Cognitive Search for `"Sherlock Holmes country"`, and then searches again for `"Volcano hotel location"`, and gives the right answer every time: `"Sherlock Holmes lived in London, England, while the Volcano Hotel is located in Las Vegas, United States. They are not in the same country."`.
131
112
113
+
<br
132
114
133
115
<br />
134
116
<br />
135
117
136
118
## Architecture
137
119
138
-
The below is the Architecture of the bot-serving function, including all options:
120
+
The below is the Architecture of the bot-serving function, including all options (please **note** that there are no more LangChain agents supported):
0 commit comments