-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Developer Tools
-
3
-
Not Needed
When we're using the /query or /schema command handlers we need to get the namespace from the user. We do this currently by asking the model to parse it from the messages. We've found the model doesn't do a good job of looking into previous user messages for the namespace, it really prefers only the last message.
Previously we would keep around a singleton state for tracking the namespace as it changed overtime and when it wasn't yet defined. This method didn't work well when a user would create a new conversation or jump into an old one as the state wouldn't then be up to date.
This ticket involves adding a store that has information for every chat. We assign each chat a unique id, returning it in the metadata field of the first chat response. That unique id is then used in subsequent chat messages and can be used to look up namespace information in the store for that chat. When a user clicks on a database or collection name, or the ai finds a namespace in their message, we can then set that on the store. This is needed as we initiate the chat message for the user when they click on the database or collection name, and we can't add metadata into that chat message.