spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

How can I implement the ChatMemory in an agentic workflow?

Open FredLiu0813 opened this issue 1 year ago • 3 comments
trafficstars

I am working on an agentic workflow project using SpringAI, now I have a question/problem with ChatMemory.

Question How can I implement the memories in a workflow?

Example I have an agentic workflow that includes the following steps:

  1. Perform a GoogleSearch based on user input.
  2. Send the Google result to a LLM(e.g., OpenAI) to summarize them into a short article.
  3. Return the summarized result.

Workflow: Start→GoogleSearch→OpenAI LLM→End

Problem When I running this workflow and enter "NBA" for the first time, and it returns an article about "NBA". However, when I input "please reduce the content of previous answer to 20 words" for the second time, the workflow does not retain the memory. Instead, It transmits the "please reduce the content of previous answer to 20 words" to Google and generates a new article.

Is there any way to solve this problem? I would greatly appreciate any responses.

FredLiu0813 avatar Sep 25 '24 01:09 FredLiu0813