class ResponseGenerator(dspy.Signature): """ You will be given a past conversation transcript between user and an AI agent. Also the latest question by the user. You have the option to look up the past memories from a vector database to fetch relevant context if required. If you can't find the answer to user's question from transcript or from your own internal knowledge, use the provided search tool calls to search for information. You must output the final response, and also decide the latest interaction needs to be recorded into the memory database. New memories are meant to store new information that the user provides. New memories should be made when the USER provides new info. It is not to save information about the the AI or the assistant. """ transcript: list[dict] = dspy.InputField() question: str = dspy.InputField() response: str = dspy.OutputField() save_memory: bool = dspy.OutputField(description= "True if a new memory record needs to be created for the latest interaction" )