ragflow icon indicating copy to clipboard operation
ragflow copied to clipboard

[Bug]: Agent flow requires two completions of the conversation after creating a session if there are input parameters.

Open stardyun opened this issue 9 months ago • 15 comments

Is there an existing issue for the same bug?

  • [x] I have checked the existing issues.

RAGFlow workspace code commit ID

409310aa

RAGFlow image version

v0.16.0-139-g58a8f1f1 full

Other environment information


Actual behavior

Repeated messages

Image

Expected behavior

After “Create session with agent”, call “Converse with agent” and get an answer immediately.

Steps to reproduce

01. Create session with agent(the Begin component in your agent takes required file parameters)
02. Converse with agent (Need to ask questions twice.)
03. List agent sessions (There are 2 duplicate messages.)

Additional information

  1. Create session Image

  2. Converse with agent Image

  3. Converse with agent again Image

  4. View message history Image

stardyun avatar Feb 27 '25 01:02 stardyun

Agent always talks firstly.

KevinHuSh avatar Feb 27 '25 03:02 KevinHuSh

Agent always talks firstly.

However, it takes two rounds of dialogue requests to get a response, and the message records are also repeated for two rounds.

stardyun avatar Feb 27 '25 04:02 stardyun

it takes two rounds of dialogue requests to get a response, and the message records are also repeated for two rounds. I have also encountered the same problem.

vifun avatar Mar 14 '25 02:03 vifun

The first round is to get the session ID which will be applied for the successive conversations.

KevinHuSh avatar Mar 14 '25 07:03 KevinHuSh

After obtaining the session ID through the use of the interface/api/v1/agents/{agent_id}/sessions, the first question-answer interaction is conducted using the interface/api/v1/agents/{agent_id}/completions, and the result is normal. When using the previous session ID to ask the second question, at this time, the following data will be returned: { "code": 0, "data": true }, and it will only respond normally after you make another request.

vifun avatar Mar 14 '25 08:03 vifun

Image

Image

Image

vifun avatar Mar 14 '25 08:03 vifun

Does the session ID have an expiration time? Image

vifun avatar Mar 14 '25 08:03 vifun

It may be related to your entire flow. Is it normal via UI?

KevinHuSh avatar Mar 14 '25 09:03 KevinHuSh

The UI is also not functioning properly.

Image

vifun avatar Mar 14 '25 09:03 vifun

Image

vifun avatar Mar 14 '25 09:03 vifun

Image

KevinHuSh avatar Mar 14 '25 09:03 KevinHuSh

Thank you! If I want to output the SQL statements generated by LLM into the dialog box, how can I do it? Or is there an interface to access the running results of the nodes?

vifun avatar Mar 14 '25 09:03 vifun

ExecSQL will adjust the SQL if fail. So, the real SQL can't be obtained.

KevinHuSh avatar Mar 14 '25 09:03 KevinHuSh

In the future plan, is there a feature that enables LLM to generate SQL statements, and then ExecSQL can execute these SQL statements and output the results to the dialog box?

vifun avatar Mar 14 '25 09:03 vifun

No plan yet.

KevinHuSh avatar Mar 17 '25 06:03 KevinHuSh

Agent always talks firstly.

I mean that in the second step 2. Converse with agent, an answer should be given immediately. If the begin component is not set with input parameters, it is normal.

stardyun avatar Mar 18 '25 08:03 stardyun

Here is my flowchart. For each session_id, the first question can only elicit the opening remarks as the response. May I ask how to draw this flowchart properly? Image

vifun avatar Mar 18 '25 09:03 vifun

Image

vifun avatar Mar 18 '25 09:03 vifun

Hello, I ran into the same problem, see my PR #6659 above for a possible fix.

notsyncing avatar Mar 29 '25 13:03 notsyncing