Commit Graph

1592 Commits

Author SHA1 Message Date
DanielWalnut
ab427731dc feat: add AIO sandbox provider and auto title generation (#1)
- Add AioSandboxProvider for Docker-based sandbox execution with
  configurable container lifecycle, volume mounts, and port management
- Add TitleMiddleware to auto-generate thread titles after first
  user-assistant exchange using LLM
- Add Claude Code documentation (CLAUDE.md, AGENTS.md)
- Extend SandboxConfig with Docker-specific options (image, port, mounts)
- Fix hardcoded mount path to use expanduser
- Add agent-sandbox and dotenv dependencies

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 23:29:18 +08:00
DanielWalnut
b2abfecf67 feat: add AIO sandbox provider and auto title generation (#1)
- Add AioSandboxProvider for Docker-based sandbox execution with
  configurable container lifecycle, volume mounts, and port management
- Add TitleMiddleware to auto-generate thread titles after first
  user-assistant exchange using LLM
- Add Claude Code documentation (CLAUDE.md, AGENTS.md)
- Extend SandboxConfig with Docker-specific options (image, port, mounts)
- Fix hardcoded mount path to use expanduser
- Add agent-sandbox and dotenv dependencies

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 23:29:18 +08:00
Henry Li
de2d18561a feat: integrated with sandbox 2026-01-14 12:32:34 +08:00
Henry Li
c1e9340062 chore: use .env 2026-01-14 12:32:15 +08:00
Henry Li
57dfc89ca1 chore: specify project name 2026-01-14 09:58:53 +08:00
Henry Li
ce0b6f7754 chore: specify project title 2026-01-14 09:57:52 +08:00
Henry Li
5d6a7442d6 chore: remove tests 2026-01-14 09:52:34 +08:00
Henry Li
c628c7f8db chore: create frontend project from boilerplate 2026-01-14 09:50:26 +08:00
Henry Li
3ff7613dd9 chore: mark backend folder as a Python project 2026-01-14 09:24:33 +08:00
Henry Li
2aeaf7c965 style: format 2026-01-14 09:21:19 +08:00
Henry Li
421488a991 chore: add lint and format 2026-01-14 09:20:05 +08:00
Henry Li
2e3a50d847 chore: update workspace structure 2026-01-14 09:19:54 +08:00
Henry Li
e5c69cb7ee docs: update tool docs 2026-01-14 09:12:03 +08:00
Henry Li
cb611f9270 chore: use ruff to lint and auto-format 2026-01-14 09:08:20 +08:00
Henry Li
7dc063ba25 feat: add agents 2026-01-14 07:20:00 +08:00
Henry Li
cbbbac0c2b feat: add tools 2026-01-14 07:19:43 +08:00
Henry Li
57a02acb59 feat: add sandbox and local impl 2026-01-14 07:19:34 +08:00
Henry Li
4b5f529903 feat: integrated with Tavily and Jina AI 2026-01-14 07:17:22 +08:00
Henry Li
83bd7e4309 feat: add model modules 2026-01-14 07:16:45 +08:00
Henry Li
721b26a32f chore: add an empty __init__.py 2026-01-14 07:16:27 +08:00
Henry Li
86524a65f6 feat: add reflection modules 2026-01-14 07:16:07 +08:00
Henry Li
88ed3841c7 feat: add config modules 2026-01-14 07:15:58 +08:00
Henry Li
c2a62a2266 chore: add Python and LangGraph stuff 2026-01-14 07:15:02 +08:00
Henry Li
81bd4dafa8 chore: add .gitignore for Python project 2026-01-14 07:14:00 +08:00
Henry Li
dd545cfb97 chore: init 2026-01-14 07:09:20 +08:00
Willem Jiang
6b73a53999 fix(config): Add support for MCP server configuration parameters (#812)
* fix(config): Add support for MCP server configuration parameters

* refact: rename the sse_readtimeout to sse_read_timeout

* update the code with review comments

* update the MCP document for the latest change
2026-01-10 15:59:49 +08:00
Willem Jiang
e52e69bdd4 fix(frontend):eliminating the empty divider issue on the frontend (#811)
* fix(frontend):eliminating the empty divider issue on the frontend

* Update the store.test.ts for the new changes
2026-01-09 23:34:07 +08:00
Willem Jiang
336040310c fix(frontend): passing the MCP header and env setting to backend (#810)
This pull request adds support for custom HTTP headers to the MCP server configuration and ensures that these headers are properly validated and included when adding new MCP servers. The changes are primarily focused on extending the schema and data handling for MCP server metadata.
2026-01-09 22:52:49 +08:00
MirzaSamadAhmedBaig
8c59f63d1b Fix message validation JSON import (#809)
* Fix message validation JSON import

* Update src/utils/context_manager.py

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

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-09 22:38:19 +08:00
Willem Jiang
a376b0cb4e fix: Add runtime parameter to compress_messages method(#803)
* fix: Add runtime parameter to compress_messages method(#803)

    The compress_messages method was being called by PreModelHookMiddleware
    with both state and runtime parameters, but only accepted state parameter.
    This caused a TypeError when the middleware executed the pre_model_hook.

    Added optional runtime parameter to compress_messages signature to match
    the expected interface while maintaining backward compatibility.

* Update the code with the review comments
2026-01-07 20:36:15 +08:00
Willem Jiang
d4ab77de5c fix: migrate from deprecated create_react_agent to langchain.agents.create_agent (#802)
* fix: migrate from deprecated create_react_agent to langchain.agents.create_agent

Fixes #799

- Replace deprecated langgraph.prebuilt.create_react_agent with
  langchain.agents.create_agent (LangGraph 1.0 migration)
- Add DynamicPromptMiddleware to handle dynamic prompt templates
  (replaces the 'prompt' callable parameter)
- Add PreModelHookMiddleware to handle pre-model hooks
  (replaces the 'pre_model_hook' parameter)
- Update AgentState import from langchain.agents in template.py
- Update tests to use the new API

* fix:update the code with review comments
2026-01-07 09:06:16 +08:00
Willem Jiang
1ced90b055 fix(frontend):added the display of the 'analyst' message #800 (#801) 2026-01-06 20:43:04 +08:00
dependabot[bot]
7e10b105ca build(deps): bump jspdf from 3.0.4 to 4.0.0 in /web (#798)
Bumps [jspdf](https://github.com/parallax/jsPDF) from 3.0.4 to 4.0.0.
- [Release notes](https://github.com/parallax/jsPDF/releases)
- [Changelog](https://github.com/parallax/jsPDF/blob/master/RELEASE.md)
- [Commits](https://github.com/parallax/jsPDF/compare/v3.0.4...v4.0.0)

---
updated-dependencies:
- dependency-name: jspdf
  dependency-version: 4.0.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-06 09:07:18 +08:00
Willem Jiang
7ebbb53b57 fix(frontend): render all tool calls in the frontend #796 (#797) 2026-01-05 22:24:52 +08:00
Willem Jiang
275aab9d42 fix(log): Enable the logging level when enabling the DEBUG environment variable (#793) 2026-01-01 09:32:42 +08:00
Willem Jiang
a71b6bc41f fix(main): Passing the local parameter from the main interactive mode (#791) 2025-12-30 10:41:29 +08:00
YMG001
893ff82a7f fix(workflow): resolve locale hardcoding in src/workflow.py for interactive mode (#789) 2025-12-30 09:47:39 +08:00
Willem Jiang
5087d5012f fix(deps): update langchain-core to 1.2.5 to resolve CVE-2025-68664 (#787) 2025-12-27 21:36:17 +08:00
Willem Jiang
bab60e6e3d fix(podcast): add fallback for models without json_object support (#747) (#785)
* fix(podcast): add fallback for models without json_object support (#747)

Models like Kimi K2 don't support response_format.type: json_object.
Add try-except to fall back to regular prompting with JSON parsing
when BadRequestError mentions json_object not supported.

- Add fallback to prompting + repair_json_output parsing
- Re-raise other BadRequestError types
- Add unit tests for script_writer_node with 100% coverage

* Apply suggestions from code review

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

* fixes: the unit test error of test_script_writer_node.py

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-26 23:04:20 +08:00
Willem Jiang
5a79f896c4 fix(metrics): update the polynomial regular expression used on uncontrolled data (#784) 2025-12-26 10:10:12 +08:00
Willem Jiang
cd5c4877f3 fix(web): enable runtime API URL detection for cross-machine access (#777) (#783)
When NEXT_PUBLIC_API_URL is not explicitly configured, the frontend now
automatically detects the API URL based on the current page's hostname.
This allows accessing DeerFlow from other machines without rebuilding
the frontend.

- Add getBaseURL() helper with runtime window.location detection
- Use same protocol and hostname with default port 8000
- Preserve explicit NEXT_PUBLIC_API_URL configuration when set
- Fallback to localhost:8000 for SSR scenarios
2025-12-25 22:34:26 +08:00
Willem Jiang
8d9d767051 feat(eval): add report quality evaluation module and UI integration (#776)
* feat(eval): add report quality evaluation module

Addresses issue #773 - How to evaluate generated report quality objectively.

This module provides two evaluation approaches:
1. Automated metrics (no LLM required):
   - Citation count and source diversity
   - Word count compliance per report style
   - Section structure validation
   - Image inclusion tracking

2. LLM-as-Judge evaluation:
   - Factual accuracy scoring
   - Completeness assessment
   - Coherence evaluation
   - Relevance and citation quality checks

The combined evaluator provides a final score (1-10) and letter grade (A+ to F).

Files added:
- src/eval/__init__.py
- src/eval/metrics.py
- src/eval/llm_judge.py
- src/eval/evaluator.py
- tests/unit/eval/test_metrics.py
- tests/unit/eval/test_evaluator.py

* feat(eval): integrate report evaluation with web UI

This commit adds the web UI integration for the evaluation module:

Backend:
- Add EvaluateReportRequest/Response models in src/server/eval_request.py
- Add /api/report/evaluate endpoint to src/server/app.py

Frontend:
- Add evaluateReport API function in web/src/core/api/evaluate.ts
- Create EvaluationDialog component with grade badge, metrics display,
  and optional LLM deep evaluation
- Add evaluation button (graduation cap icon) to research-block.tsx toolbar
- Add i18n translations for English and Chinese

The evaluation UI allows users to:
1. View quick metrics-only evaluation (instant)
2. Optionally run deep LLM-based evaluation for detailed analysis
3. See grade (A+ to F), score (1-10), and metric breakdown

* feat(eval): improve evaluation reliability and add LLM judge tests

- Extract MAX_REPORT_LENGTH constant in llm_judge.py for maintainability
- Add comprehensive unit tests for LLMJudge class (parse_response,
  calculate_weighted_score, evaluate with mocked LLM)
- Pass reportStyle prop to EvaluationDialog for accurate evaluation criteria
- Add researchQueries store map to reliably associate queries with research
- Add getResearchQuery helper to retrieve query by researchId
- Remove unused imports in test_metrics.py

* fix(eval): use resolveServiceURL for evaluate API endpoint

The evaluateReport function was using a relative URL '/api/report/evaluate'
which sent requests to the Next.js server instead of the FastAPI backend.
Changed to use resolveServiceURL() consistent with other API functions.

* fix: improve type accuracy and React hooks in evaluation components

- Fix get_word_count_target return type from Optional[Dict] to Dict since it always returns a value via default fallback
- Fix useEffect dependency issue in EvaluationDialog using useRef to prevent unwanted re-evaluations
- Add aria-label to GradeBadge for screen reader accessibility
2025-12-25 21:55:48 +08:00
geniusroad
84a7f7815c refactor(graph): Refactor tool loading logic within nodes (#782)
* refactor(graph): Optimize tool loading logic within nodes

- Pre-copy the default tool list during initialization
- Merge MCP server configuration with default tool handling
- Simplify conditional branches and unify agent creation logic
- Remove duplicated agent creation code blocks

* Apply suggestions from code review

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

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-25 21:10:04 +08:00
Willem Jiang
fb319aaa44 test: add unit tests for global connection pool (Issue #778) (#780)
* test: add unit tests for global connection pool (Issue #778)

- Add TestLifespanFunction class with 9 tests for lifespan management:
  - PostgreSQL/MongoDB pool initialization success/failure
  - Cleanup on shutdown
  - Skip initialization when not configured

- Add TestGlobalConnectionPoolUsage class with 4 tests:
  - Using global pools when available
  - Fallback to per-request connections

- Fix missing dict_row import in app.py (bug from PR #757)

* Apply suggestions from code review

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-23 23:06:39 +08:00
YikB
83e9d7c9e5 feat:Database connections use connection pools (#757)
* feat: Implement DeerFlow API server with chat streaming, Langgraph orchestration, and various content generation capabilities.

* Apply suggestions from code review

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

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-23 20:35:08 +08:00
Loganaden Velvindron
1f403a9f79 Fix typo in vulnerability reporting instructions (#772) 2025-12-21 17:07:13 +08:00
Willem Jiang
4dde77986a Added the security policy 2025-12-21 09:12:02 +08:00
Willem Jiang
04296cdf5a feat: add resource upload support for RAG (#768)
* feat: add resource upload support for RAG

- Backend: Added ingest_file method to Retriever and MilvusRetriever
- Backend: Added /api/rag/upload endpoint
- Frontend: Added RAGTab in settings for uploading resources
- Frontend: Updated translations and settings registration

* Apply suggestions from code review

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

* Apply suggestions from code review

* Apply suggestions from code review of src/rag/milvus.py

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-19 09:55:34 +08:00
Jiahe Wu
3e8f2ce3ad feat(web): add enable_web_search frontend UI (#681) (#766)
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-12-17 23:36:32 +08:00
Jiahe Wu
b85130b849 fix: display direct_response message in frontend (#763) (#764)
Extract message content from direct_response tool call args
and display it as the message content when tool call completes.

Note: This is a workaround. The message is not streamed because
direct_response uses tool calling mechanism where args are JSON,
not natural language text that can be streamed directly.
2025-12-17 21:04:37 +08:00