Commit Graph

463 Commits

Author SHA1 Message Date
Willem Jiang
58c1743ed5 fix: resolve math formula display abnormal after editing report
This fix addresses the issue where math formulas become corrupted or
incorrectly displayed after editing the generated report in the editor.

**Root Cause:**
The issue occurred due to incompatibility between markdown processing
in the display component and the Tiptap editor:
1. Display component used \[\] and \(\) LaTeX delimiters
2. Tiptap Mathematics extension expects $ and 70868 delimiters
3. tiptap-markdown didn't have built-in math node serialization
4. Math syntax was lost/corrupted during editor save operations

**Solution Implemented:**
1. Created MathematicsWithMarkdown extension that adds markdown
   serialization support to Tiptap's Mathematics nodes
2. Added math delimiter normalization functions:
   - normalizeMathForEditor(): Converts LaTeX delimiters to $/70868
   - normalizeMathForDisplay(): Standardizes all delimiters to 70868
3. Updated Markdown component to use new normalization
4. Updated ReportEditor to normalize content before loading

**Changes:**
- web/src/components/editor/math-serializer.ts (new)
- web/src/components/editor/extensions.tsx
- web/src/components/editor/index.tsx
- web/src/components/deer-flow/markdown.tsx
- web/src/core/utils/markdown.ts
- web/tests/markdown-math-editor.test.ts (new)
- web/tests/markdown-katex.test.ts

**Testing:**
- Added 15 comprehensive tests for math normalization round-trip
- All tests passing (math editor + existing katex tests)
- Verified TypeScript compilation and linting

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-10-15 08:52:50 +08:00
jimmyuconn1982
24e2d86f7b fix: add max_clarification_rounds parameter passing from frontend to backend (#616)
Bug Fix
This PR fixes the issue where max_clarification_rounds parameter was not being passed from the frontend to the backend, causing a TypeError: '<' not supported between instances of 'int' and 'NoneType' error.

Technical Details
The issue was that the frontend was not passing the max_clarification_rounds parameter to the backend API, causing the backend to receive None values and fail during comparison operations. This fix ensures the parameter is properly typed and passed through the entire request chain.
2025-10-14 17:56:20 +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
Willem Jiang
81c91dda43 feature: clean up the temp file which are generated when running the unit test of milvus (#612)
Co-authored-by: Willem Jiang <143703838+willem-bd@users.noreply.github.com>
2025-10-12 22:10:15 +08:00
Willem Jiang
2a6455c436 feature: add formula rander in the markdown (#611)
* feature: add formula rander in the markdown

* fixed the lint errors
2025-10-11 23:05:09 +08:00
jovial
f80af8e132 chore: fix incorrect filename in conf.yaml.example comments (#609) 2025-10-11 10:00:22 +08:00
Willem Jiang
79b9cdb59a feature:Add the debug setting on vscode (#606) 2025-10-05 22:07:23 +08:00
jimmyuconn1982
24f6905c18 fix: support local models by making thought field optional in Plan model (#601)
- 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.

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-09-28 08:48:39 +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
HagonChan
c214999606 feat: add strategic_investment report style (#595)
* add strategic_investment mode

* make format

* make lint

* fix: repair
lint-frontend
2025-09-24 09:50:36 +08:00
Gordon
1c27e0f2ae feat: add support for searx/searxng (#253)
* add searx/searxng support

* nit

* Fix indentation in search.py for readability

* Clean up imports in search.py

Removed unused imports from search.py

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-09-22 18:54:30 +08:00
Fancy-hjyp
6bb0b95579 feat:support config tavily search results (#591)
* feat:support config tavily search results

* feat: support config tavily search results

* feat: update the default value of include_images

* fix: fix the test

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-09-22 18:26:50 +08:00
irrcombat
150a730f98 Debug deerflow server, web with vscode (#592)
* Debug deerflow server, web with vscode

Signed-off-by: shjy <asdf_0403@qq.com>

* removed the duplicated setting of .vscode

---------

Signed-off-by: shjy <asdf_0403@qq.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-09-22 13:59:34 +08:00
Chayton Bai
7694bb5d72 feat: support dify in rag module (#550)
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-09-16 20:30:45 +08:00
lele3436
5085bf8ee9 feat: support for moi in RAG module (#571)
* feat: add support for moi

* small adjust

* small adjust

* according 2 comments

* add more intro

* add more intro
2025-09-16 20:25:59 +08:00
Willem Jiang
ea0fe62971 fix: don't expose internal application error to client (#585) 2025-09-16 10:01:24 +08:00
Willem Jiang
79ab7365c0 fix: log the exception of graph execution (#577)
* fix: log the exeption of graph execution

* Update src/server/app.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-14 21:20:25 +08:00
lele3436
26a587c24e fix: frontend supports chinese for listing datasets in RAG (#582)
* fix-web-rag

* Update resource-suggestion.tsx
2025-09-14 20:19:56 +08:00
HagonChan
bbc49a04a6 feat: add Google AI Studio API support with platform-based detection (#502)
* feat: add Google AI Studio API support with platform-based detection

* chore: update configuration_guide.md

* fix the uv.lock formate error

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-09-13 08:49:05 +08:00
CHANGXUBO
dd9af1eb50 feat: Implement Milvus retriver for RAG (#516)
* feat: Implement MilvusRetriever with embedding model and resource management

* chore: Update configuration and loader files for consistency

* chore: Clean up test_milvus.py for improved readability and organization

* feat: Add tests for DashscopeEmbeddings query and document embedding methods

* feat: Add tests for embedding model initialization and example file loading in MilvusProvider

* chore: Remove unused imports and clean up test_milvus.py for better readability

* chore: Clean up test_milvus.py for improved readability and organization

* chore: Clean up test_milvus.py for improved readability and organization

* fix: replace print statements with logging in recursion limit function

* Implement feature X to enhance user experience and optimize performance

* refactor: clean up unused imports and comments in AboutTab component

* Implement feature X to enhance user experience and fix bug Y in module Z

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-09-12 22:20:55 +08:00
jimma
eec8e4dd60 refactor(logging): add explicit error log message (#576)
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-09-12 22:09:08 +08:00
Qiyuan Jiao
6d1d7f2d9e fix: Remove duplicate assignment operations for the tool_call_chunks field (#575) 2025-09-12 21:56:53 +08:00
Willem Jiang
c2186c1ef8 doc: updated the README of the bootstrap (#568) 2025-09-10 21:00:16 +08:00
voroq
005712679c docs: add deployment note for Linux servers (#565)
* docs: add deployment note for Linux servers

- allow external connections by changing the host to 0.0.0.0.
- security warning to remind users to secure their environment before exposing the service.

* docs: add deployment note for Linux servers

- allow external connections by changing the host to 0.0.0.0.
- security warning to remind users to secure their environment before exposing the service.
2025-09-09 23:05:04 +08:00
Willem Jiang
317acdffad fix: the stdio and sse mcp server loading issue (#566) 2025-09-09 23:02:15 +08:00
Willem Jiang
4c17d88029 feat: creating mogodb and postgres mock instance in checkpoint test (#561)
* fix: using mongomock for the checkpoint test

* Add postgres mock setting to the unit test

* Added utils file of postgres_mock_utils

* fixed the runtime loading error of deerflow server
2025-09-09 22:49:11 +08:00
CHANGXUBO
7138ba36bc Add psycopg dependencies instruction for checkpointing (#564)
* Add psycopg dependencies instruction for checkpointing

* fix: update Dockerfile to improve dependency installation process
2025-09-09 17:28:18 +08:00
voroq
38ff2f7276 fix: correct typo in MongoDB connection string within .env.example (#560)
* fix: correct typo in MongoDB connection string within .env.example

- Changes 'ongodb' to 'mongodb' in LANGGRAPH_CHECKPOINT_DB_URL example.
- This ensures the example configuration is valid and can be used directly.

* Update LANGGRAPH_CHECKPOINT_DB_URL in .env.example

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-09-08 06:54:21 +08:00
dependabot[bot]
a8a2e29e2c build(deps): bump next from 15.3.0 to 15.4.7 in /web (#556)
Bumps [next](https://github.com/vercel/next.js) from 15.3.0 to 15.4.7.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v15.3.0...v15.4.7)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 15.4.7
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-04 22:26:33 +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
12november
5f1981ac9b fix deer-flow/src/prompts/prose/prose_zap.md (#553) 2025-09-03 19:32:09 +08:00
Willem Jiang
72f9c59195 feat: add lint check of front-end (#534)
* feat: add lint check of front-end

* add pnpm installation

* add pnpm installation
2025-08-22 21:08:53 +08:00
Willem Jiang
0a02843666 Fix: build of font end of #466 (#530) 2025-08-21 23:25:52 +08:00
道心坚定韩道友
f17e5bd6c8 FIX/Adapt message box to handle long text in frontend (#466)
* fix:ui

* fix:ui bug

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-08-21 10:31:54 +08:00
CHANGXUBO
db6c1bf7cb fix: update TavilySearchWithImages to inherit from TavilySearchResults (#522) 2025-08-21 09:52:12 +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
Willem Jiang
b08e9ad3ac fix: GitHub workflow action version warning (#520)
* fix: using commit hash as the action version

* fix: using commit hash as the action version

---------

Co-authored-by: Willem Jiang <143703838+willem-bd@users.noreply.github.com>
2025-08-20 14:39:02 +08:00
Willem Jiang
c6d152a074 fix: using commit hash as the action version (#519)
Co-authored-by: Willem Jiang <143703838+willem-bd@users.noreply.github.com>
2025-08-20 13:52:00 +08:00
Willem Jiang
44d328f696 fix: polish the makefile to provide help command (#518) 2025-08-20 09:51:42 +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
CHANGXUBO
1bfec3ad05 feat: Enhance chat streaming and tool call processing (#498)
* feat: Enhance chat streaming and tool call processing

- Added support for MongoDB checkpointer in the chat streaming workflow.
- Introduced functions to process tool call chunks and sanitize arguments.
- Improved event message creation with additional metadata.
- Enhanced error handling for JSON serialization in event messages.
- Updated the frontend to convert escaped characters in tool call arguments.
- Refactored the workflow input preparation and initial message processing.
- Added new dependencies for MongoDB integration and tool argument sanitization.

* fix: Update MongoDB checkpointer configuration to use LANGGRAPH_CHECKPOINT_DB_URL

* feat: Add support for Postgres checkpointing and update README with database recommendations

* feat: Implement checkpoint saver functionality and update MongoDB connection handling

* refactor: Improve code formatting and readability in app.py and json_utils.py

* refactor: Clean up commented code and improve formatting in server.py

* refactor: Remove unused imports and improve code organization in app.py

* refactor: Improve code organization and remove unnecessary comments in app.py

* chore: use langgraph-checkpoint-postgres==2.0.21 to avoid the JSON convert issue in the latest version, implement chat stream persistant with Postgres

* feat: add MongoDB and PostgreSQL support for LangGraph checkpointing, enhance environment variable handling

* fix: update comments for clarity on Windows event loop policy

* chore: remove empty code changes in MongoDB and PostgreSQL checkpoint tests

* chore: clean up unused imports and code in checkpoint-related files

* chore: remove empty code changes in test_checkpoint.py

* chore: remove empty code changes in test_checkpoint.py

* chore: remove empty code changes in test_checkpoint.py

* test: update status code assertions in MCP endpoint tests to allow for 403 responses

* test: update MCP endpoint tests to assert specific status codes and enable MCP server configuration

* chore: remove unnecessary environment variables from unittest workflow

* fix: invert condition for MCP server configuration check to raise 403 when disabled

* chore: remove pymongo from test dependencies in uv.lock

* chore:  optimize the _get_agent_name method

* test: enhance ChatStreamManager tests for PostgreSQL and MongoDB initialization

* test: add persistence tests for ChatStreamManager with PostgreSQL and MongoDB

* test: add unit tests for ChatStreamManager initialization with PostgreSQL and MongoDB

* test: enhance persistence tests for ChatStreamManager with PostgreSQL and MongoDB to verify message aggregation

* test: add unit tests for ChatStreamManager with PostgreSQL and MongoDB

* test: add unit tests for ChatStreamManager initialization with PostgreSQL and MongoDB

* test: add unit tests for ChatStreamManager initialization with PostgreSQL and MongoDB

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-08-16 21:03:12 +08:00
CHANGXUBO
d65b8f8fcc feat: Add llms to support the latest Open Source SOTA models (#497)
* fix: update README and configuration guide for new model support and reasoning capabilities

* fix: format code for consistency in agent and node files

* fix: update test cases for environment variable handling in llm configuration

* fix: refactor message chunk conversion functions for improved clarity and maintainability

* refactor: remove enable_thinking parameter from LLM configuration functions

* chore: update agent-LLM mapping for consistency

* chore: update LLM configuration handling for improved clarity

* test: add unit tests for Dashscope message chunk conversion and LLM configuration

* test: add unit tests for message chunk conversion in Dashscope

* test: add unit tests for message chunk conversion in Dashscope

* chore: remove unused imports from test_dashscope.py

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-08-13 22:29:22 +08:00
Willem Jiang
ea17e82514 fix: backend server docker instance only listen to localhost (#508) 2025-08-11 19:28:21 +08:00
HagonChan
a4d6171c17 fix: tool name mismatch issue (#506) 2025-08-08 19:31:22 +08:00
orifake
e1f0595c3c refactor: refine coordinator prompt for Human In The Loop (#505) 2025-08-07 09:00:58 +08:00
Willem Jiang
9e691ecf20 fix: added configuration of python_repl (#503)
* fix: added configuration of python_repl

* fix the lint and unit test errors

* fix the lint and unit test errors

* fix:the lint check errors
2025-08-06 14:27:03 +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
Willem Jiang
ba7509d9ae fix: build of the web (#492) 2025-07-31 11:54:37 +08:00
Willem Jiang
aca9dcf643 fix:try to fix the docker build of front-end (#487) 2025-07-30 09:52:53 +08:00