griptape
griptape copied to clipboard
Not All Tasks Support Conversation Memory
Some of the Task types (Query, Summary, Extract) are missing integration with Conversation Memory since they don't operate off a Prompt Stack. This makes implementing something like conversational RAG (with Tasks, not Tools) challenging since the history of the conversation is not persisted. Some open ended questions:
- Should Engines take in a Prompt Stack? Right now they operate on a single text input, introducing Prompt Stacks might overcomplicate the role of an Engine.
- If we do somehow integrate Prompt Stacks into Engines, should other Tasks (Prompt, Tool, Toolkit) be refactored to use Engines? I.e. PromptEngine, ToolEngine, etc.
This originally came from the need for TextQueryTask
needing to access Conversation Memory so that it could query with more context. Though we can accomplish something similar with the the following:
pipeline = Pipeline(
tasks=[
PromptTask(
"How would you ask the question considering the previous conversation: {{ args[0] }}",
rules=[Rule(value="Answer only with the new question.")],
),
TextQueryTask(
"{{ parent_output }}",
query_engine=vector_query_engine,
),
],
)
Furthermore, adding Prompt Stack to Summary and Extraction Tasks introduces challenges with their recursive nature. So does it make sense to introduce the Prompt Stack to these utility oriented Tasks? Or should they always be complemented with a Prompt Task?
CC @andrewfrench @vasinov