codeforboston / codeforboston/maple

Introduce memory management for chatbot

Open
#2,225 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
56
Forks
175
Avg merge
2d 5h
Merged PRs (30d)
13

Description

PR #2218 does not yet introduce a data model for storing user chat histories and accessing them in chat conversations as part of long term memory. We should either introduce a basic framework for this here or capture an issue to do so later.

We should be able to use https://reference.langchain.com/python/langchain-community/chat_message_histories/firestore/FirestoreChatMessageHistory for this. We will need to decide whether to add this as a separate firestore db or as a new collection or something else. it is a top priority to enforce user-level access so each user can only access their own conversation history.

_Originally posted by @nesanders in https://github.com/codeforboston/maple/issues/2218#issuecomment-5419200109_

Here are core requirements for this issue:
* Chat converstaions need to be durably persisted
* Persisted chat conversations should be incrementally updated after each conversation turn
* We should expose a new tool in the REACT loop to enable the chatbot to retrieve previous conversations
* The long term memory tool needs to be able to search previous conversations by semantic relevance

Anti-requirements

* Our approach must NOT prevent a future frontend PR that would expose the chat history to the user
* Our approach must NOT prevent a future frontend PR that would allow the user to open and resume previous chats
* Our approach must NOT prevent a future PR that would enable chat rollback/editing

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.