-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 request: Chat history persisted to Cosmos DB #1863
Comments
This seems like a duplicate of #489. There is also a stale PR that implemented this (although probably not based on sample-app-aoai-chatGPT): #259 |
Hi @DuboisABB . I am currently developing it for a client. Let me see if I can create a fork minus clients changes. would love the help. |
I also have a client asking for this kind of feature. @hfaouaz-rcg did you made any steps towards a working solution? What kind of services do you implement for this? i was thinking about cosmos db, but im fairly new to databases tbh. |
This request is pretty much the same: #1822 |
I'm also interested in this kind of feature for one of my clients. We are looking to implement a feedback loop on the responses, which would be stored in a Cosmos DB. |
Yesterday, I was able to successfully store a full chat history in my CosmosDB for the first time. This was done from a local environment using my deployment user. I haven’t had the chance to further test and refine the implementation yet. Some adjustments and optimizations are definitely still needed. Additionally, I need to consider the exact timing of when the data should be stored. This has already been implemented within the scope of a client project, so it’s no longer very "general." I largely based my work on this reference (#259) and adapted the components necessary for my use case. My goal is simply to enable the evaluation of the chat histories in the background to determine whether the source data needs to be optimized. So, i almost skipped the whole frontend part for the user and only focused on the backend app.py, api and adjusted the bicep, so the cosmosdb is already been created with everything else. |
Hello @idrisfl , @cloudhunnter and @DuboisABB . You may need to add the following enviornments AZURE_OPENAI_MODEL="gpt-4o" @pamelafox please look into this to see if we can integrate it. I moved some code from the https://github.com/microsoft/sample-app-aoai-chatGPT/tree/main project and made it work within the Chat flow. I can help with integration if needed. Fork repo: Note: two new api added. history/generate history/list Hope this help. |
Hello @hfaouaz-rcg, I tried deploying the application using the environment variables and setup mentioned in your commit, but I am encountering an application error during deployment. Would you be able to guide me on what might be causing the issue? I have double-checked the environment variables but still can't seem to resolve the error. Any help or pointers on what could be wrong and how to fix it would be greatly appreciated! Thank you in advance! |
hi @ibrahimnasir0, what kind of error you are getting. if you can show me the stack trace, perhaps I can guide you. |
@hfaouaz-rcg This is great! |
Hello @hfaouaz-rcq, Thank you for your response! I am getting an application error during deployment. I’ve double-checked the environment variables, but the error persists. Could you share your LinkedIn profile or any other contact information so I can connect with you directly for more guidance? Here’s my LinkedIn profile for your reference: https://www.linkedin.com/in/ibrahimnasir0/ Thanks again for your help! |
@ibrahimnasir0 @hfaouaz-rcg Could you please share the rebased version of your code. I also want to implement in my app |
This repo now has support for browser-based chat history: I have re-titled this issue to focus on adding Cosmos DB persistence, and will keep this issue open. For those who want Cosmos DB persistence, are you also using the user login feature? Or would you want persistence when users aren't logged in? |
authorization is mandatory for me -always 😄
I still don‘t get how this and the other chat history Mr play together. Is
it enhancing or duplication?
Pamela Fox ***@***.***> schrieb am Fr. 4. Okt. 2024 um 18:44:
… This repo now has support for browser-based chat history:
https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/docs/deploy_features.md#enabling-chat-history
I have re-titled this issue to focus on adding Cosmos DB persistence, and
will keep this issue open.
For those who want Cosmos DB persistence, are you also using the user
login feature? Or would you want persistence when users aren't logged in?
—
Reply to this email directly, view it on GitHub
<#1863 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADAARXHE3SB4QGE3S3EHRLZZ3AXFAVCNFSM6AAAAABLQRTP7CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJUGA4TKMRVHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
When we add CosmosDB support, then you would enable one or the other, I think. (We'd need to warn if you enabled both since that wouldn't make sense). |
Hi Pamela, currently our client as fine with anonymous user id, to encourage feedbacks :-) but I believe the cosmos code, handle capturing used id if they are logged in. P.S. sorry, I've been swamped with work to do a PR with code changes that I've done. |
I was more interested in exploring the feature gaps between the two
solutions rather than non-functional aspects like scalability, cost, and
operational complexity. As you mentioned, why should we use both databases
for persistence if there is no noticeable difference in user experience?
… When we add CosmosDB support, then you would enable one or the other, I
think. (We'd need to warn if you enabled both since that wouldn't make
sense).
—
Reply to this email directly, view it on GitHub
<#1863 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADAARRWLB5LTVRFBCLILALZZ3CB3AVCNFSM6AAAAABLQRTP7CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJUGEYTGMBXHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
IndexedDB is only persisted in the browser, which means that if the user switches browsers/computers, they no longer have the history. |
Understood. While it's important to protect PII and secrets, storing data without associating it with a user doesn't make much sense. Otherwise, how would we restore the data later? It can't be anonymous since that would involve PII. I believe it would be beneficial to store the data based on user consent, perhaps like a bookmark feature. Encrypting the data with browser-managed keys could be another option, although the user would need to enter the key for each intial persistent session, and we'd have to store it locally. This approach is similar to how browsers handle storing secrets. |
This issue is for a: (mark with an
x
)Minimal steps to reproduce
Any log messages given by the failure
Expected/desired behavior
To Capture and maintain question/answers in cosmos. I was able to refactor current codebase and chatGPT code base to capture questions in cosmos. still some work needs to be done, but I am wondering if this feature is on the roadmap. Once I have a complete working solution, I will create a feature enhancement PR.
Build cosmos biceps <- done
provide api for history capture/generate/list <- done
capture question <-done
capture answer
session base/conversation base
OS and Version?
azd version?
Versions
Mention any other details that might be useful
The text was updated successfully, but these errors were encountered: