Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizable Kendra Fallback #630

Open
e-ndrus opened this issue Aug 11, 2023 · 6 comments
Open

Customizable Kendra Fallback #630

e-ndrus opened this issue Aug 11, 2023 · 6 comments

Comments

@e-ndrus
Copy link

e-ndrus commented Aug 11, 2023

Is your feature request related to a problem? Please describe.
Kendra Fallback is a great feature of a QnA Bot. However, it seems like we cannot customize Kendra output to meet our needs unless we edit the es-proxy-layer. For instance, by default Kendra would return a highlight which concatenates fields if there are multiple custom fields within the Kendra index.

Describe the feature you'd like
Would it be possible to make it customizable what Kendra fallback returns. For instance, indicate which fields to return or whether to trim the highlight?

Additional context
We are currently experimenting with QnA Bot Version v5.3.4.

@marcburnie
Copy link
Member

Thanks @e-ndrus for submitting the suggestion. I think this sounds like a reasonable enhancement, however I'm not clear on the 'indicate which fields to return' feature. Do you mean to filter out specific document attributes from the QnABot response (for example, removing the source URI)? If this isn't what you meant, can you provide an example?

@e-ndrus
Copy link
Author

e-ndrus commented Aug 14, 2023

@marcburnie the default Kendra Fallback answer looks something like this:

[User Input: “What am I supposed to do?”[{“Type":"DOCUMENT","Score":"VERY_HIGH"},{"Type":"DOCUMENT","Score":"VERY_HIGH"}], Source: KENDRA FALLBACK]
While I did not find an exact answer, these search results from Amazon Kendra might be helpful.


...370 What am I supposed to do? Some field value here. Additional Field Value…
Source Link: What am I supposed to do


...371 What am I supposed to do? Some field value here. Additional Field Value...
Source Link: What am I supposed to do

As you can see, the current format is not very clear to the end user. The problem is that KendraFallback presents a user with a highlight where fields in the Kendra document are merged into one string which is also trimmed to a certain number of characters.

A use case would be something like a Kendra index with documents having several custom fields. Let's say: plan, state, brand, etc. We wouldn't want that info to be merged into and shown as a Kendra highlight, rather as separate untrimmed fields.

For example:

KendraFallback response:

Document 1 Title

Document 1 Body
Document 1 Plan | Document 1 State | Document 1 Brand

-----------------

Document 2 Title

Document 2 Body
Document 2 Plan | Document 2 State | Document 2 Brand

It would be great if we could customize KendraFallback output as shown to QnABot users.

@marcburnie
Copy link
Member

Thanks for the clarification. We will evaluate this and get back to you.

@kroeter
Copy link

kroeter commented Sep 12, 2023

Hi all, coming back to this as we're building out our roadmap for next year, and are looking at leveraging LLMs for a similar feature. E-ndrus - Can you clarify what new functionality you want to achieve with your recommendation? I'd like to evaluate if there are options outside of customizing our kendra fallback that would achieve the same results.

@e-ndrus
Copy link
Author

e-ndrus commented Oct 17, 2023

Well, the functionality we are aiming for is a more customizable Kendra fallback output. A search result highlight is sometimes not what clients want. Let's say we have documents in Kendra with custom fields. And we want to see a whole search result where we would return some of those custom fields not piled and trimmed by the Kendra highlight as it is right now.

An option to overcome this hurdle is to use a custom lambda hook and query Kendra API in a lambda hook. Thus we can tweak the output and return the results the way we want. It would be great to have this level of customazability in Kendra Fallback by default.

@abilash44
Copy link

+1
This will be great. We have Kendra as fallback and if we can use a custom lambda on the kendrafallback we can customize how the output would appear,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants