infiniflow / ragflow

RAGFlow is an open-source RAG (Retrieval-Augmented Generation) engine based on deep document understanding.
https://ragflow.io
Apache License 2.0
16.51k stars 1.69k forks source link

Using the graph interface is it possible to store values, and present the response later on as an output or input of a subsequent generation task? #1550

Closed rhudock closed 1 month ago

rhudock commented 1 month ago

Describe your problem

Is it possible to store values: -- the capability of the graph interface to hold or retain data. Store values means saving data points or information in a way that they can be retrieved or used later.

Present the response later on: This means that the stored values should be retrievable or displayable in future interactions.

As an output or input of a subsequent generation task: Output: The stored values can be shown or used as results of a process. Input: The stored values can be used as starting data for a new process or task

KevinHuSh commented 1 month ago

Not quite follow. Could you paste the corresponding canvas here or elabrate on the scenario.

rhudock commented 1 month ago

See the included diagram.

In the top left corner, labeled as number one, we see an overview of the entire workflow. This starts with the initial query from the user. The query is then processed by switching logic to determine which knowledge base to access. Before querying the knowledge base, the query is rewritten using the provided functionality. The system then searches across four different databases, chosen for their distinct and complex nature for testing purposes, though this distinction isn't crucial

Ragflow diagram

here.

In section two, we see the final output of the system, which involves logic such as building a knowledge graph and generating citations. Moving to section three, this step involves using Llama 3 to generate a query against the selected dataset from the initial search.

Next, section four generates citations based on the response from section three. Section five then creates Neo4j inserts, which are eventually passed into the final generation prompt to produce the overall output. I've tried to incorporate these Neo4j inserts and citation blocks into the synthesis prompt.

My question is: How can I pass the results of an earlier generation prompt into a subsequent prompt at the end of a workflow? Specifically, I want to combine the results of three or four other generation tasks without relying on the accumulated history or narrative but instead on the data I explicitly provide.

Thank you for your assistance.


Based on the provided diagram, the flow is as follows:

  1. Initial Query and Workflow Overview (Top Left, Number 1):

    • The process starts with the user's initial query.
    • The query is directed to switching logic to determine the appropriate knowledge base.
    • The query is rewritten using the provided functionality before querying the knowledge base.
    • The system searches four distinct databases for diverse testing purposes.
  2. Final Output (Top Right, Number 2):

    • This section represents the final output.
    • It involves building a knowledge graph and generating citations.
  3. First Generation (Bottom Left, Number 3):

    • Llama 3 generates a query against the appropriate dataset from the initial search.
  4. Generate Citations (Middle Right, Number 4):

    • Citations are generated based on the response from section three.
  5. Neo4j Inserts and Final Generation (Bottom Right, Number 5):

    • Neo4j inserts are created and passed into the final generation prompt.
    • The final output is generated, incorporating the inserts and citations.

The goal is to pass the results from earlier generation steps into subsequent prompts explicitly. The diagram highlights various insert and citation steps, indicating how to integrate the data into the final synthesis prompt.

How can I pass the results of earlier generation prompts into a subsequent prompt to synthesize the overall output without relying on the accumulated history, but instead explicitly using the data from earlier steps?

Thank you for your assistance.

image
KevinHuSh commented 1 month ago

Thanks for these detail.

About the number 3

Feature supported

Results of earlier generation prompts into a subsequent prompt to synthesize the overall output.

image

image

rhudock commented 1 month ago

This looks cool, I am looking forward to testing it. I created a new bug report under a separate item because graph page seems broken at this point.