推理搜索因为key error而停止

Open
#256 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
ai, backend

Research direction

Reproduce the example through the graph execution path in agent/graph.py, especially node() around line 220, and inspect the caller in agent/streaming.py. Compare the names created by add_node with those passed to node(); clarify the expected behavior for case or spelling mismatches, then add a regression test once that behavior is agreed.

Written by the indexing model from the issue text.

Description

这是mindsearch的思考:为了构建关于Gay-Lussac的搜索图,我们需要首先添加一个根节点来表示这个问题。然后,我们可以添加子节点来探索Gay-Lussac的生平、成就以及他在科学领域的具体贡献。


from ilagent.agents.python_web import WebSearchGraph
graph = WebSearchGraph()
graph.add_root_node(node_content="gay lussac", node_name="root")

# 添加关于Gay-Lussac生平的节点
graph.add_node(
    node_name="gay_lussac_biography",
    node_content="Gay-Lussac的生平是什么?")
graph.add_edge(start_node="root", end_node="gay_lussac_biography")

# 添加关于Gay-Lussac科学成就的节点
graph.add_node(
    node_name="gay_lussac_achievements",
    node_content="Gay-Lussac有哪些科学成就?")
graph.add_edge(start_node="root", end_node="gay_lussac_achievements")

# 添加关于Gay-Lussach在气体定律方面的贡献的节点
graph.add_node(
    node_name="gay_lussacs_gas_law_contributions",
    node_content="G Cay Lusssacs对气体定律有哪些贡献?")
graph.add_edge(start_node="root", end_node='g Cay Lusssacs对气体定律有哪些贡献')

# 获取这些节点的信息以进行进一步查询
biography_info = graph.node("gAY_LUSSAC_BIOGRAPHY")
achievements_info = graph.node("GAy_LUSSAC_ACHIEVEMENTS")
gaslaw_contributions_info = graph.node('GAy_LUSSSAC對氣體定律有什麼貢獻')

biography_info, achievements_info, gaslaw_contributions_info

这是后端返回的错误:INFO: 127.0.0.1:40602 - "POST /solve HTTP/1.1" 200 OK
ERROR:root:Exception in sync_generator_wrapper: 'gAY_LUSSAC_BIOGRAPHY'
Traceback (most recent call last):
File "/www/wwwroot/xxx/search/mindsearch/app.py", line 90, in sync_generator_wrapper
for response in agent(inputs, session_id=session_id):
File "/www/wwwroot/xxx/search/mindsearch/agent/streaming.py", line 19, in call
for response_message in self.forward(*message, session_id=session_id, **kwargs):
File "/www/wwwroot/xxx/search/mindsearch/agent/mindsearch_agent.py", line 105, in forward
for graph_exec in gen:
File "/home/user/.local/lib/python3.12/site-packages/lagent/utils/util.py", line 138, in iter
self.ret = yield from self.generator
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/www/wwwroot/xxx/search/mindsearch/agent/graph.py", line 263, in run
exec(command, global_dict, local_dict)
File "", line 25, in
File "/www/wwwroot/xxx/search/mindsearch/agent/graph.py", line 220, in node
return self.nodes[node_name].copy()
~~~~~~~~~~^^^^^^^^^^^
KeyError: 'gAY_LUSSAC_BIOGRAPHY' 这看起来是internlm 2.5 7b 能力不行 在选择节点时出现文字大小写不一的问题 有时甚至单词都换了 导致key error

Dominant language
JavaScript
Stars
7k
Forks
684
PR merge metrics
No merged PRs in 30d

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from InternLM/MindSearch

All issues in InternLM/MindSearch

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.