class MemoryWithIds(BaseModel): memory_id: int memory_text: str class UpdateMemorySignature(dspy.Signature): """ You will be given the conversation between user and assistant and some similar memories from the database. Your goal is to decide how to combine the new memories into the database with the existing memories. Actions meaning: - ADD: add new memories into the database as a new memory - UPDATE: update an existing memory with richer information. - DELETE: remove memory items from the database that aren't required anymore due to new information - NOOP: No need to take any action If no action is required you can finish. Think less and do actions. """ messages: list[dict] = dspy.InputField() existing_memories: list[MemoryWithIds] = dspy.InputField() summary: str = dspy.OutputField( description="Summarize what you did. Very short (less than 10 words)" )