In the FastAPI application lifespan startup, the Cosmongo instances are created using the users and chat collections in the CosmosDB for MongoDB vCore database. While the messages array goes into the class variable messages, it does not go into its agent_executor. Therefore the underlying Langchain Agent Executor will not have access to this message history. This can be seen by looking at the create_conversational_retrieval_agent function call in the init of Cosmongo. I am curious how this conversation history can be fed to the agent upon creation. I looked into this function from Langchain but it doesnt appear to accept a conversation history (although it does take memory_key param). Perhaps creating the Agent Executor with the class constructor and passing memory param is the way to go.
It is not a big deal, since I believe the Azure App Service will keep the server running. However, in case of any requirement to restart, it would be nice to have this feature.
Log in or sign up for Devpost to join the conversation.