Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 opened this issue Jul 16, 2024 · 4 comments
Labels
question Further information is requested

Comments

@rhudock
Copy link

rhudock commented Jul 16, 2024

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

@rhudock rhudock added the question Further information is requested label Jul 16, 2024
@KevinHuSh
Copy link
Collaborator

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

@rhudock
Copy link
Author

rhudock commented Jul 17, 2024

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 KevinHuSh mentioned this issue Jul 18, 2024
1 task
KevinHuSh added a commit that referenced this issue Jul 18, 2024
### What problem does this PR solve?

#1550 #1210 

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
@KevinHuSh
Copy link
Collaborator

Thanks for these detail.

About the number 3

  • why a query again?
  • And this query is not used to retrieve, isn't it?

About the ’Rewrite‘

The current rewrite component is only for question extending.

Feature supported

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

image

image

@rhudock
Copy link
Author

rhudock commented Jul 18, 2024

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.

@rhudock rhudock closed this as completed Jul 18, 2024
Halfknow pushed a commit to Halfknow/ragflow that referenced this issue Nov 11, 2024
### What problem does this PR solve?

infiniflow#1550 infiniflow#1210 

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants