-
Notifications
You must be signed in to change notification settings - Fork 138
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
[FEATURE] Singular and _search api for Conversational Memory #1268
Comments
Should we also add an UpdateInteraction API of some kind? In order to add to the "additional info" field or something |
Looks similar to this issue #1284 |
@jngz-es thoughts? Is there anything specifically that you would want out of these that isn't encompassed in standard _search api? |
I'm likely going to need to change the API endpoints a little. Thoughts?
Proposed change:
|
New API SpecGetInteractionGets an interaction by id
Returns the interaction as json (if you have access) GetConversationGets a conversation by id
Returns the conversation meta object as json (if you have access) SearchConversationsExecute a search query over the conversations index
Returns the search results (conversation meta documents), opensearch style. essentially this is a wrapper around standard opensearch _search API that tacks on access controls if applicable SearchInteractionsExecute a search query over the interactions of a conversation
Returns the search results (interaction documents), opensearch style. Essentially this is a wrapper around the standard opensearch _search API that adds a filter for the correct conversation id and checks access controls for the conversation. |
I like the new conventions, do we need both get and search APIs? Eg
I haven't looked at the PR #1504 , if we are using the same code underneath its good. |
Get (pl) returns the last couple conversations (or interactions) sorted by creation time. basically just a shortcut to
and, of course, tacking on the access controls. The idea was that for most use-cases, get (pl) is all an application needs |
What do you think about:
Also will there be any use case to delete any specific interaction from the conversation? |
@dhrubo-os I haven't seen too much need for single interaction _delete, although I an see how it could be useful (some kind of "undo last interaction" interaction model). |
@saratvemulapalli well, yes, there is a lot of boilerplate. I'm not convinced that it can all be stripped away. For example, the TransportActions all need to exist because this is where we check the feature flag. For the plural Get (and another motivation for it existing outside of _search) there was some thought of supporting databases other than an OpenSearch index under the storage interface, and all databases do not necessarily support OpenSearch search queries - so all storage implementations might not support the search action - so Get (pl) and Search should be decoupled at the transport layer. |
From this context, I agree that to put all the endpoints under I'm just worried that, these apis aren't quite self explanatory? Like looking at the api endpoints only, I can't tell what I can expect from the api specially If we can increase the readability of these api endpoints, I'm completely fine with keeping all under |
I find they read a little better if you fill in the conversation id. but maybe I'm too close to the code, idk.
|
On the verb topic, I came across a similar discussion happening on the AI Workflow side. They are sticking with GET, DELETE, POST and PUT as opposed to having the verbs appear at the end of the URLs. |
hmm... |
If we know what APIs we will introduce for the new general memory layer, let's make sure the convention is consistent at least within all things memory. If Henry doesn't mind making another change later, maybe we can proceed with a plan to refactor, if necessary, at a later time once we have the rest of the APIs finalized. I am not saying we have to do what AI Workflows does. It looks like there isn't one standard across OpenSearch so maybe that ship has already sailed... |
^^ it would be very good to know what the other memory APIs will look like / be |
@ylwu-amzn is there any design or proposal for this memory layer? Will it also support role-based access control? |
Background
We created a Conversational Memory CRUD API per #1150 to deal with long term storage of conversations for conversational applications. In this API, we identify two resources: ConversationMeta, and Interaction. A ConversationMeta contains some information about the Conversation as a whole, whereas an Interaction is the (call-and-response) individual unit of a Conversation - a Conversation is made up of Interactions. We store ConversationMetas and Interactions in two separate indices.
Is your feature request related to a problem?
We need singular APIs to get just one Interaction or one ConversationMeta
We also need a _search endpoint for ConversationMetas and Interactions to execute more complicated queries over conversational data
What solution would you like?
Four new actions/rest endpoints
This may require a little rethinking on the rest endpoint naming front
What alternatives have you considered?
SearchInteractions over all interactions the user has access to
Do you have any additional context?
PR 1196
The text was updated successfully, but these errors were encountered: