Commit Graph

48 Commits

Author SHA1 Message Date
Willem Jiang 5af036f19f
fix: add missing RunnableConfig parameter to human_feedback_node (#629)
* fix: add missing RunnableConfig parameter to human_feedback_node

This fixes issue #569 where interrupt() was being called outside of a runnable context.
The human_feedback_node was missing the config: RunnableConfig parameter that all other
node functions have, which caused RuntimeError when interrupt() tried to access the config.

- Add config: RunnableConfig parameter to function signature
- Add State type annotation to state parameter for consistency
- Maintains LangGraph execution context required by interrupt()

* test: update human_feedback_node tests to pass RunnableConfig parameter

Update all test functions that call human_feedback_node to include the new
required config parameter. These tests were failing because they were not
providing the RunnableConfig argument after the fix to add proper LangGraph
execution context.

Tests updated:
- test_human_feedback_node_auto_accepted
- test_human_feedback_node_edit_plan
- test_human_feedback_node_accepted
- test_human_feedback_node_invalid_interrupt
- test_human_feedback_node_json_decode_error_first_iteration
- test_human_feedback_node_json_decode_error_second_iteration
- test_human_feedback_node_not_enough_context

All tests now pass the mock_config fixture to human_feedback_node.
2025-10-19 17:35:06 +08:00
Willem Jiang 57c9c2dcd5
fix: improve error handling in researcher and coder nodes (#596)
- Wrap agent.ainvoke() calls in try-except blocks
- Log full exception tracebacks for better debugging
- Return detailed error messages to users instead of generic 'internal error'
- Include step title and agent name in error context
- Allow workflow to continue gracefully when agent execution fails
- Store error details in observations for audit trail
2025-10-19 16:33:14 +08:00
jimmyuconn1982 2510cc61de
feat: Add intelligent clarification feature in coordinate step for research queries (#613)
* fix: support local models by making thought field optional in Plan model

- Make thought field optional in Plan model to fix Pydantic validation errors with local models
- Add Ollama configuration example to conf.yaml.example
- Update documentation to include local model support
- Improve planner prompt with better JSON format requirements

Fixes local model integration issues where models like qwen3:14b would fail
due to missing thought field in JSON output.

* feat: Add intelligent clarification feature for research queries

- Add multi-turn clarification process to refine vague research questions
- Implement three-dimension clarification standard (Tech/App, Focus, Scope)
- Add clarification state management in coordinator node
- Update coordinator prompt with detailed clarification guidelines
- Add UI settings to enable/disable clarification feature (disabled by default)
- Update workflow to handle clarification rounds recursively
- Add comprehensive test coverage for clarification functionality
- Update documentation with clarification feature usage guide

Key components:
- src/graph/nodes.py: Core clarification logic and state management
- src/prompts/coordinator.md: Detailed clarification guidelines
- src/workflow.py: Recursive clarification handling
- web/: UI settings integration
- tests/: Comprehensive test coverage
- docs/: Updated configuration guide

* fix: Improve clarification conversation continuity

- Add comprehensive conversation history to clarification context
- Include previous exchanges summary in system messages
- Add explicit guidelines for continuing rounds in coordinator prompt
- Prevent LLM from starting new topics during clarification
- Ensure topic continuity across clarification rounds

Fixes issue where LLM would restart clarification instead of building upon previous exchanges.

* fix: Add conversation history to clarification context

* fix: resolve clarification feature message to planer, prompt, test issues

- Optimize coordinator.md prompt template for better clarification flow
- Simplify final message sent to planner after clarification
- Fix API key assertion issues in test_search.py

* fix: Add configurable max_clarification_rounds and comprehensive tests

- Add max_clarification_rounds parameter for external configuration
- Add comprehensive test cases for clarification feature in test_app.py
- Fixes issues found during interactive mode testing where:
  - Recursive call failed due to missing initial_state parameter
  - Clarification exited prematurely at max rounds
  - Incorrect logging of max rounds reached

* Move clarification tests to test_nodes.py and add max_clarification_rounds to zh.json
2025-10-14 13:35:57 +08:00
Fancy-hjyp 5f4eb38fdb
feat: add context compress (#590)
* feat:Add context compress

* feat: Add unit test

* feat: add unit test for context manager

* feat: add postprocessor param && code format

* feat: add configuration guide

* fix: fix the configuration_guide

* fix: fix the unit test

* fix: fix the default value

* feat: add test and log for context_manager
2025-09-27 21:42:22 +08:00
Willem Jiang a41ced1345
fix: the search content return tuple issue (#555) 2025-09-04 15:45:30 +08:00
Willem Jiang 8f127df948
Fixed the deepseek v3 planning issue #545 (#554) 2025-09-04 10:09:49 +08:00
Anoyer-lzh 270d8c3712
fix: env parameters exception when configuring SSE or HTTP MCP server (#513)
* fix: _create_streamable_http_session() got an unexpected keyword argument 'env'

fix unit error

* update md

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-08-20 17:23:57 +08:00
zgjja 3b4e993531
feat: 1. replace black with ruff for fomatting and sort import (#489)
2. use tavily from`langchain-tavily` rather than the older one from `langchain-community`

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-08-17 22:57:23 +08:00
Willem Jiang 4218cddab5
fix: langchain-mcp-adapters version conflict (#500)
* fix: langchain-mcp-adapters version conflict

* fix the lint error
2025-08-04 10:36:31 +08:00
DanielWalnut c7edaf3e84
refine the research prompt (#459) 2025-07-22 14:13:10 +08:00
DanielWalnut dbb24d7d14
fix: fix the bug introduced by coordinator messages update (#445) 2025-07-18 21:36:13 +08:00
道心坚定韩道友 f17b06f206
fix:planner AttributeError 'list' object has no attribute 'get' (#436) 2025-07-18 09:27:15 +08:00
Kuro Akuta c89b35805d
fix: fix the coordinator's forgetting of its own messages. (#433) 2025-07-17 08:36:31 +08:00
DanielWalnut 448001f532
refactor: human feedback doesn't need to check enough context (#423) 2025-07-15 18:51:41 +08:00
Willem Jiang c0b04aaba2
test: add unit tests for graph (#296)
* test: added unit test of builder

* test: Add unit tests for nodes.py

* test: add more unit tests in test_nodes

* test: try to fix the unit test error on GitHub

* test: reformate the code of test_nodes.py

* Fix the test error of reset the local argument

* Fixed the test error by setup args

* reformat the code
2025-06-18 10:05:02 +08:00
Willem Jiang 4fb053b6d2
Revert "fix: solves the malformed json output and pydantic validation error p…" (#325)
This reverts commit a7315b46df.
2025-06-14 22:04:03 +08:00
DanielWalnut 19fa1e97c3
feat: add deep think feature (#311)
* feat: implement backend logic

* feat: implement api/config endpoint

* rename the symbol

* feat: re-implement configuration at client-side

* feat: add client-side of deep thinking

* fix backend bug

* feat: add reasoning block

* docs: update readme

* fix: translate into English

* fix: change icon to lightbulb

* feat: ignore more bad cases

* feat: adjust thinking layout, and implement auto scrolling

* docs: add comments

---------

Co-authored-by: Henry Li <henry1943@163.com>
2025-06-14 13:12:43 +08:00
Tax a7315b46df
fix: solves the malformed json output and pydantic validation error produced by the 'planner' node by forcing the llm response to strictly comply with the pydantic 'Plan' model (#322) 2025-06-14 10:13:30 +08:00
DanielWalnut 447e427fd3
refactor: refine teh background check logic (#306) 2025-06-11 11:10:02 +08:00
DanielWalnut 0e22c373af
feat: support to adjust writing style (#290)
* feat: implment backend for adjust report style

* feat: add web part

* fix test cases

* fix: fix typing

---------

Co-authored-by: Henry Li <henry1943@163.com>
2025-06-07 20:48:39 +08:00
DanielWalnut b5ec61bb9d
refactor: refine the graph structure (#283) 2025-06-05 12:47:17 +08:00
JeffJiang 462752b462
feat: RAG Integration (#238)
* feat: add rag provider and retriever

* feat: retriever tool

* feat: add retriever tool to the researcher node

* feat: add rag http apis

* feat: new message input supports resource mentions

* feat: new message input component support resource mentions

* refactor: need_web_search to need_search

* chore: RAG integration docs

* chore: change example api host

* fix: user message color in dark mode

* fix: mentions style

* feat: add local_search_tool to researcher prompt

* chore: research prompt

* fix: ragflow page size and reporter with

* docs: ragflow integration and add acknowledgment projects

* chore: format
2025-05-28 14:13:46 +08:00
DanielWalnut 0565ab6d27
fix: fix unittes & background investigation search logic (#247) 2025-05-28 14:05:34 +08:00
wushiai1109 29be360954
Update nodes.py (#242)
SELECTED_SEARCH_ENGINE impossible equal to SearchEngine.ARXIV, should be SearchEngine.ARXIV.value, or use the encapsulated get_web_search_tool
2025-05-27 18:58:14 +08:00
DanielWalnut 8bbcdbe4de
feat: config max_search_results for search engine (#192)
* feat: implement UI

* feat: config max_search_results for search engine via api

---------

Co-authored-by: Henry Li <henry1943@163.com>
2025-05-18 13:23:52 +08:00
changqingla c6bbc595c3
Fix :This PR can resolve the issue of exceeding the default tool invocation limit by setting the recursion limit through an environment variable.mit (#138)
* set ecursion limit

* set ecursion limit

* fix:check if the recession_limit within a reasonalbe range

* style: format code with black
2025-05-17 20:37:03 -07:00
DanielWalnut f7d79b6d83
refactor: upgrade langgraph version (#148) 2025-05-18 11:29:41 +08:00
Wang Hao e27c43f005
fix: add model_dump (#137)
Co-authored-by: Willem Jiang <143703838+willem-bd@users.noreply.github.com>
2025-05-16 21:05:46 +08:00
DanielWalnut 5cc0e61297
refactor: refine the step execute human message (#144) 2025-05-14 18:54:14 +08:00
DanielWalnut f73a7a229c
refactor: add existing research findings into step human message (#140) 2025-05-14 18:40:14 +08:00
Zhao Longjie 9266201fe5
fix: background investigator node support more search engine (#75)
Change-Id: I030a2b9218dfbda2dd2383b7a73266dd7de589c7
2025-05-12 20:15:47 +08:00
DanielWalnut 091f437bc5
feat: add necessary log when no tool calls (#16) 2025-05-09 14:22:07 +08:00
Zhao Longjie dab1ba4789 fix(planner): skip human feedback if context is sufficient
Change-Id: I2b5628a7a8ecb6a6bad2712a9ff81b9b1cd323c6
2025-04-29 18:17:27 +08:00
Zhao Longjie 899438eca0 feat(nodes): add background investigation node
Change-Id: I96e08e22fc7c52647edbf9be4f385a8fae9b449a
2025-04-27 20:15:42 +08:00
Wang Hao ada5e34eeb feat: add LOCALE variable to agent prompts 2025-04-26 20:57:38 -07:00
He Tao 3e4e551613 fix: add server name in desc 2025-04-23 18:02:58 +08:00
He Tao 0cf859b393 feat: support mcp settings 2025-04-23 16:00:01 +08:00
He Tao afb8571cbd feat: use doubao model by default 2025-04-22 11:04:36 +08:00
He Tao 52313b2405 fix: fix multi-round issue 2025-04-21 20:16:42 +08:00
Li Xin b67b04ff5d feat: support multi-language 2025-04-21 19:50:34 +08:00
He Tao 6937abcd91 chore: add license headers 2025-04-17 11:34:42 +08:00
He Tao 76fd04df22 chore: change the project name 2025-04-17 11:17:03 +08:00
He Tao b8c4248ed2 feat: refine the hil text 2025-04-16 19:07:40 +08:00
He Tao 92606fbd4c feat: support interrupt protocol 2025-04-15 19:32:44 +08:00
He Tao a7ae47fc7a feat: support human in the loop 2025-04-14 19:53:00 +08:00
He Tao 23298abd14 fix: fix coordinator prompt 2025-04-11 13:45:44 +08:00
He Tao aaa340787c feat: add more examples 2025-04-10 15:00:56 +08:00
He Tao 03798ded08 feat: lite deep researcher implementation 2025-04-09 20:32:16 +08:00