ragflow icon indicating copy to clipboard operation
ragflow copied to clipboard

Error occurred when using Agent:TavilySearch

Open 1430340687 opened this issue 4 months ago • 11 comments

Self Checks

  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report (Language Policy).
  • [x] Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
  • [x] Please do not modify this template :) and fill in all the required fields.

Describe your problem

When I was using the Agent, I wanna turn on the internet search: TavilySearch. But after I configured the API KEY and did a trial run, it gave an error. The error message is like this: TypeError("'NoneType' object is not subscriptable")

1430340687 avatar Aug 06 '25 04:08 1430340687

Hi @1430340687! I'm Dosu and I’m helping the ragflow team.

This error usually means the TavilySearch agent tried to access a field in the API response, but the response was None—often because of a missing or invalid API key, or a failed/malformed response from Tavily. In the code, if the Tavily API key is missing or incorrect, the search call can silently fail and return None, which then triggers the TypeError when the code tries to access res["results"] or similar fields see code reference.

Here’s what you can check:

  • Make sure the API key is correctly set in the UI and is valid (no extra spaces, not expired, and has the right permissions).
  • If you recently upgraded or changed how you enter the API key, note that the UI and backend handling of API keys was recently refactored—try re-entering the key and saving the agent again see PR #9086.
  • If you’re not using the latest (nightly) version, try upgrading—several TavilySearch and API key issues are resolved in the nightly Docker image see issue #6583.
  • If the error persists, check the logs for any Tavily-related errors or exceptions, which might give more detail about what’s going wrong.

This pattern of error is not unique to TavilySearch—similar issues happen elsewhere in RAGFlow when an external API response is None and the code doesn’t check for it before subscripting see related issues. Defensive checks and clearer error messages are being improved, but for now, double-checking your API key and version is the best first step.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

dosubot[bot] avatar Aug 06 '25 04:08 dosubot[bot]

my api key After checking, there were no errors. @gschmutz

1430340687 avatar Aug 06 '25 07:08 1430340687

The error messages in the log are as follows: 2025-08-06 15:05:57,655 ERROR 19 'NoneType' object is not subscriptable Traceback (most recent call last): File "/ragflow/api/apps/canvas_app.py", line 283, in input_form return get_json_result(data=canvas.get_component_input_form(cpn_id)) File "<@beartype(agent.canvas.Canvas.get_component_input_form) at 0x7f39118c9750>", line 10, in get_component_input_form File "/ragflow/agent/canvas.py", line 390, in get_component_input_form return self.components.get(cpn_id)["obj"].get_input_form() TypeError: 'NoneType' object is not subscriptable @dosu

1430340687 avatar Aug 06 '25 07:08 1430340687

@1430340687 , thanks for pointing this out! I’m Ziqi, working with the RAGFlow product manager. We’ve taken note of your issue, and we’re really thankful for your feedback! Let us know if you need anything else!

Llala0928 avatar Aug 15 '25 04:08 Llala0928

,感谢您指出这一点!我是子琦,与RAGFlow产品经理一起工作。我们已经注意到了您的问题,我们非常感谢您的反馈!如果您还需要什么,请告诉我们!

Image I have a similar log.

SharkByte-Pray avatar Aug 18 '25 03:08 SharkByte-Pray

i use agent Retrieval have same problem TypeError("'NoneType' object is not subscriptable")

KEVINEAST333 avatar Sep 15 '25 10:09 KEVINEAST333

Traceback (most recent call last): File "/ragflow/api/apps/canvas_app.py", line 289, in input_form return get_json_result(data=canvas.get_component_input_form(cpn_id)) File "<@beartype(agent.canvas.Graph.get_component_input_form) at 0x7f9ce13eee60>", line 10, in get_component_input_form File "/ragflow/agent/canvas.py", line 151, in get_component_input_form return self.components.get(cpn_id)["obj"].get_input_form() TypeError: 'NoneType' object is not subscriptable

KEVINEAST333 avatar Sep 15 '25 10:09 KEVINEAST333

i use agent Retrieval have same problem TypeError("'NoneType' object is not subscriptable"): Traceback (most recent call last):

File "/ragflow/api/apps/canvas_app.py", line 289, in input_form

return get_json_result(data=canvas.get_component_input_form(cpn_id))

File "<@beartype(agent.canvas.Graph.get_component_input_form) at 0x7f87b23a2b00>", line 10, in get_component_input_form

File "/ragflow/agent/canvas.py", line 151, in get_component_input_form

return self.components.get(cpn_id)["obj"].get_input_form()

TypeError: 'NoneType' object is not subscriptable

huangxu8499 avatar Sep 23 '25 12:09 huangxu8499

@KEVINEAST333 @1430340687 @SharkByte-Pray @Llala0928 ​​Is the problem solved?​​

huangxu8499 avatar Sep 23 '25 13:09 huangxu8499

问题解决了吗?

Change the context-large embedding model

SharkByte-Pray avatar Sep 24 '25 02:09 SharkByte-Pray

问题解决了吗?

更改上下文-大型嵌入模型

Has the problem been solved? I also encountered the above-mentioned problem

Hzyy99 avatar Dec 05 '25 01:12 Hzyy99