diff --git a/backend/CLAUDE.md b/backend/CLAUDE.md index 78abf72..684ceb9 100644 --- a/backend/CLAUDE.md +++ b/backend/CLAUDE.md @@ -156,7 +156,7 @@ FastAPI application on port 8001 with health check at `GET /health`. | **Skills** (`/api/skills`) | `GET /` - list skills; `GET /{name}` - details; `PUT /{name}` - update enabled; `POST /install` - install from .skill archive | | **Memory** (`/api/memory`) | `GET /` - memory data; `POST /reload` - force reload; `GET /config` - config; `GET /status` - config + data | | **Uploads** (`/api/threads/{id}/uploads`) | `POST /` - upload files (auto-converts PDF/PPT/Excel/Word); `GET /list` - list; `DELETE /{filename}` - delete | -| **Artifacts** (`/api/threads/{id}/artifacts`) | `GET /{path}` - serve artifacts; `?download=true` for download with citation removal | +| **Artifacts** (`/api/threads/{id}/artifacts`) | `GET /{path}` - serve artifacts; `?download=true` for file download | Proxied through nginx: `/api/langgraph/*` → LangGraph, all other `/api/*` → Gateway. diff --git a/backend/src/agents/lead_agent/prompt.py b/backend/src/agents/lead_agent/prompt.py index ce175c2..681664d 100644 --- a/backend/src/agents/lead_agent/prompt.py +++ b/backend/src/agents/lead_agent/prompt.py @@ -240,34 +240,8 @@ You have access to skills that provide optimized workflows for specific tasks. E - Action-Oriented: Focus on delivering results, not explaining processes - -After web_search, ALWAYS include citations in your output: - -1. Start with a `` block in JSONL format listing all sources -2. In content, use FULL markdown link format: [Short Title](full_url) - -**CRITICAL - Citation Link Format:** -- CORRECT: `[TechCrunch](https://techcrunch.com/ai-trends)` - full markdown link with URL -- WRONG: `[arXiv:2502.19166]` - missing URL, will NOT render as link -- WRONG: `[Source]` - missing URL, will NOT render as link - -**Rules:** -- Every citation MUST be a complete markdown link with URL: `[Title](https://...)` -- Write content naturally, add citation link at end of sentence/paragraph -- NEVER use bare brackets like `[arXiv:xxx]` or `[Source]` without URL - -**Example:** - -{{"id": "cite-1", "title": "AI Trends 2026", "url": "https://techcrunch.com/ai-trends", "snippet": "Tech industry predictions"}} -{{"id": "cite-2", "title": "OpenAI Research", "url": "https://openai.com/research", "snippet": "Latest AI research developments"}} - -The key AI trends for 2026 include enhanced reasoning capabilities and multimodal integration [TechCrunch](https://techcrunch.com/ai-trends). Recent breakthroughs in language models have also accelerated progress [OpenAI](https://openai.com/research). - - - - **Clarification First**: ALWAYS clarify unclear/missing/ambiguous requirements BEFORE starting work - never assume or guess -- **Web search citations**: When you use web_search (or synthesize subagent results that used it), you MUST output the `` block and [Title](url) links as specified in citations_format so citations display for the user. {subagent_reminder}- Skill First: Always load the relevant skill before starting **complex** tasks. - Progressive Loading: Load resources incrementally as referenced in skills - Output Files: Final deliverables must be in `/mnt/user-data/outputs` @@ -341,7 +315,6 @@ def apply_prompt_template(subagent_enabled: bool = False) -> str: # Add subagent reminder to critical_reminders if enabled subagent_reminder = ( "- **Orchestrator Mode**: You are a task orchestrator - decompose complex tasks into parallel sub-tasks and launch multiple subagents simultaneously. Synthesize results, don't execute directly.\n" - "- **Citations when synthesizing**: When you synthesize subagent results that used web search or cite sources, you MUST include a consolidated `` block (JSONL format) and use [Title](url) markdown links in your response so citations display correctly.\n" if subagent_enabled else "" ) diff --git a/backend/src/gateway/routers/artifacts.py b/backend/src/gateway/routers/artifacts.py index a2a13a7..50918ca 100644 --- a/backend/src/gateway/routers/artifacts.py +++ b/backend/src/gateway/routers/artifacts.py @@ -1,12 +1,10 @@ -import json import mimetypes -import re import zipfile from pathlib import Path from urllib.parse import quote -from fastapi import APIRouter, HTTPException, Request, Response -from fastapi.responses import FileResponse, HTMLResponse, PlainTextResponse +from fastapi import APIRouter, HTTPException, Request +from fastapi.responses import FileResponse, HTMLResponse, PlainTextResponse, Response from src.gateway.path_utils import resolve_thread_virtual_path @@ -24,40 +22,6 @@ def is_text_file_by_content(path: Path, sample_size: int = 8192) -> bool: return False -def _extract_citation_urls(content: str) -> set[str]: - """Extract URLs from JSONL blocks. Format must match frontend core/citations/utils.ts.""" - urls: set[str] = set() - for match in re.finditer(r"([\s\S]*?)", content): - for line in match.group(1).split("\n"): - line = line.strip() - if line.startswith("{"): - try: - obj = json.loads(line) - if "url" in obj: - urls.add(obj["url"]) - except (json.JSONDecodeError, ValueError): - pass - return urls - - -def remove_citations_block(content: str) -> str: - """Remove ALL citations from markdown (blocks, [cite-N], and citation links). Used for downloads.""" - if not content: - return content - - citation_urls = _extract_citation_urls(content) - - result = re.sub(r"[\s\S]*?", "", content) - if "" in result: - result = re.sub(r"[\s\S]*$", "", result) - result = re.sub(r"\[cite-\d+\]", "", result) - - for url in citation_urls: - result = re.sub(rf"\[[^\]]+\]\({re.escape(url)}\)", "", result) - - return re.sub(r"\n{3,}", "\n\n", result).strip() - - def _extract_file_from_skill_archive(zip_path: Path, internal_path: str) -> bytes | None: """Extract a file from a .skill ZIP archive. @@ -172,24 +136,9 @@ async def get_artifact(thread_id: str, path: str, request: Request) -> FileRespo # Encode filename for Content-Disposition header (RFC 5987) encoded_filename = quote(actual_path.name) - - # Check if this is a markdown file that might contain citations - is_markdown = mime_type == "text/markdown" or actual_path.suffix.lower() in [".md", ".markdown"] - + # if `download` query parameter is true, return the file as a download if request.query_params.get("download"): - # For markdown files, remove citations block before download - if is_markdown: - content = actual_path.read_text() - clean_content = remove_citations_block(content) - return Response( - content=clean_content.encode("utf-8"), - media_type="text/markdown", - headers={ - "Content-Disposition": f"attachment; filename*=UTF-8''{encoded_filename}", - "Content-Type": "text/markdown; charset=utf-8" - } - ) return FileResponse(path=actual_path, filename=actual_path.name, media_type=mime_type, headers={"Content-Disposition": f"attachment; filename*=UTF-8''{encoded_filename}"}) if mime_type and mime_type == "text/html": diff --git a/backend/src/subagents/builtins/general_purpose.py b/backend/src/subagents/builtins/general_purpose.py index 0854422..1ab6562 100644 --- a/backend/src/subagents/builtins/general_purpose.py +++ b/backend/src/subagents/builtins/general_purpose.py @@ -24,21 +24,10 @@ Do NOT use for simple, single-step operations.""", - Do NOT ask for clarification - work with the information provided - -If you used web_search (or similar) and cite sources, ALWAYS include citations in your output: -1. Start with a `` block in JSONL format listing all sources (one JSON object per line) -2. In content, use FULL markdown link format: [Short Title](full_url) -- Every citation MUST be a complete markdown link with URL: [Title](https://...) -- Example block: - -{"id": "cite-1", "title": "...", "url": "https://...", "snippet": "..."} - - - When you complete the task, provide: 1. A brief summary of what was accomplished -2. Key findings or results (with citation links when from web search) +2. Key findings or results 3. Any relevant file paths, data, or artifacts created 4. Issues encountered (if any) diff --git a/docs/CODE_CHANGE_SUMMARY_BY_FILE.md b/docs/CODE_CHANGE_SUMMARY_BY_FILE.md new file mode 100644 index 0000000..463dc79 --- /dev/null +++ b/docs/CODE_CHANGE_SUMMARY_BY_FILE.md @@ -0,0 +1,939 @@ +# 代码更改总结(按文件 diff,细到每一行) + +基于 `git diff HEAD` 的完整 diff,按文件列出所有变更。删除/新增文件单独说明。 + +--- + +## 一、后端 + +### 1. `backend/CLAUDE.md` + +```diff +@@ -156,7 +156,7 @@ FastAPI application on port 8001 with health check at `GET /health`. + | **Skills** (`/api/skills`) | `GET /` - list skills; `GET /{name}` - details; `PUT /{name}` - update enabled; `POST /install` - install from .skill archive | + | **Memory** (`/api/memory`) | `GET /` - memory data; `POST /reload` - force reload; `GET /config` - config; `GET /status` - config + data | + | **Uploads** (`/api/threads/{id}/uploads`) | `POST /` - upload files (auto-converts PDF/PPT/Excel/Word); `GET /list` - list; `DELETE /{filename}` - delete | +-| **Artifacts** (`/api/threads/{id}/artifacts`) | `GET /{path}` - serve artifacts; `?download=true` for download with citation removal | ++| **Artifacts** (`/api/threads/{id}/artifacts`) | `GET /{path}` - serve artifacts; `?download=true` for file download | + + Proxied through nginx: `/api/langgraph/*` → LangGraph, all other `/api/*` → Gateway. +``` + +- **第 159 行**:表格中 Artifacts 描述由「download with citation removal」改为「file download」。 + +--- + +### 2. `backend/src/agents/lead_agent/prompt.py` + +```diff +@@ -240,34 +240,8 @@ You have access to skills that provide optimized workflows for specific tasks. E + - Action-Oriented: Focus on delivering results, not explaining processes + + +- +-After web_search, ALWAYS include citations in your output: +- +-1. Start with a `` block in JSONL format listing all sources +-2. In content, use FULL markdown link format: [Short Title](full_url) +- +-**CRITICAL - Citation Link Format:** +-- CORRECT: `[TechCrunch](https://techcrunch.com/ai-trends)` - full markdown link with URL +-- WRONG: `[arXiv:2502.19166]` - missing URL, will NOT render as link +-- WRONG: `[Source]` - missing URL, will NOT render as link +- +-**Rules:** +-- Every citation MUST be a complete markdown link with URL: `[Title](https://...)` +-- Write content naturally, add citation link at end of sentence/paragraph +-- NEVER use bare brackets like `[arXiv:xxx]` or `[Source]` without URL +- +-**Example:** +- +-{{"id": "cite-1", "title": "AI Trends 2026", "url": "https://techcrunch.com/ai-trends", "snippet": "Tech industry predictions"}} +-{{"id": "cite-2", "title": "OpenAI Research", "url": "https://openai.com/research", "snippet": "Latest AI research developments"}} +- +-The key AI trends for 2026 include enhanced reasoning capabilities and multimodal integration [TechCrunch](https://techcrunch.com/ai-trends). Recent breakthroughs in language models have also accelerated progress [OpenAI](https://openai.com/research). +- +- +- + + - **Clarification First**: ALWAYS clarify unclear/missing/ambiguous requirements BEFORE starting work - never assume or guess +-- **Web search citations**: When you use web_search (or synthesize subagent results that used it), you MUST output the `` block and [Title](url) links as specified in citations_format so citations display for the user. + {subagent_reminder}- Skill First: Always load the relevant skill before starting **complex** tasks. +``` + +```diff +@@ -341,7 +315,6 @@ def apply_prompt_template(subagent_enabled: bool = False) -> str: + # Add subagent reminder to critical_reminders if enabled + subagent_reminder = ( + "- **Orchestrator Mode**: You are a task orchestrator - decompose complex tasks into parallel sub-tasks and launch multiple subagents simultaneously. Synthesize results, don't execute directly.\n" +- "- **Citations when synthesizing**: When you synthesize subagent results that used web search or cite sources, you MUST include a consolidated `` block (JSONL format) and use [Title](url) markdown links in your response so citations display correctly.\n" + if subagent_enabled + else "" + ) +``` + +- **删除**:`...` 整段(原约 243–266 行)、critical_reminders 中「Web search citations」一条、`apply_prompt_template` 中「Citations when synthesizing」一行。 + +--- + +### 3. `backend/src/gateway/routers/artifacts.py` + +```diff +@@ -1,12 +1,10 @@ +-import json + import mimetypes +-import re + import zipfile + from pathlib import Path + from urllib.parse import quote + +-from fastapi import APIRouter, HTTPException, Request, Response +-from fastapi.responses import FileResponse, HTMLResponse, PlainTextResponse ++from fastapi import APIRouter, HTTPException, Request ++from fastapi.responses import FileResponse, HTMLResponse, PlainTextResponse, Response + + from src.gateway.path_utils import resolve_thread_virtual_path +``` + +- **第 1 行**:删除 `import json`。 +- **第 3 行**:删除 `import re`。 +- **第 6–7 行**:`fastapi` 中去掉 `Response`;`fastapi.responses` 中增加 `Response`(保留二进制 inline 返回用)。 + +```diff +@@ -24,40 +22,6 @@ def is_text_file_by_content(path: Path, sample_size: int = 8192) -> bool: + return False + + +-def _extract_citation_urls(content: str) -> set[str]: +- """Extract URLs from JSONL blocks. Format must match frontend core/citations/utils.ts.""" +- urls: set[str] = set() +- for match in re.finditer(r"([\s\S]*?)", content): +- for line in match.group(1).split("\n"): +- line = line.strip() +- if line.startswith("{"): +- try: +- obj = json.loads(line) +- if "url" in obj: +- urls.add(obj["url"]) +- except (json.JSONDecodeError, ValueError): +- pass +- return urls +- +- +-def remove_citations_block(content: str) -> str: +- """Remove ALL citations from markdown (blocks, [cite-N], and citation links). Used for downloads.""" +- if not content: +- return content +- +- citation_urls = _extract_citation_urls(content) +- +- result = re.sub(r"[\s\S]*?", "", content) +- if "" in result: +- result = re.sub(r"[\s\S]*$", "", result) +- result = re.sub(r"\[cite-\d+\]", "", result) +- +- for url in citation_urls: +- result = re.sub(rf"\[[^\]]+\]\({re.escape(url)}\)", "", result) +- +- return re.sub(r"\n{3,}", "\n\n", result).strip() +- +- + def _extract_file_from_skill_archive(zip_path: Path, internal_path: str) -> bytes | None: +``` + +- **删除**:`_extract_citation_urls`、`remove_citations_block` 两个函数(约 25–62 行)。 + +```diff +@@ -172,24 +136,9 @@ async def get_artifact(thread_id: str, path: str, request: Request) -> FileRespo + + # Encode filename for Content-Disposition header (RFC 5987) + encoded_filename = quote(actual_path.name) +- +- # Check if this is a markdown file that might contain citations +- is_markdown = mime_type == "text/markdown" or actual_path.suffix.lower() in [".md", ".markdown"] +- ++ + # if `download` query parameter is true, return the file as a download + if request.query_params.get("download"): +- # For markdown files, remove citations block before download +- if is_markdown: +- content = actual_path.read_text() +- clean_content = remove_citations_block(content) +- return Response( +- content=clean_content.encode("utf-8"), +- media_type="text/markdown", +- headers={ +- "Content-Disposition": f"attachment; filename*=UTF-8''{encoded_filename}", +- "Content-Type": "text/markdown; charset=utf-8" +- } +- ) + return FileResponse(path=actual_path, filename=actual_path.name, media_type=mime_type, headers={"Content-Disposition": f"attachment; filename*=UTF-8''{encoded_filename}"}) + + if mime_type and mime_type == "text/html": +``` + +- **删除**:`is_markdown` 判断及「markdown 时读文件 + remove_citations_block + Response」分支;download 时统一走 `FileResponse`。 + +--- + +### 4. `backend/src/subagents/builtins/general_purpose.py` + +```diff +@@ -24,21 +24,10 @@ Do NOT use for simple, single-step operations.""", + - Do NOT ask for clarification - work with the information provided + + +- +-If you used web_search (or similar) and cite sources, ALWAYS include citations in your output: +-1. Start with a `` block in JSONL format listing all sources (one JSON object per line) +-2. In content, use FULL markdown link format: [Short Title](full_url) +-- Every citation MUST be a complete markdown link with URL: [Title](https://...) +-- Example block: +- +-{"id": "cite-1", "title": "...", "url": "https://...", "snippet": "..."} +- +- +- + + When you complete the task, provide: + 1. A brief summary of what was accomplished +-2. Key findings or results (with citation links when from web search) ++2. Key findings or results + 3. Any relevant file paths, data, or artifacts created + 4. Issues encountered (if any) + +``` + +- **删除**:`...` 整段。 +- **第 40 行**:第 2 条由「Key findings or results (with citation links when from web search)」改为「Key findings or results」。 + +--- + +## 二、前端文档与工具 + +### 5. `frontend/AGENTS.md` + +```diff +@@ -49,7 +49,6 @@ src/ + ├── core/ # Core business logic + │ ├── api/ # API client & data fetching + │ ├── artifacts/ # Artifact management +-│ ├── citations/ # Citation handling + │ ├── config/ # App configuration + │ ├── i18n/ # Internationalization +``` + +- **第 52 行**:删除目录树中的 `citations/` 一行。 + +--- + +### 6. `frontend/CLAUDE.md` + +```diff +@@ -30,7 +30,7 @@ Frontend (Next.js) ──▶ LangGraph SDK ──▶ LangGraph Backend (lead_age + └── Tools & Skills + ``` + +-The frontend is a stateful chat application. Users create **threads** (conversations), send messages, and receive streamed AI responses. The backend orchestrates agents that can produce **artifacts** (files/code), **todos**, and **citations**. ++The frontend is a stateful chat application. Users create **threads** (conversations), send messages, and receive streamed AI responses. The backend orchestrates agents that can produce **artifacts** (files/code) and **todos**. + + ### Source Layout (`src/`) +``` + +- **第 33 行**:「and **citations**」删除。 + +--- + +### 7. `frontend/README.md` + +```diff +@@ -89,7 +89,6 @@ src/ + ├── core/ # Core business logic + │ ├── api/ # API client & data fetching + │ ├── artifacts/ # Artifact management +-│ ├── citations/ # Citation handling + │ ├── config/ # App configuration + │ ├── i18n/ # Internationalization +``` + +- **第 92 行**:删除目录树中的 `citations/` 一行。 + +--- + +### 8. `frontend/src/lib/utils.ts` + +```diff +@@ -8,5 +8,5 @@ export function cn(...inputs: ClassValue[]) { + /** Shared class for external links (underline by default). */ + export const externalLinkClass = + "text-primary underline underline-offset-2 hover:no-underline"; +-/** For streaming / loading state when link may be a citation (no underline). */ ++/** Link style without underline by default (e.g. for streaming/loading). */ + export const externalLinkClassNoUnderline = "text-primary hover:underline"; +``` + +- **第 11 行**:仅注释修改,导出值未变。 + +--- + +## 三、前端组件 + +### 9. `frontend/src/components/workspace/artifacts/artifact-file-detail.tsx` + +```diff +@@ -8,7 +8,6 @@ import { + SquareArrowOutUpRightIcon, + XIcon, + } from "lucide-react"; +-import * as React from "react"; + import { useCallback, useEffect, useMemo, useState } from "react"; + ... +@@ -21,7 +20,6 @@ import ( + ArtifactHeader, + ArtifactTitle, + } from "@/components/ai-elements/artifact"; +-import { createCitationMarkdownComponents } from "@/components/ai-elements/inline-citation"; + import { Select, SelectItem } from "@/components/ui/select"; + ... +@@ -33,12 +31,6 @@ import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"; + import { CodeEditor } from "@/components/workspace/code-editor"; + import { useArtifactContent } from "@/core/artifacts/hooks"; + import { urlOfArtifact } from "@/core/artifacts/utils"; +-import type { Citation } from "@/core/citations"; +-import { +- contentWithoutCitationsFromParsed, +- removeAllCitations, +- useParsedCitations, +-} from "@/core/citations"; + import { useI18n } from "@/core/i18n/hooks"; + ... +@@ -48,9 +40,6 @@ import { cn } from "@/lib/utils"; + + import { Tooltip } from "../tooltip"; + +-import { SafeCitationContent } from "../messages/safe-citation-content"; +-import { useThread } from "../messages/context"; +- + import { useArtifacts } from "./context"; +``` + +```diff +@@ -92,22 +81,13 @@ export function ArtifactFileDetail({ + const previewable = useMemo(() => { + return (language === "html" && !isWriteFile) || language === "markdown"; + }, [isWriteFile, language]); +- const { thread } = useThread(); + const { content } = useArtifactContent({ + threadId, + filepath: filepathFromProps, + enabled: isCodeFile && !isWriteFile, + }); + +- const parsed = useParsedCitations( +- language === "markdown" ? (content ?? "") : "", +- ); +- const cleanContent = +- language === "markdown" && content ? parsed.cleanContent : (content ?? ""); +- const contentWithoutCitations = +- language === "markdown" && content +- ? contentWithoutCitationsFromParsed(parsed) +- : (content ?? ""); ++ const displayContent = content ?? ""; + + const [viewMode, setViewMode] = useState<"code" | "preview">("code"); +``` + +```diff +@@ -219,7 +199,7 @@ export function ArtifactFileDetail({ + disabled={!content} + onClick={async () => { + try { +- await navigator.clipboard.writeText(contentWithoutCitations ?? ""); ++ await navigator.clipboard.writeText(displayContent ?? ""); + toast.success(t.clipboard.copiedToClipboard); + ... +@@ -255,27 +235,17 @@ export function ArtifactFileDetail({ + viewMode === "preview" && + language === "markdown" && + content && ( +- ( +- +- )} ++ + )} + {isCodeFile && viewMode === "code" && ( + + )} +``` + +```diff +@@ -295,29 +265,17 @@ export function ArtifactFilePreview({ + threadId, + content, + language, +- cleanContent, +- citationMap, + }: { + filepath: string; + threadId: string; + content: string; + language: string; +- cleanContent: string; +- citationMap: Map; + }) { + if (language === "markdown") { +- const components = createCitationMarkdownComponents({ +- citationMap, +- syntheticExternal: true, +- }); + return ( +
+- +- {cleanContent ?? ""} ++ ++ {content ?? ""} + +
+ ); +``` + +- 删除:React 命名空间、inline-citation、core/citations、SafeCitationContent、useThread;parsed/cleanContent/contentWithoutCitations 及引用解析逻辑。 +- 新增:`displayContent = content ?? ""`;预览与复制、CodeEditor 均使用 `displayContent`;`ArtifactFilePreview` 仅保留 `content`/`language` 等,去掉 `cleanContent`/`citationMap` 与 `createCitationMarkdownComponents`。 + +--- + +### 10. `frontend/src/components/workspace/messages/message-group.tsx` + +```diff +@@ -39,9 +39,7 @@ import { useArtifacts } from "../artifacts"; + import { FlipDisplay } from "../flip-display"; + import { Tooltip } from "../tooltip"; + +-import { useThread } from "./context"; +- +-import { SafeCitationContent } from "./safe-citation-content"; ++import { MarkdownContent } from "./markdown-content"; + + export function MessageGroup({ +``` + +```diff +@@ -120,7 +118,7 @@ export function MessageGroup({ + + ) : ( +- ++ + ), + )} + {lastToolCallStep && ( +@@ -143,7 +136,6 @@ export function MessageGroup({ + {...lastToolCallStep} + isLast={true} + isLoading={isLoading} +- rehypePlugins={rehypePlugins} + /> + + )} +@@ -178,7 +170,7 @@ export function MessageGroup({ + ; + isLast?: boolean; + isLoading?: boolean; +- rehypePlugins: ReturnType; + }) { + const { t } = useI18n(); + const { setOpen, autoOpen, autoSelect, selectedArtifact, select } = + useArtifacts(); +- const { thread } = useThread(); +- const threadIsLoading = thread.isLoading; +- +- const fileContent = typeof args.content === "string" ? args.content : ""; + + if (name === "web_search") { +``` + +```diff +@@ -364,42 +350,27 @@ function ToolCall({ + }, 100); + } + +- const isMarkdown = +- path?.toLowerCase().endsWith(".md") || +- path?.toLowerCase().endsWith(".markdown"); +- + return ( +- <> +- { +- select( +- new URL( +- `write-file:${path}?message_id=${messageId}&tool_call_id=${id}`, +- ).toString(), +- ); +- setOpen(true); +- }} +- > +- {path && ( +- +- {path} +- +- )} +- +- {isMarkdown && ( +- ++ { ++ select( ++ new URL( ++ `write-file:${path}?message_id=${messageId}&tool_call_id=${id}`, ++ ).toString(), ++ ); ++ setOpen(true); ++ }} ++ > ++ {path && ( ++ ++ {path} ++ + )} +- ++ + ); + } else if (name === "bash") { +``` + +- 两处 `SafeCitationContent` → `MarkdownContent`;ToolCall 去掉 `rehypePlugins` 及内部 `useThread`/`fileContent`;write_file 分支去掉 markdown 预览块(`isMarkdown` + `SafeCitationContent`),仅保留 `ChainOfThoughtStep` + path。 + +--- + +### 11. `frontend/src/components/workspace/messages/message-list-item.tsx` + +```diff +@@ -12,7 +12,6 @@ import { + } from "@/components/ai-elements/message"; + import { Badge } from "@/components/ui/badge"; + import { resolveArtifactURL } from "@/core/artifacts/utils"; +-import { removeAllCitations } from "@/core/citations"; + import { + extractContentFromMessage, + extractReasoningContentFromMessage, +@@ -24,7 +23,7 @@ import { humanMessagePlugins } from "@/core/streamdown"; + import { cn } from "@/lib/utils"; + + import { CopyButton } from "../copy-button"; +-import { SafeCitationContent } from "./safe-citation-content"; ++import { MarkdownContent } from "./markdown-content"; + ... +@@ -54,11 +53,11 @@ export function MessageListItem({ + > +
+ +
+ +@@ -154,7 +153,7 @@ function MessageContent_({ + return ( + + {filesList} +- + {group.messages[0] && hasContent(group.messages[0]) && ( +- & { threadId?: string; maxWidth?: string }) => ReactNode; +}; + +/** Renders markdown content. */ +export function MarkdownContent({ + content, + rehypePlugins, + className, + remarkPlugins = streamdownPlugins.remarkPlugins, + img, +}: MarkdownContentProps) { + if (!content) return null; + const components = img ? { img } : undefined; + return ( + + {content} + + ); +} +``` + +- 纯 Markdown 渲染组件,无引用解析或 loading 占位逻辑。 + +--- + +### 15. 删除 `frontend/src/components/workspace/messages/safe-citation-content.tsx` + +- 原约 85 行;提供引用解析、loading、renderBody/loadingOnly、cleanContent/citationMap。已由 `MarkdownContent` 替代,整文件删除。 + +--- + +### 16. 删除 `frontend/src/components/ai-elements/inline-citation.tsx` + +- 原约 289 行;提供 `createCitationMarkdownComponents` 等,用于将 `[cite-N]`/URL 渲染为可点击引用。仅被 artifact 预览使用,已移除后整文件删除。 + +--- + +## 四、前端 core + +### 17. 删除 `frontend/src/core/citations/index.ts` + +- 原 13 行,导出:`contentWithoutCitationsFromParsed`、`extractDomainFromUrl`、`isExternalUrl`、`parseCitations`、`removeAllCitations`、`shouldShowCitationLoading`、`syntheticCitationFromLink`、`useParsedCitations`、类型 `Citation`/`ParseCitationsResult`/`UseParsedCitationsResult`。整文件删除。 + +--- + +### 18. 删除 `frontend/src/core/citations/use-parsed-citations.ts` + +- 原 28 行,`useParsedCitations(content)` 与 `UseParsedCitationsResult`。整文件删除。 + +--- + +### 19. 删除 `frontend/src/core/citations/utils.ts` + +- 原 226 行,解析 ``/`[cite-N]`、buildCitationMap、removeAllCitations、contentWithoutCitationsFromParsed 等。整文件删除。 + +--- + +### 20. `frontend/src/core/i18n/locales/types.ts` + +```diff +@@ -115,12 +115,6 @@ export interface Translations { + startConversation: string; + }; + +- // Citations +- citations: { +- loadingCitations: string; +- loadingCitationsWithCount: (count: number) => string; +- }; +- + // Chats + chats: { +``` + +- 删除 `Translations.citations` 及其两个字段。 + +--- + +### 21. `frontend/src/core/i18n/locales/zh-CN.ts` + +```diff +@@ -164,12 +164,6 @@ export const zhCN: Translations = { + startConversation: "开始新的对话以查看消息", + }, + +- // Citations +- citations: { +- loadingCitations: "正在整理引用...", +- loadingCitationsWithCount: (count: number) => `正在整理 ${count} 个引用...`, +- }, +- + // Chats + chats: { +``` + +- 删除 `citations` 命名空间。 + +--- + +### 22. `frontend/src/core/i18n/locales/en-US.ts` + +```diff +@@ -167,13 +167,6 @@ export const enUS: Translations = { + startConversation: "Start a conversation to see messages here", + }, + +- // Citations +- citations: { +- loadingCitations: "Organizing citations...", +- loadingCitationsWithCount: (count: number) => +- `Organizing ${count} citation${count === 1 ? "" : "s"}...`, +- }, +- + // Chats + chats: { +``` + +- 删除 `citations` 命名空间。 + +--- + +## 五、技能与 Demo + +### 23. `skills/public/github-deep-research/SKILL.md` + +```diff +@@ -147,5 +147,5 @@ Save report as: `research_{topic}_{YYYYMMDD}.md` + 3. **Triangulate claims** - 2+ independent sources + 4. **Note conflicting info** - Don't hide contradictions + 5. **Distinguish fact vs opinion** - Label speculation clearly +-6. **Cite inline** - Reference sources near claims ++6. **Reference sources** - Add source references near claims where applicable + 7. **Update as you go** - Don't wait until end to synthesize +``` + +- 第 150 行:一条措辞修改。 + +--- + +### 24. `skills/public/market-analysis/SKILL.md` + +```diff +@@ -15,7 +15,7 @@ This skill generates professional, consulting-grade market analysis reports in M + - Follow the **"Visual Anchor → Data Contrast → Integrated Analysis"** flow per sub-chapter + - Produce insights following the **"Data → User Psychology → Strategy Implication"** chain + - Embed pre-generated charts and construct comparison tables +-- Generate inline citations formatted per **GB/T 7714-2015** standards ++- Include references formatted per **GB/T 7714-2015** where applicable + - Output reports entirely in Chinese with professional consulting tone + ... +@@ -36,7 +36,7 @@ The skill expects the following inputs from the upstream agentic workflow: + | **Analysis Framework Outline** | Defines the logic flow and general topics for the report | Yes | + | **Data Summary** | The source of truth containing raw numbers and metrics | Yes | + | **Chart Files** | Local file paths for pre-generated chart images | Yes | +-| **External Search Findings** | URLs and summaries for inline citations | Optional | ++| **External Search Findings** | URLs and summaries for inline references | Optional | + ... +@@ -87,7 +87,7 @@ The report **MUST NOT** stop after the Conclusion — it **MUST** include Refere + - **Tone**: McKinsey/BCG — Authoritative, Objective, Professional + - **Language**: All headings and content strictly in **Chinese** + - **Number Formatting**: Use English commas for thousands separators (`1,000` not `1,000`) +-- **Data Citation**: **Bold** important viewpoints and key numbers ++- **Data emphasis**: **Bold** important viewpoints and key numbers + ... +@@ -109,11 +109,9 @@ Every insight must connect **Data → User Psychology → Strategy Implication** + treating male audiences only as a secondary gift-giving segment." + ``` + +-### Citations & References +-- **Inline**: Use `[\[Index\]](URL)` format (e.g., `[\[1\]](https://example.com)`) +-- **Placement**: Append citations at the end of sentences using information from External Search Findings +-- **Index Assignment**: Sequential starting from **1** based on order of appearance +-- **References Section**: Formatted strictly per **GB/T 7714-2015** ++### References ++- **Inline**: Use markdown links for sources (e.g. `[Source Title](URL)`) when using External Search Findings ++- **References section**: Formatted strictly per **GB/T 7714-2015** + ... +@@ -183,7 +181,7 @@ Before considering the report complete, verify: + - [ ] All headings are in Chinese with proper numbering (no "Chapter/Part/Section") + - [ ] Charts are embedded with `![Description](path)` syntax + - [ ] Numbers use English commas for thousands separators +-- [ ] Inline citations use `[\[N\]](URL)` format ++- [ ] Inline references use markdown links where applicable + - [ ] References section follows GB/T 7714-2015 +``` + +- 多处:核心能力、输入表、Data Citation、Citations & References 小节与检查项,改为「references / 引用」表述并去掉 `[\[N\]](URL)` 格式要求。 + +--- + +### 25. `frontend/public/demo/threads/.../user-data/outputs/research_deerflow_20260201.md` + +```diff +@@ -1,12 +1,3 @@ +- +-{"id": "cite-1", "title": "DeerFlow GitHub Repository", "url": "https://github.com/bytedance/deer-flow", "snippet": "..."} +-...(共 7 条 JSONL) +- + # DeerFlow Deep Research Report + + - **Research Date:** 2026-02-01 +``` + +- 删除文件开头的 `...` 整块(9 行),正文从 `# DeerFlow Deep Research Report` 开始。 + +--- + +### 26. `frontend/public/demo/threads/.../thread.json` + +- **主要变更**:某条 `write_file` 的 `args.content` 中,将原来的「`...\n\n# DeerFlow Deep Research Report\n\n...`」改为「`# DeerFlow Deep Research Report\n\n...`」,即去掉 `...` 块,保留其后全文。 +- **其他**:一处 `present_files` 的 `filepaths` 由单行数组改为多行格式;文件末尾增加/统一换行。 +- 消息顺序、结构及其他字段未改。 + +--- + +## 六、统计 + +| 项目 | 数量 | +|------|------| +| 修改文件 | 18 | +| 新增文件 | 1(markdown-content.tsx) | +| 删除文件 | 5(safe-citation-content.tsx, inline-citation.tsx, core/citations/* 共 3 个) | +| 总行数变化 | +62 / -894(diff stat) | + +以上为按文件、细到每一行 diff 的代码更改总结。 diff --git a/frontend/AGENTS.md b/frontend/AGENTS.md index ed6d448..618d215 100644 --- a/frontend/AGENTS.md +++ b/frontend/AGENTS.md @@ -49,7 +49,6 @@ src/ ├── core/ # Core business logic │ ├── api/ # API client & data fetching │ ├── artifacts/ # Artifact management -│ ├── citations/ # Citation handling │ ├── config/ # App configuration │ ├── i18n/ # Internationalization │ ├── mcp/ # MCP integration diff --git a/frontend/CLAUDE.md b/frontend/CLAUDE.md index 9057ad2..4943cdf 100644 --- a/frontend/CLAUDE.md +++ b/frontend/CLAUDE.md @@ -30,7 +30,7 @@ Frontend (Next.js) ──▶ LangGraph SDK ──▶ LangGraph Backend (lead_age └── Tools & Skills ``` -The frontend is a stateful chat application. Users create **threads** (conversations), send messages, and receive streamed AI responses. The backend orchestrates agents that can produce **artifacts** (files/code), **todos**, and **citations**. +The frontend is a stateful chat application. Users create **threads** (conversations), send messages, and receive streamed AI responses. The backend orchestrates agents that can produce **artifacts** (files/code) and **todos**. ### Source Layout (`src/`) diff --git a/frontend/README.md b/frontend/README.md index 07620c3..77a890e 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -89,7 +89,6 @@ src/ ├── core/ # Core business logic │ ├── api/ # API client & data fetching │ ├── artifacts/ # Artifact management -│ ├── citations/ # Citation handling │ ├── config/ # App configuration │ ├── i18n/ # Internationalization │ ├── mcp/ # MCP integration diff --git a/frontend/public/demo/threads/fe3f7974-1bcb-4a01-a950-79673baafefd/thread.json b/frontend/public/demo/threads/fe3f7974-1bcb-4a01-a950-79673baafefd/thread.json index 12b0ac2..897d70f 100644 --- a/frontend/public/demo/threads/fe3f7974-1bcb-4a01-a950-79673baafefd/thread.json +++ b/frontend/public/demo/threads/fe3f7974-1bcb-4a01-a950-79673baafefd/thread.json @@ -1403,7 +1403,7 @@ "args": { "description": "Create comprehensive research report on DeerFlow", "path": "/mnt/user-data/workspace/research_deerflow_20260201.md", - "content": "\n{\"id\": \"cite-1\", \"title\": \"DeerFlow GitHub Repository\", \"url\": \"https://github.com/bytedance/deer-flow\", \"snippet\": \"Community-driven Deep Research framework combining language models with tools like web search, crawling, and Python execution\"}\n{\"id\": \"cite-2\", \"title\": \"Create Your Own Deep Research Agent with DeerFlow\", \"url\": \"https://thesequence.substack.com/p/the-sequence-engineering-661-create\", \"snippet\": \"Open-source multi-agent research automation framework developed by ByteDance\"}\n{\"id\": \"cite-3\", \"title\": \"DeerFlow: A Game-Changer for Automated Research and Content Creation\", \"url\": \"https://medium.com/@mingyang.heaven/deerflow-a-game-changer-for-automated-research-and-content-creation-83612f683e7a\", \"snippet\": \"Open-source multi-agent framework revolutionizing research and content creation\"}\n{\"id\": \"cite-4\", \"title\": \"ByteDance DeerFlow - (Deep Research Agents with a LOCAL LLM!)\", \"url\": \"https://www.youtube.com/watch?v=Ui0ovCVDYGs\", \"snippet\": \"Video demonstration of DeerFlow capabilities and local LLM integration\"}\n{\"id\": \"cite-5\", \"title\": \"DeerFlow Official Website\", \"url\": \"https://deerflow.tech/\", \"snippet\": \"Official platform showcasing DeerFlow features, case studies, and architecture\"}\n{\"id\": \"cite-6\", \"title\": \"Navigating the Landscape of Deep Research Frameworks\", \"url\": \"https://www.oreateai.com/blog/navigating-the-landscape-of-deep-research-frameworks-a-comprehensive-comparison/0dc13e48eb8c756650112842c8d1a184\", \"snippet\": \"Comparative analysis of deep research frameworks including DeerFlow\"}\n{\"id\": \"cite-7\", \"title\": \"DeerFlow: Multi-Agent AI For Research Automation 2025\", \"url\": \"https://firexcore.com/blog/what-is-deerflow/\", \"snippet\": \"Overview of DeerFlow features and capabilities for research automation\"}\n\n# DeerFlow Deep Research Report\n\n- **Research Date:** 2026-02-01\n- **Timestamp:** 2026-02-01, Sunday\n- **Confidence Level:** High (90%+)\n- **Subject:** ByteDance's Open-Source Multi-Agent Deep Research Framework\n\n---\n\n## Repository Information\n\n- **Name:** bytedance/deer-flow\n- **Description:** DeerFlow is a community-driven Deep Research framework, combining language models with tools like web search, crawling, and Python execution, while contributing back to the open-source community [DeerFlow GitHub Repository](https://github.com/bytedance/deer-flow)\n- **URL:** https://github.com/bytedance/deer-flow\n- **Stars:** 19,531\n- **Forks:** 2,452\n- **Open Issues:** 196\n- **Language(s):** Python (1,292,574 bytes), TypeScript (503,143 bytes), CSS (15,128 bytes), JavaScript (7,906 bytes), Dockerfile (2,197 bytes), Makefile (1,352 bytes), Shell (1,152 bytes), Batchfile (497 bytes)\n- **License:** MIT\n- **Created At:** 2025-05-07T02:50:19Z\n- **Updated At:** 2026-02-01T01:07:38Z\n- **Pushed At:** 2026-01-30T00:47:23Z\n- **Topics:** agent, agentic, agentic-framework, agentic-workflow, ai, ai-agents, bytedance, deep-research, langchain, langgraph, langmanus, llm, multi-agent, nodejs, podcast, python, typescript\n\n---\n\n## Executive Summary\n\nDeerFlow (Deep Exploration and Efficient Research Flow) is an open-source multi-agent research automation framework developed by ByteDance and released under the MIT license in May 2025 [Create Your Own Deep Research Agent with DeerFlow](https://thesequence.substack.com/p/the-sequence-engineering-661-create). The framework implements a graph-based orchestration of specialized agents that automate research pipelines end-to-end, combining language models with tools like web search engines, crawlers, and Python execution. With 19,531 stars and 2,452 forks on GitHub, DeerFlow has established itself as a significant player in the deep research automation space, offering both console and web UI options with support for local LLM deployment and extensive tool integrations [DeerFlow: A Game-Changer for Automated Research and Content Creation](https://medium.com/@mingyang.heaven/deerflow-a-game-changer-for-automated-research-and-content-creation-83612f683e7a).\n\n---\n\n## Complete Chronological Timeline\n\n### PHASE 1: Project Inception and Initial Development\n\n#### May 2025 - July 2025\n\nDeerFlow was created by ByteDance and open-sourced on May 7, 2025, with the initial commit establishing the core multi-agent architecture built on LangGraph and LangChain frameworks [DeerFlow GitHub Repository](https://github.com/bytedance/deer-flow). The project quickly gained traction in the AI community due to its comprehensive approach to research automation, combining web search, crawling, and code execution capabilities. Early development focused on establishing the modular agent system with specialized roles including Coordinator, Planner, Researcher, Coder, and Reporter components.\n\n### PHASE 2: Feature Expansion and Community Growth\n\n#### August 2025 - December 2025\n\nDuring this period, DeerFlow underwent significant feature expansion including MCP (Model Context Protocol) integration, text-to-speech capabilities, podcast generation, and support for multiple search engines (Tavily, InfoQuest, Brave Search, DuckDuckGo, Arxiv) [DeerFlow: Multi-Agent AI For Research Automation 2025](https://firexcore.com/blog/what-is-deerflow/). The framework gained attention for its human-in-the-loop collaboration features, allowing users to review and edit research plans before execution. Community contributions grew substantially, with 88 contributors participating in the project by early 2026, and the framework was integrated into the FaaS Application Center of Volcengine for cloud deployment.\n\n### PHASE 3: Maturity and DeerFlow 2.0 Transition\n\n#### January 2026 - Present\n\nAs of February 2026, DeerFlow has entered a transition phase to DeerFlow 2.0, with active development continuing on the main branch [DeerFlow Official Website](https://deerflow.tech/). Recent commits show ongoing improvements to JSON repair handling, MCP tool integration, and fallback report generation mechanisms. The framework now supports private knowledgebases including RAGFlow, Qdrant, Milvus, and VikingDB, along with Docker and Docker Compose deployment options for production environments.\n\n---\n\n## Key Analysis\n\n### Technical Architecture and Design Philosophy\n\nDeerFlow implements a modular multi-agent system architecture designed for automated research and code analysis [DeerFlow: A Game-Changer for Automated Research and Content Creation](https://medium.com/@mingyang.heaven/deerflow-a-game-changer-for-automated-research-and-content-creation-83612f683e7a). The system is built on LangGraph, enabling a flexible state-based workflow where components communicate through a well-defined message passing system. The architecture employs a streamlined workflow with specialized agents:\n\n```mermaid\nflowchart TD\n A[Coordinator] --> B[Planner]\n B --> C{Enough Context?}\n C -->|No| D[Research Team]\n D --> E[Researcher
Web Search & Crawling]\n D --> F[Coder
Python Execution]\n E --> C\n F --> C\n C -->|Yes| G[Reporter]\n G --> H[Final Report]\n```\n\nThe Coordinator serves as the entry point managing workflow lifecycle, initiating research processes based on user input and delegating tasks to the Planner when appropriate. The Planner analyzes research objectives and creates structured execution plans, determining if sufficient context is available or if more research is needed. The Research Team consists of specialized agents including a Researcher for web searches and information gathering, and a Coder for handling technical tasks using Python REPL tools. Finally, the Reporter aggregates findings and generates comprehensive research reports [Create Your Own Deep Research Agent with DeerFlow](https://thesequence.substack.com/p/the-sequence-engineering-661-create).\n\n### Core Features and Capabilities\n\nDeerFlow offers extensive capabilities for deep research automation:\n\n1. **Multi-Engine Search Integration**: Supports Tavily (default), InfoQuest (BytePlus's AI-optimized search), Brave Search, DuckDuckGo, and Arxiv for scientific papers [DeerFlow: Multi-Agent AI For Research Automation 2025](https://firexcore.com/blog/what-is-deerflow/).\n\n2. **Advanced Crawling Tools**: Includes Jina (default) and InfoQuest crawlers with configurable parameters, timeout settings, and powerful content extraction capabilities.\n\n3. **MCP (Model Context Protocol) Integration**: Enables seamless integration with diverse research tools and methodologies for private domain access, knowledge graphs, and web browsing.\n\n4. **Private Knowledgebase Support**: Integrates with RAGFlow, Qdrant, Milvus, VikingDB, MOI, and Dify for research on users' private documents.\n\n5. **Human-in-the-Loop Collaboration**: Features intelligent clarification mechanisms, plan review and editing capabilities, and auto-acceptance options for streamlined workflows.\n\n6. **Content Creation Tools**: Includes podcast generation with text-to-speech synthesis, PowerPoint presentation creation, and Notion-style block editing for report refinement.\n\n7. **Multi-Language Support**: Provides README documentation in English, Simplified Chinese, Japanese, German, Spanish, Russian, and Portuguese.\n\n### Development and Community Ecosystem\n\nThe project demonstrates strong community engagement with 88 contributors and 19,531 GitHub stars as of February 2026 [DeerFlow GitHub Repository](https://github.com/bytedance/deer-flow). Key contributors include Henry Li (203 contributions), Willem Jiang (130 contributions), and Daniel Walnut (25 contributions), representing a mix of ByteDance employees and open-source community members. The framework maintains comprehensive documentation including configuration guides, API documentation, FAQ sections, and multiple example research reports covering topics from quantum computing to AI adoption in healthcare.\n\n---\n\n## Metrics & Impact Analysis\n\n### Growth Trajectory\n\n```\nTimeline: May 2025 - February 2026\nStars: 0 → 19,531 (exponential growth)\nForks: 0 → 2,452 (strong community adoption)\nContributors: 0 → 88 (active development ecosystem)\nOpen Issues: 196 (ongoing maintenance and feature development)\n```\n\n### Key Metrics\n\n| Metric | Value | Assessment |\n|--------|-------|------------|\n| GitHub Stars | 19,531 | Exceptional popularity for research framework |\n| Forks | 2,452 | Strong community adoption and potential derivatives |\n| Contributors | 88 | Healthy open-source development ecosystem |\n| Open Issues | 196 | Active maintenance and feature development |\n| Primary Language | Python (1.29MB) | Main development language with extensive libraries |\n| Secondary Language | TypeScript (503KB) | Modern web UI implementation |\n| Repository Age | ~9 months | Rapid development and feature expansion |\n| License | MIT | Permissive open-source licensing |\n\n---\n\n## Comparative Analysis\n\n### Feature Comparison\n\n| Feature | DeerFlow | OpenAI Deep Research | LangChain OpenDeepResearch |\n|---------|-----------|----------------------|----------------------------|\n| Multi-Agent Architecture | ✅ | ❌ | ✅ |\n| Local LLM Support | ✅ | ❌ | ✅ |\n| MCP Integration | ✅ | ❌ | ❌ |\n| Web Search Engines | Multiple (5+) | Limited | Limited |\n| Code Execution | ✅ Python REPL | Limited | ✅ |\n| Podcast Generation | ✅ | ❌ | ❌ |\n| Presentation Creation | ✅ | ❌ | ❌ |\n| Private Knowledgebase | ✅ (6+ options) | Limited | Limited |\n| Human-in-the-Loop | ✅ | Limited | ✅ |\n| Open Source | ✅ MIT | ❌ | ✅ Apache 2.0 |\n\n### Market Positioning\n\nDeerFlow occupies a unique position in the deep research framework landscape by combining enterprise-grade multi-agent orchestration with extensive tool integrations and open-source accessibility [Navigating the Landscape of Deep Research Frameworks](https://www.oreateai.com/blog/navigating-the-landscape-of-deep-research-frameworks-a-comprehensive-comparison/0dc13e48eb8c756650112842c8d1a184]. While proprietary solutions like OpenAI's Deep Research offer polished user experiences, DeerFlow provides greater flexibility through local deployment options, custom tool integration, and community-driven development. The framework particularly excels in scenarios requiring specialized research workflows, integration with private data sources, or deployment in regulated environments where cloud-based solutions may not be feasible.\n\n---\n\n## Strengths & Weaknesses\n\n### Strengths\n\n1. **Comprehensive Multi-Agent Architecture**: DeerFlow's sophisticated agent orchestration enables complex research workflows beyond single-agent systems [Create Your Own Deep Research Agent with DeerFlow](https://thesequence.substack.com/p/the-sequence-engineering-661-create).\n\n2. **Extensive Tool Integration**: Support for multiple search engines, crawling tools, MCP services, and private knowledgebases provides unmatched flexibility.\n\n3. **Local Deployment Capabilities**: Unlike many proprietary solutions, DeerFlow supports local LLM deployment, offering privacy, cost control, and customization options.\n\n4. **Human Collaboration Features**: Intelligent clarification mechanisms and plan editing capabilities bridge the gap between automated research and human oversight.\n\n5. **Active Community Development**: With 88 contributors and regular updates, the project benefits from diverse perspectives and rapid feature evolution.\n\n6. **Production-Ready Deployment**: Docker support, cloud integration (Volcengine), and comprehensive documentation facilitate enterprise adoption.\n\n### Areas for Improvement\n\n1. **Learning Curve**: The extensive feature set and configuration options may present challenges for new users compared to simpler single-purpose tools.\n\n2. **Resource Requirements**: Local deployment with multiple agents and tools may demand significant computational resources.\n\n3. **Documentation Complexity**: While comprehensive, the documentation spans multiple languages and may benefit from more streamlined onboarding guides.\n\n4. **Integration Complexity**: Advanced features like MCP integration and custom tool development require technical expertise beyond basic usage.\n\n5. **Version Transition**: The ongoing move to DeerFlow 2.0 may create temporary instability or compatibility concerns for existing deployments.\n\n---\n\n## Key Success Factors\n\n1. **ByteDance Backing**: Corporate sponsorship provides resources, expertise, and credibility while maintaining open-source accessibility [DeerFlow: A Game-Changer for Automated Research and Content Creation](https://medium.com/@mingyang.heaven/deerflow-a-game-changer-for-automated-research-and-content-creation-83612f683e7a).\n\n2. **Modern Technical Foundation**: Built on LangGraph and LangChain, DeerFlow leverages established frameworks while adding significant value through multi-agent orchestration.\n\n3. **Community-Driven Development**: Active contributor community ensures diverse use cases, rapid bug fixes, and feature evolution aligned with real-world needs.\n\n4. **Comprehensive Feature Set**: Unlike narrowly focused tools, DeerFlow addresses the complete research workflow from information gathering to content creation.\n\n5. **Production Deployment Options**: Cloud integration, Docker support, and enterprise features facilitate adoption beyond experimental use cases.\n\n6. **Multi-Language Accessibility**: Documentation and interface support for multiple languages expands global reach and adoption potential.\n\n---\n\n## Sources\n\n### Primary Sources\n\n1. **DeerFlow GitHub Repository**: Official source code, documentation, and development history [DeerFlow GitHub Repository](https://github.com/bytedance/deer-flow)\n2. **DeerFlow Official Website**: Platform showcasing features, case studies, and deployment options [DeerFlow Official Website](https://deerflow.tech/)\n3. **GitHub API Data**: Repository metrics, contributor statistics, and commit history\n\n### Media Coverage\n\n1. **The Sequence Engineering**: Technical analysis of DeerFlow architecture and capabilities [Create Your Own Deep Research Agent with DeerFlow](https://thesequence.substack.com/p/the-sequence-engineering-661-create)\n2. **Medium Articles**: Community perspectives on DeerFlow implementation and use cases [DeerFlow: A Game-Changer for Automated Research and Content Creation](https://medium.com/@mingyang.heaven/deerflow-a-game-changer-for-automated-research-and-content-creation-83612f683e7a)\n3. **YouTube Demonstrations**: Video walkthroughs of DeerFlow functionality and local deployment [ByteDance DeerFlow - (Deep Research Agents with a LOCAL LLM!)](https://www.youtube.com/watch?v=Ui0ovCVDYGs)\n\n### Technical Sources\n\n1. **FireXCore Analysis**: Feature overview and technical assessment [DeerFlow: Multi-Agent AI For Research Automation 2025](https://firexcore.com/blog/what-is-deerflow/)\n2. **Oreate AI Comparison**: Framework benchmarking and market positioning analysis [Navigating the Landscape of Deep Research Frameworks](https://www.oreateai.com/blog/navigating-the-landscape-of-deep-research-frameworks-a-comprehensive-comparison/0dc13e48eb8c756650112842c8d1a184)\n\n---\n\n## Confidence Assessment\n\n**High Confidence (90%+) Claims:**\n- DeerFlow was created by ByteDance and open-sourced under MIT license in May 2025\n- The framework implements multi-agent architecture using LangGraph and LangChain\n- Current GitHub metrics: 19,531 stars, 2,452 forks, 88 contributors, 196 open issues\n- Supports multiple search engines including Tavily, InfoQuest, Brave Search\n- Includes features for podcast generation, presentation creation, and human collaboration\n\n**Medium Confidence (70-89%) Claims:**\n- Specific performance benchmarks compared to proprietary alternatives\n- Detailed breakdown of enterprise adoption rates and use cases\n- Exact resource requirements for various deployment scenarios\n\n**Lower Confidence (50-69%) Claims:**\n- Future development roadmap beyond DeerFlow 2.0 transition\n- Specific enterprise customer implementations and case studies\n- Detailed comparison with emerging competitors not yet widely documented\n\n---\n\n## Research Methodology\n\nThis report was compiled using:\n\n1. **Multi-source web search** - Broad discovery and targeted queries across technical publications, media coverage, and community discussions\n2. **GitHub repository analysis** - Direct API queries for commits, issues, PRs, contributor activity, and repository metrics\n3. **Content extraction** - Official documentation, technical articles, video demonstrations, and community resources\n4. **Cross-referencing** - Verification across independent sources including technical analysis, media coverage, and community feedback\n5. **Chronological reconstruction** - Timeline development from timestamped commit history and release documentation\n6. **Confidence scoring** - Claims weighted by source reliability, corroboration across multiple sources, and recency of information\n\n**Research Depth:** Comprehensive technical and market analysis\n**Time Scope:** May 2025 - February 2026 (9-month development period)\n**Geographic Scope:** Global open-source community with ByteDance corporate backing\n\n---\n\n**Report Prepared By:** Github Deep Research by DeerFlow\n**Date:** 2026-02-01\n**Report Version:** 1.0\n**Status:** Complete" + "content": "# DeerFlow Deep Research Report\n\n- **Research Date:** 2026-02-01\n- **Timestamp:** 2026-02-01, Sunday\n- **Confidence Level:** High (90%+)\n- **Subject:** ByteDance's Open-Source Multi-Agent Deep Research Framework\n\n---\n\n## Repository Information\n\n- **Name:** bytedance/deer-flow\n- **Description:** DeerFlow is a community-driven Deep Research framework, combining language models with tools like web search, crawling, and Python execution, while contributing back to the open-source community [DeerFlow GitHub Repository](https://github.com/bytedance/deer-flow)\n- **URL:** https://github.com/bytedance/deer-flow\n- **Stars:** 19,531\n- **Forks:** 2,452\n- **Open Issues:** 196\n- **Language(s):** Python (1,292,574 bytes), TypeScript (503,143 bytes), CSS (15,128 bytes), JavaScript (7,906 bytes), Dockerfile (2,197 bytes), Makefile (1,352 bytes), Shell (1,152 bytes), Batchfile (497 bytes)\n- **License:** MIT\n- **Created At:** 2025-05-07T02:50:19Z\n- **Updated At:** 2026-02-01T01:07:38Z\n- **Pushed At:** 2026-01-30T00:47:23Z\n- **Topics:** agent, agentic, agentic-framework, agentic-workflow, ai, ai-agents, bytedance, deep-research, langchain, langgraph, langmanus, llm, multi-agent, nodejs, podcast, python, typescript\n\n---\n\n## Executive Summary\n\nDeerFlow (Deep Exploration and Efficient Research Flow) is an open-source multi-agent research automation framework developed by ByteDance and released under the MIT license in May 2025 [Create Your Own Deep Research Agent with DeerFlow](https://thesequence.substack.com/p/the-sequence-engineering-661-create). The framework implements a graph-based orchestration of specialized agents that automate research pipelines end-to-end, combining language models with tools like web search engines, crawlers, and Python execution. With 19,531 stars and 2,452 forks on GitHub, DeerFlow has established itself as a significant player in the deep research automation space, offering both console and web UI options with support for local LLM deployment and extensive tool integrations [DeerFlow: A Game-Changer for Automated Research and Content Creation](https://medium.com/@mingyang.heaven/deerflow-a-game-changer-for-automated-research-and-content-creation-83612f683e7a).\n\n---\n\n## Complete Chronological Timeline\n\n### PHASE 1: Project Inception and Initial Development\n\n#### May 2025 - July 2025\n\nDeerFlow was created by ByteDance and open-sourced on May 7, 2025, with the initial commit establishing the core multi-agent architecture built on LangGraph and LangChain frameworks [DeerFlow GitHub Repository](https://github.com/bytedance/deer-flow). The project quickly gained traction in the AI community due to its comprehensive approach to research automation, combining web search, crawling, and code execution capabilities. Early development focused on establishing the modular agent system with specialized roles including Coordinator, Planner, Researcher, Coder, and Reporter components.\n\n### PHASE 2: Feature Expansion and Community Growth\n\n#### August 2025 - December 2025\n\nDuring this period, DeerFlow underwent significant feature expansion including MCP (Model Context Protocol) integration, text-to-speech capabilities, podcast generation, and support for multiple search engines (Tavily, InfoQuest, Brave Search, DuckDuckGo, Arxiv) [DeerFlow: Multi-Agent AI For Research Automation 2025](https://firexcore.com/blog/what-is-deerflow/). The framework gained attention for its human-in-the-loop collaboration features, allowing users to review and edit research plans before execution. Community contributions grew substantially, with 88 contributors participating in the project by early 2026, and the framework was integrated into the FaaS Application Center of Volcengine for cloud deployment.\n\n### PHASE 3: Maturity and DeerFlow 2.0 Transition\n\n#### January 2026 - Present\n\nAs of February 2026, DeerFlow has entered a transition phase to DeerFlow 2.0, with active development continuing on the main branch [DeerFlow Official Website](https://deerflow.tech/). Recent commits show ongoing improvements to JSON repair handling, MCP tool integration, and fallback report generation mechanisms. The framework now supports private knowledgebases including RAGFlow, Qdrant, Milvus, and VikingDB, along with Docker and Docker Compose deployment options for production environments.\n\n---\n\n## Key Analysis\n\n### Technical Architecture and Design Philosophy\n\nDeerFlow implements a modular multi-agent system architecture designed for automated research and code analysis [DeerFlow: A Game-Changer for Automated Research and Content Creation](https://medium.com/@mingyang.heaven/deerflow-a-game-changer-for-automated-research-and-content-creation-83612f683e7a). The system is built on LangGraph, enabling a flexible state-based workflow where components communicate through a well-defined message passing system. The architecture employs a streamlined workflow with specialized agents:\n\n```mermaid\nflowchart TD\n A[Coordinator] --> B[Planner]\n B --> C{Enough Context?}\n C -->|No| D[Research Team]\n D --> E[Researcher
Web Search & Crawling]\n D --> F[Coder
Python Execution]\n E --> C\n F --> C\n C -->|Yes| G[Reporter]\n G --> H[Final Report]\n```\n\nThe Coordinator serves as the entry point managing workflow lifecycle, initiating research processes based on user input and delegating tasks to the Planner when appropriate. The Planner analyzes research objectives and creates structured execution plans, determining if sufficient context is available or if more research is needed. The Research Team consists of specialized agents including a Researcher for web searches and information gathering, and a Coder for handling technical tasks using Python REPL tools. Finally, the Reporter aggregates findings and generates comprehensive research reports [Create Your Own Deep Research Agent with DeerFlow](https://thesequence.substack.com/p/the-sequence-engineering-661-create).\n\n### Core Features and Capabilities\n\nDeerFlow offers extensive capabilities for deep research automation:\n\n1. **Multi-Engine Search Integration**: Supports Tavily (default), InfoQuest (BytePlus's AI-optimized search), Brave Search, DuckDuckGo, and Arxiv for scientific papers [DeerFlow: Multi-Agent AI For Research Automation 2025](https://firexcore.com/blog/what-is-deerflow/).\n\n2. **Advanced Crawling Tools**: Includes Jina (default) and InfoQuest crawlers with configurable parameters, timeout settings, and powerful content extraction capabilities.\n\n3. **MCP (Model Context Protocol) Integration**: Enables seamless integration with diverse research tools and methodologies for private domain access, knowledge graphs, and web browsing.\n\n4. **Private Knowledgebase Support**: Integrates with RAGFlow, Qdrant, Milvus, VikingDB, MOI, and Dify for research on users' private documents.\n\n5. **Human-in-the-Loop Collaboration**: Features intelligent clarification mechanisms, plan review and editing capabilities, and auto-acceptance options for streamlined workflows.\n\n6. **Content Creation Tools**: Includes podcast generation with text-to-speech synthesis, PowerPoint presentation creation, and Notion-style block editing for report refinement.\n\n7. **Multi-Language Support**: Provides README documentation in English, Simplified Chinese, Japanese, German, Spanish, Russian, and Portuguese.\n\n### Development and Community Ecosystem\n\nThe project demonstrates strong community engagement with 88 contributors and 19,531 GitHub stars as of February 2026 [DeerFlow GitHub Repository](https://github.com/bytedance/deer-flow). Key contributors include Henry Li (203 contributions), Willem Jiang (130 contributions), and Daniel Walnut (25 contributions), representing a mix of ByteDance employees and open-source community members. The framework maintains comprehensive documentation including configuration guides, API documentation, FAQ sections, and multiple example research reports covering topics from quantum computing to AI adoption in healthcare.\n\n---\n\n## Metrics & Impact Analysis\n\n### Growth Trajectory\n\n```\nTimeline: May 2025 - February 2026\nStars: 0 → 19,531 (exponential growth)\nForks: 0 → 2,452 (strong community adoption)\nContributors: 0 → 88 (active development ecosystem)\nOpen Issues: 196 (ongoing maintenance and feature development)\n```\n\n### Key Metrics\n\n| Metric | Value | Assessment |\n|--------|-------|------------|\n| GitHub Stars | 19,531 | Exceptional popularity for research framework |\n| Forks | 2,452 | Strong community adoption and potential derivatives |\n| Contributors | 88 | Healthy open-source development ecosystem |\n| Open Issues | 196 | Active maintenance and feature development |\n| Primary Language | Python (1.29MB) | Main development language with extensive libraries |\n| Secondary Language | TypeScript (503KB) | Modern web UI implementation |\n| Repository Age | ~9 months | Rapid development and feature expansion |\n| License | MIT | Permissive open-source licensing |\n\n---\n\n## Comparative Analysis\n\n### Feature Comparison\n\n| Feature | DeerFlow | OpenAI Deep Research | LangChain OpenDeepResearch |\n|---------|-----------|----------------------|----------------------------|\n| Multi-Agent Architecture | ✅ | ❌ | ✅ |\n| Local LLM Support | ✅ | ❌ | ✅ |\n| MCP Integration | ✅ | ❌ | ❌ |\n| Web Search Engines | Multiple (5+) | Limited | Limited |\n| Code Execution | ✅ Python REPL | Limited | ✅ |\n| Podcast Generation | ✅ | ❌ | ❌ |\n| Presentation Creation | ✅ | ❌ | ❌ |\n| Private Knowledgebase | ✅ (6+ options) | Limited | Limited |\n| Human-in-the-Loop | ✅ | Limited | ✅ |\n| Open Source | ✅ MIT | ❌ | ✅ Apache 2.0 |\n\n### Market Positioning\n\nDeerFlow occupies a unique position in the deep research framework landscape by combining enterprise-grade multi-agent orchestration with extensive tool integrations and open-source accessibility [Navigating the Landscape of Deep Research Frameworks](https://www.oreateai.com/blog/navigating-the-landscape-of-deep-research-frameworks-a-comprehensive-comparison/0dc13e48eb8c756650112842c8d1a184]. While proprietary solutions like OpenAI's Deep Research offer polished user experiences, DeerFlow provides greater flexibility through local deployment options, custom tool integration, and community-driven development. The framework particularly excels in scenarios requiring specialized research workflows, integration with private data sources, or deployment in regulated environments where cloud-based solutions may not be feasible.\n\n---\n\n## Strengths & Weaknesses\n\n### Strengths\n\n1. **Comprehensive Multi-Agent Architecture**: DeerFlow's sophisticated agent orchestration enables complex research workflows beyond single-agent systems [Create Your Own Deep Research Agent with DeerFlow](https://thesequence.substack.com/p/the-sequence-engineering-661-create).\n\n2. **Extensive Tool Integration**: Support for multiple search engines, crawling tools, MCP services, and private knowledgebases provides unmatched flexibility.\n\n3. **Local Deployment Capabilities**: Unlike many proprietary solutions, DeerFlow supports local LLM deployment, offering privacy, cost control, and customization options.\n\n4. **Human Collaboration Features**: Intelligent clarification mechanisms and plan editing capabilities bridge the gap between automated research and human oversight.\n\n5. **Active Community Development**: With 88 contributors and regular updates, the project benefits from diverse perspectives and rapid feature evolution.\n\n6. **Production-Ready Deployment**: Docker support, cloud integration (Volcengine), and comprehensive documentation facilitate enterprise adoption.\n\n### Areas for Improvement\n\n1. **Learning Curve**: The extensive feature set and configuration options may present challenges for new users compared to simpler single-purpose tools.\n\n2. **Resource Requirements**: Local deployment with multiple agents and tools may demand significant computational resources.\n\n3. **Documentation Complexity**: While comprehensive, the documentation spans multiple languages and may benefit from more streamlined onboarding guides.\n\n4. **Integration Complexity**: Advanced features like MCP integration and custom tool development require technical expertise beyond basic usage.\n\n5. **Version Transition**: The ongoing move to DeerFlow 2.0 may create temporary instability or compatibility concerns for existing deployments.\n\n---\n\n## Key Success Factors\n\n1. **ByteDance Backing**: Corporate sponsorship provides resources, expertise, and credibility while maintaining open-source accessibility [DeerFlow: A Game-Changer for Automated Research and Content Creation](https://medium.com/@mingyang.heaven/deerflow-a-game-changer-for-automated-research-and-content-creation-83612f683e7a).\n\n2. **Modern Technical Foundation**: Built on LangGraph and LangChain, DeerFlow leverages established frameworks while adding significant value through multi-agent orchestration.\n\n3. **Community-Driven Development**: Active contributor community ensures diverse use cases, rapid bug fixes, and feature evolution aligned with real-world needs.\n\n4. **Comprehensive Feature Set**: Unlike narrowly focused tools, DeerFlow addresses the complete research workflow from information gathering to content creation.\n\n5. **Production Deployment Options**: Cloud integration, Docker support, and enterprise features facilitate adoption beyond experimental use cases.\n\n6. **Multi-Language Accessibility**: Documentation and interface support for multiple languages expands global reach and adoption potential.\n\n---\n\n## Sources\n\n### Primary Sources\n\n1. **DeerFlow GitHub Repository**: Official source code, documentation, and development history [DeerFlow GitHub Repository](https://github.com/bytedance/deer-flow)\n2. **DeerFlow Official Website**: Platform showcasing features, case studies, and deployment options [DeerFlow Official Website](https://deerflow.tech/)\n3. **GitHub API Data**: Repository metrics, contributor statistics, and commit history\n\n### Media Coverage\n\n1. **The Sequence Engineering**: Technical analysis of DeerFlow architecture and capabilities [Create Your Own Deep Research Agent with DeerFlow](https://thesequence.substack.com/p/the-sequence-engineering-661-create)\n2. **Medium Articles**: Community perspectives on DeerFlow implementation and use cases [DeerFlow: A Game-Changer for Automated Research and Content Creation](https://medium.com/@mingyang.heaven/deerflow-a-game-changer-for-automated-research-and-content-creation-83612f683e7a)\n3. **YouTube Demonstrations**: Video walkthroughs of DeerFlow functionality and local deployment [ByteDance DeerFlow - (Deep Research Agents with a LOCAL LLM!)](https://www.youtube.com/watch?v=Ui0ovCVDYGs)\n\n### Technical Sources\n\n1. **FireXCore Analysis**: Feature overview and technical assessment [DeerFlow: Multi-Agent AI For Research Automation 2025](https://firexcore.com/blog/what-is-deerflow/)\n2. **Oreate AI Comparison**: Framework benchmarking and market positioning analysis [Navigating the Landscape of Deep Research Frameworks](https://www.oreateai.com/blog/navigating-the-landscape-of-deep-research-frameworks-a-comprehensive-comparison/0dc13e48eb8c756650112842c8d1a184)\n\n---\n\n## Confidence Assessment\n\n**High Confidence (90%+) Claims:**\n- DeerFlow was created by ByteDance and open-sourced under MIT license in May 2025\n- The framework implements multi-agent architecture using LangGraph and LangChain\n- Current GitHub metrics: 19,531 stars, 2,452 forks, 88 contributors, 196 open issues\n- Supports multiple search engines including Tavily, InfoQuest, Brave Search\n- Includes features for podcast generation, presentation creation, and human collaboration\n\n**Medium Confidence (70-89%) Claims:**\n- Specific performance benchmarks compared to proprietary alternatives\n- Detailed breakdown of enterprise adoption rates and use cases\n- Exact resource requirements for various deployment scenarios\n\n**Lower Confidence (50-69%) Claims:**\n- Future development roadmap beyond DeerFlow 2.0 transition\n- Specific enterprise customer implementations and case studies\n- Detailed comparison with emerging competitors not yet widely documented\n\n---\n\n## Research Methodology\n\nThis report was compiled using:\n\n1. **Multi-source web search** - Broad discovery and targeted queries across technical publications, media coverage, and community discussions\n2. **GitHub repository analysis** - Direct API queries for commits, issues, PRs, contributor activity, and repository metrics\n3. **Content extraction** - Official documentation, technical articles, video demonstrations, and community resources\n4. **Cross-referencing** - Verification across independent sources including technical analysis, media coverage, and community feedback\n5. **Chronological reconstruction** - Timeline development from timestamped commit history and release documentation\n6. **Confidence scoring** - Claims weighted by source reliability, corroboration across multiple sources, and recency of information\n\n**Research Depth:** Comprehensive technical and market analysis\n**Time Scope:** May 2025 - February 2026 (9-month development period)\n**Geographic Scope:** Global open-source community with ByteDance corporate backing\n\n---\n\n**Report Prepared By:** Github Deep Research by DeerFlow\n**Date:** 2026-02-01\n**Report Version:** 1.0\n**Status:** Complete" }, "id": "call_l2m5ymrn2iwc1k3wnnirveue", "type": "tool_call" @@ -1741,7 +1741,9 @@ { "name": "present_files", "args": { - "filepaths": ["/mnt/user-data/outputs/index.html"] + "filepaths": [ + "/mnt/user-data/outputs/index.html" + ] }, "id": "present_files:34", "type": "tool_call" @@ -1871,4 +1873,4 @@ "interrupts": [], "checkpoint_id": "1f0ff191-247b-6e28-8077-c6ae37cb0bc6", "parent_checkpoint_id": "1f0ff191-2479-6baa-8076-feaaf42a66ed" -} +} \ No newline at end of file diff --git a/frontend/public/demo/threads/fe3f7974-1bcb-4a01-a950-79673baafefd/user-data/outputs/research_deerflow_20260201.md b/frontend/public/demo/threads/fe3f7974-1bcb-4a01-a950-79673baafefd/user-data/outputs/research_deerflow_20260201.md index 92d29e5..614cd37 100644 --- a/frontend/public/demo/threads/fe3f7974-1bcb-4a01-a950-79673baafefd/user-data/outputs/research_deerflow_20260201.md +++ b/frontend/public/demo/threads/fe3f7974-1bcb-4a01-a950-79673baafefd/user-data/outputs/research_deerflow_20260201.md @@ -1,12 +1,3 @@ - -{"id": "cite-1", "title": "DeerFlow GitHub Repository", "url": "https://github.com/bytedance/deer-flow", "snippet": "Community-driven Deep Research framework combining language models with tools like web search, crawling, and Python execution"} -{"id": "cite-2", "title": "Create Your Own Deep Research Agent with DeerFlow", "url": "https://thesequence.substack.com/p/the-sequence-engineering-661-create", "snippet": "Open-source multi-agent research automation framework developed by ByteDance"} -{"id": "cite-3", "title": "DeerFlow: A Game-Changer for Automated Research and Content Creation", "url": "https://medium.com/@mingyang.heaven/deerflow-a-game-changer-for-automated-research-and-content-creation-83612f683e7a", "snippet": "Open-source multi-agent framework revolutionizing research and content creation"} -{"id": "cite-4", "title": "ByteDance DeerFlow - (Deep Research Agents with a LOCAL LLM!)", "url": "https://www.youtube.com/watch?v=Ui0ovCVDYGs", "snippet": "Video demonstration of DeerFlow capabilities and local LLM integration"} -{"id": "cite-5", "title": "DeerFlow Official Website", "url": "https://deerflow.tech/", "snippet": "Official platform showcasing DeerFlow features, case studies, and architecture"} -{"id": "cite-6", "title": "Navigating the Landscape of Deep Research Frameworks", "url": "https://www.oreateai.com/blog/navigating-the-landscape-of-deep-research-frameworks-a-comprehensive-comparison/0dc13e48eb8c756650112842c8d1a184", "snippet": "Comparative analysis of deep research frameworks including DeerFlow"} -{"id": "cite-7", "title": "DeerFlow: Multi-Agent AI For Research Automation 2025", "url": "https://firexcore.com/blog/what-is-deerflow/", "snippet": "Overview of DeerFlow features and capabilities for research automation"} - # DeerFlow Deep Research Report - **Research Date:** 2026-02-01 diff --git a/frontend/src/components/ai-elements/inline-citation.tsx b/frontend/src/components/ai-elements/inline-citation.tsx deleted file mode 100644 index 506e428..0000000 --- a/frontend/src/components/ai-elements/inline-citation.tsx +++ /dev/null @@ -1,289 +0,0 @@ -"use client"; - -import { Badge } from "@/components/ui/badge"; -import { - HoverCard, - HoverCardContent, - HoverCardTrigger, -} from "@/components/ui/hover-card"; -import { - cn, - externalLinkClass, - externalLinkClassNoUnderline, -} from "@/lib/utils"; -import { ExternalLinkIcon } from "lucide-react"; -import { - type AnchorHTMLAttributes, - type ComponentProps, - type ImgHTMLAttributes, - type ReactElement, - type ReactNode, - Children, -} from "react"; -import type { Citation } from "@/core/citations"; -import { - extractDomainFromUrl, - isExternalUrl, - syntheticCitationFromLink, -} from "@/core/citations"; -import { Shimmer } from "./shimmer"; -import { useI18n } from "@/core/i18n/hooks"; - -type InlineCitationCardProps = ComponentProps; - -const InlineCitationCard = (props: InlineCitationCardProps) => ( - -); - -const InlineCitationCardBody = ({ - className, - ...props -}: ComponentProps<"div">) => ( - -); - -const InlineCitationSource = ({ - title, - url, - description, - className, - children, - ...props -}: ComponentProps<"div"> & { - title?: string; - url?: string; - description?: string; -}) => ( -
- {title && ( -

{title}

- )} - {url && ( -

{url}

- )} - {description && ( -

- {description} -

- )} - {children} -
-); - -/** - * Shared CitationLink component that renders a citation as a hover card badge - * Used across message-list-item, artifact-file-detail, and message-group - * - * When citation is provided, displays title and snippet from the citation. - * When citation is omitted, falls back to displaying the domain name extracted from href. - */ -export type CitationLinkProps = { - citation?: Citation; - href: string; - children: React.ReactNode; -}; - -export const CitationLink = ({ - citation, - href, - children, -}: CitationLinkProps) => { - const domain = extractDomainFromUrl(href); - - // Priority: citation.title > children (if meaningful) > domain - // - citation.title: from parsed block, most accurate - // - children: from markdown link text [Text](url), used when no citation data - // - domain: fallback when both above are unavailable - // Skip children if it's a generic placeholder like "Source" - const childrenText = typeof children === "string" ? children : null; - const isGenericText = childrenText === "Source" || childrenText === "来源"; - const displayText = citation?.title || (!isGenericText && childrenText) || domain; - - return ( - - - e.stopPropagation()} - > - - {displayText} - - - - - - - - - ); -}; - -/** - * Renders a link with optional citation badge. Use in markdown components (message + artifact). - * - citationMap: URL -> Citation; links in map render as CitationLink. - * - isHuman: when true, never render as CitationLink (plain link). - * - isLoadingCitations: when true and not human, non-citation links use no-underline style. - * - syntheticExternal: when true, external URLs not in citationMap render as CitationLink with synthetic citation. - */ -export type CitationAwareLinkProps = ComponentProps<"a"> & { - citationMap: Map; - isHuman?: boolean; - isLoadingCitations?: boolean; - syntheticExternal?: boolean; -}; - -export const CitationAwareLink = ({ - href, - children, - citationMap, - isHuman = false, - isLoadingCitations = false, - syntheticExternal = false, - className, - ...rest -}: CitationAwareLinkProps) => { - if (!href) return {children}; - - const citation = citationMap.get(href); - - if (citation && !isHuman) { - return ( - - {children} - - ); - } - - if (syntheticExternal && isExternalUrl(href)) { - const linkText = - typeof children === "string" - ? children - : String(Children.toArray(children).join("")).trim() || href; - return ( - - {children} - - ); - } - - const noUnderline = !isHuman && isLoadingCitations; - return ( - - {children} - - ); -}; - -/** - * Options for creating markdown components that render links as citations. - * Used by message list (all modes: Flash/Thinking/Pro/Ultra), artifact preview, and CoT. - */ -export type CreateCitationMarkdownComponentsOptions = { - citationMap: Map; - isHuman?: boolean; - isLoadingCitations?: boolean; - syntheticExternal?: boolean; - /** Optional custom img component (e.g. MessageImage with threadId). Omit for artifact. */ - img?: (props: ImgHTMLAttributes & { threadId?: string; maxWidth?: string }) => ReactNode; -}; - -/** - * Create markdown `components` (a, optional img) that use CitationAwareLink. - * Reused across message-list-item (all modes), artifact-file-detail, and any CoT markdown. - */ -export function createCitationMarkdownComponents( - options: CreateCitationMarkdownComponentsOptions, -): { - a: (props: AnchorHTMLAttributes) => ReactElement; - img?: (props: ImgHTMLAttributes & { threadId?: string; maxWidth?: string }) => ReactNode; -} { - const { - citationMap, - isHuman = false, - isLoadingCitations = false, - syntheticExternal = false, - img, - } = options; - const a = (props: AnchorHTMLAttributes) => ( - - ); - return img ? { a, img } : { a }; -} - -/** - * Shared CitationsLoadingIndicator component - * Used across message-list-item and message-group to show loading citations - */ -export type CitationsLoadingIndicatorProps = { - citations: Citation[]; - className?: string; -}; - -export const CitationsLoadingIndicator = ({ - citations, - className, -}: CitationsLoadingIndicatorProps) => { - const { t } = useI18n(); - - return ( -
- - {citations.length > 0 - ? t.citations.loadingCitationsWithCount(citations.length) - : t.citations.loadingCitations} - - {citations.length > 0 && ( -
- {citations.map((citation) => ( - - - {citation.title || extractDomainFromUrl(citation.url)} - - - ))} -
- )} -
- ); -}; diff --git a/frontend/src/components/workspace/artifacts/artifact-file-detail.tsx b/frontend/src/components/workspace/artifacts/artifact-file-detail.tsx index 2bfae75..3ab8608 100644 --- a/frontend/src/components/workspace/artifacts/artifact-file-detail.tsx +++ b/frontend/src/components/workspace/artifacts/artifact-file-detail.tsx @@ -8,7 +8,6 @@ import { SquareArrowOutUpRightIcon, XIcon, } from "lucide-react"; -import * as React from "react"; import { useCallback, useEffect, useMemo, useState } from "react"; import { toast } from "sonner"; import { Streamdown } from "streamdown"; @@ -21,7 +20,6 @@ import { ArtifactHeader, ArtifactTitle, } from "@/components/ai-elements/artifact"; -import { createCitationMarkdownComponents } from "@/components/ai-elements/inline-citation"; import { Select, SelectItem } from "@/components/ui/select"; import { SelectContent, @@ -33,12 +31,6 @@ import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"; import { CodeEditor } from "@/components/workspace/code-editor"; import { useArtifactContent } from "@/core/artifacts/hooks"; import { urlOfArtifact } from "@/core/artifacts/utils"; -import type { Citation } from "@/core/citations"; -import { - contentWithoutCitationsFromParsed, - removeAllCitations, - useParsedCitations, -} from "@/core/citations"; import { useI18n } from "@/core/i18n/hooks"; import { installSkill } from "@/core/skills/api"; import { streamdownPlugins } from "@/core/streamdown"; @@ -48,9 +40,6 @@ import { cn } from "@/lib/utils"; import { Tooltip } from "../tooltip"; -import { SafeCitationContent } from "../messages/safe-citation-content"; -import { useThread } from "../messages/context"; - import { useArtifacts } from "./context"; export function ArtifactFileDetail({ @@ -92,22 +81,13 @@ export function ArtifactFileDetail({ const previewable = useMemo(() => { return (language === "html" && !isWriteFile) || language === "markdown"; }, [isWriteFile, language]); - const { thread } = useThread(); const { content } = useArtifactContent({ threadId, filepath: filepathFromProps, enabled: isCodeFile && !isWriteFile, }); - const parsed = useParsedCitations( - language === "markdown" ? (content ?? "") : "", - ); - const cleanContent = - language === "markdown" && content ? parsed.cleanContent : (content ?? ""); - const contentWithoutCitations = - language === "markdown" && content - ? contentWithoutCitationsFromParsed(parsed) - : (content ?? ""); + const displayContent = content ?? ""; const [viewMode, setViewMode] = useState<"code" | "preview">("code"); const [isInstalling, setIsInstalling] = useState(false); @@ -219,7 +199,7 @@ export function ArtifactFileDetail({ disabled={!content} onClick={async () => { try { - await navigator.clipboard.writeText(contentWithoutCitations ?? ""); + await navigator.clipboard.writeText(displayContent ?? ""); toast.success(t.clipboard.copiedToClipboard); } catch (error) { toast.error("Failed to copy to clipboard"); @@ -255,27 +235,17 @@ export function ArtifactFileDetail({ viewMode === "preview" && language === "markdown" && content && ( - ( - - )} + )} {isCodeFile && viewMode === "code" && ( )} @@ -295,29 +265,17 @@ export function ArtifactFilePreview({ threadId, content, language, - cleanContent, - citationMap, }: { filepath: string; threadId: string; content: string; language: string; - cleanContent: string; - citationMap: Map; }) { if (language === "markdown") { - const components = createCitationMarkdownComponents({ - citationMap, - syntheticExternal: true, - }); return (
- - {cleanContent ?? ""} + + {content ?? ""}
); diff --git a/frontend/src/components/workspace/messages/markdown-content.tsx b/frontend/src/components/workspace/messages/markdown-content.tsx new file mode 100644 index 0000000..12465de --- /dev/null +++ b/frontend/src/components/workspace/messages/markdown-content.tsx @@ -0,0 +1,42 @@ +"use client"; + +import type { ImgHTMLAttributes } from "react"; +import type { ReactNode } from "react"; + +import { + MessageResponse, + type MessageResponseProps, +} from "@/components/ai-elements/message"; +import { streamdownPlugins } from "@/core/streamdown"; + +export type MarkdownContentProps = { + content: string; + isLoading: boolean; + rehypePlugins: MessageResponseProps["rehypePlugins"]; + className?: string; + remarkPlugins?: MessageResponseProps["remarkPlugins"]; + isHuman?: boolean; + img?: (props: ImgHTMLAttributes & { threadId?: string; maxWidth?: string }) => ReactNode; +}; + +/** Renders markdown content. */ +export function MarkdownContent({ + content, + rehypePlugins, + className, + remarkPlugins = streamdownPlugins.remarkPlugins, + img, +}: MarkdownContentProps) { + if (!content) return null; + const components = img ? { img } : undefined; + return ( + + {content} + + ); +} diff --git a/frontend/src/components/workspace/messages/message-group.tsx b/frontend/src/components/workspace/messages/message-group.tsx index 3a2bb94..e12a13c 100644 --- a/frontend/src/components/workspace/messages/message-group.tsx +++ b/frontend/src/components/workspace/messages/message-group.tsx @@ -39,9 +39,7 @@ import { useArtifacts } from "../artifacts"; import { FlipDisplay } from "../flip-display"; import { Tooltip } from "../tooltip"; -import { useThread } from "./context"; - -import { SafeCitationContent } from "./safe-citation-content"; +import { MarkdownContent } from "./markdown-content"; export function MessageGroup({ className, @@ -120,7 +118,7 @@ export function MessageGroup({ ) : ( - + ), )} {lastToolCallStep && ( @@ -143,7 +136,6 @@ export function MessageGroup({ {...lastToolCallStep} isLast={true} isLoading={isLoading} - rehypePlugins={rehypePlugins} /> )} @@ -178,7 +170,7 @@ export function MessageGroup({ ; isLast?: boolean; isLoading?: boolean; - rehypePlugins: ReturnType; }) { const { t } = useI18n(); const { setOpen, autoOpen, autoSelect, selectedArtifact, select } = useArtifacts(); - const { thread } = useThread(); - const threadIsLoading = thread.isLoading; - - const fileContent = typeof args.content === "string" ? args.content : ""; if (name === "web_search") { let label: React.ReactNode = t.toolCalls.searchForRelatedInfo; @@ -364,42 +350,27 @@ function ToolCall({ }, 100); } - const isMarkdown = - path?.toLowerCase().endsWith(".md") || - path?.toLowerCase().endsWith(".markdown"); - return ( - <> - { - select( - new URL( - `write-file:${path}?message_id=${messageId}&tool_call_id=${id}`, - ).toString(), - ); - setOpen(true); - }} - > - {path && ( - - {path} - - )} - - {isMarkdown && ( - + { + select( + new URL( + `write-file:${path}?message_id=${messageId}&tool_call_id=${id}`, + ).toString(), + ); + setOpen(true); + }} + > + {path && ( + + {path} + )} - + ); } else if (name === "bash") { const description: string | undefined = (args as { description: string }) diff --git a/frontend/src/components/workspace/messages/message-list-item.tsx b/frontend/src/components/workspace/messages/message-list-item.tsx index fced6fe..e49e830 100644 --- a/frontend/src/components/workspace/messages/message-list-item.tsx +++ b/frontend/src/components/workspace/messages/message-list-item.tsx @@ -12,7 +12,6 @@ import { } from "@/components/ai-elements/message"; import { Badge } from "@/components/ui/badge"; import { resolveArtifactURL } from "@/core/artifacts/utils"; -import { removeAllCitations } from "@/core/citations"; import { extractContentFromMessage, extractReasoningContentFromMessage, @@ -24,7 +23,7 @@ import { humanMessagePlugins } from "@/core/streamdown"; import { cn } from "@/lib/utils"; import { CopyButton } from "../copy-button"; -import { SafeCitationContent } from "./safe-citation-content"; +import { MarkdownContent } from "./markdown-content"; export function MessageListItem({ className, @@ -54,11 +53,11 @@ export function MessageListItem({ >
@@ -154,7 +153,7 @@ function MessageContent_({ return ( {filesList} - {group.messages[0] && hasContent(group.messages[0]) && ( - & { threadId?: string; maxWidth?: string }) => ReactNode; - /** When true, only show loading indicator or null (e.g. write_file step). */ - loadingOnly?: boolean; - /** When set, use instead of default MessageResponse (e.g. artifact preview). */ - renderBody?: (parsed: UseParsedCitationsResult) => ReactNode; -}; - -/** Single place for citation-aware body: shows loading until citations complete (no half-finished refs), else body. */ -export function SafeCitationContent({ - content, - isLoading, - rehypePlugins, - className, - remarkPlugins = streamdownPlugins.remarkPlugins, - isHuman = false, - img, - loadingOnly = false, - renderBody, -}: SafeCitationContentProps) { - const parsed = useParsedCitations(content); - const { citations, cleanContent, citationMap } = parsed; - const showLoading = shouldShowCitationLoading(content, cleanContent, isLoading); - const components = useMemo( - () => - createCitationMarkdownComponents({ - citationMap, - isHuman, - isLoadingCitations: false, - img, - }), - [citationMap, isHuman, img], - ); - - if (showLoading) { - return ( - - ); - } - if (loadingOnly) return null; - if (renderBody) return renderBody(parsed); - if (!cleanContent) return null; - - return ( - - {cleanContent} - - ); -} diff --git a/frontend/src/components/workspace/messages/subtask-card.tsx b/frontend/src/components/workspace/messages/subtask-card.tsx index a8d0e63..128d032 100644 --- a/frontend/src/components/workspace/messages/subtask-card.tsx +++ b/frontend/src/components/workspace/messages/subtask-card.tsx @@ -29,7 +29,7 @@ import { cn } from "@/lib/utils"; import { FlipDisplay } from "../flip-display"; -import { SafeCitationContent } from "./safe-citation-content"; +import { MarkdownContent } from "./markdown-content"; export function SubtaskCard({ className, @@ -153,7 +153,7 @@ export function SubtaskCard({ ; -} - -/** - * Parse content for citations and build citation map. Memoized by content. - */ -export function useParsedCitations(content: string): UseParsedCitationsResult { - return useMemo(() => { - const parsed = parseCitations(content ?? ""); - const citationMap = new Map(); - for (const c of parsed.citations) citationMap.set(c.url, c); - return { - citations: parsed.citations, - cleanContent: parsed.cleanContent, - citationMap, - }; - }, [content]); -} diff --git a/frontend/src/core/citations/utils.ts b/frontend/src/core/citations/utils.ts deleted file mode 100644 index fb5cded..0000000 --- a/frontend/src/core/citations/utils.ts +++ /dev/null @@ -1,226 +0,0 @@ -/** - * Citation parsing and display helpers. - * Display rule: never show half-finished citations. Use shouldShowCitationLoading - * and show only the loading indicator until the block is complete and all - * [cite-N] refs are replaced. - */ - -/** - * Citation data structure representing a source reference - */ -export interface Citation { - id: string; - title: string; - url: string; - snippet: string; -} - -/** - * Result of parsing citations from content - */ -export interface ParseCitationsResult { - citations: Citation[]; - cleanContent: string; -} - -/** - * Parse citation lines (one JSON object per line) into Citation array. - * Deduplicates by URL. Used for both complete and incomplete (streaming) blocks. - */ -function parseCitationLines( - blockContent: string, - seenUrls: Set, -): Citation[] { - const out: Citation[] = []; - const lines = blockContent.split("\n"); - for (const line of lines) { - const trimmed = line.trim(); - if (!trimmed?.startsWith("{")) continue; - try { - const citation = JSON.parse(trimmed) as Citation; - if (citation.id && citation.url && !seenUrls.has(citation.url)) { - seenUrls.add(citation.url); - out.push({ - id: citation.id, - title: citation.title || "", - url: citation.url, - snippet: citation.snippet || "", - }); - } - } catch { - // Skip invalid JSON lines - can happen during streaming - } - } - return out; -} - -/** - * Parse citations block from message content. - * Shared by all modes (Flash / Thinking / Pro / Ultra); supports incomplete - * blocks during SSE streaming (parses whatever complete JSON lines - * have arrived so far so [cite-N] can be linked progressively). - * - * The citations block format: - * - * {"id": "cite-1", "title": "Page Title", "url": "https://example.com", "snippet": "Description"} - * {"id": "cite-2", "title": "Another Page", "url": "https://example2.com", "snippet": "Description"} - * - * - * @param content - The raw message content that may contain a citations block - * @returns Object containing parsed citations array and content with citations block removed - */ -export function parseCitations(content: string): ParseCitationsResult { - if (!content) { - return { citations: [], cleanContent: content }; - } - - const citations: Citation[] = []; - const seenUrls = new Set(); - - // 1) Complete blocks: ... - const citationsRegex = /([\s\S]*?)<\/citations>/g; - let match; - while ((match = citationsRegex.exec(content)) !== null) { - citations.push(...parseCitationLines(match[1] ?? "", seenUrls)); - } - - // 2) Incomplete block during streaming: ... (no closing tag yet) - if (content.includes("") && !content.includes("")) { - const openMatch = content.match(/([\s\S]*)$/); - if (openMatch?.[1] != null) { - citations.push(...parseCitationLines(openMatch[1], seenUrls)); - } - } - - let cleanContent = removeCitationsBlocks(content); - - // Convert [cite-N] references to markdown links - // Example: [cite-1] -> [Title](url) - if (citations.length > 0) { - // Build a map from citation id to citation object - const idMap = new Map(); - for (const citation of citations) { - idMap.set(citation.id, citation); - } - - // Replace all [cite-N] patterns with markdown links - cleanContent = cleanContent.replace(/\[cite-(\d+)\]/g, (match, num) => { - const citeId = `cite-${num}`; - const citation = idMap.get(citeId); - if (citation) { - // Use title if available, otherwise use domain - const linkText = citation.title || extractDomainFromUrl(citation.url); - return `[${linkText}](${citation.url})`; - } - // If citation not found, keep the original text - return match; - }); - } - - return { citations, cleanContent }; -} - -/** - * Whether the URL is external (http/https). - */ -export function isExternalUrl(url: string): boolean { - return url.startsWith("http://") || url.startsWith("https://"); -} - -/** - * Build a synthetic Citation from a link (e.g. in artifact markdown without block). - */ -export function syntheticCitationFromLink(href: string, title: string): Citation { - return { - id: `artifact-cite-${href}`, - title: title || href, - url: href, - snippet: "", - }; -} - -/** - * Extract the domain name from a URL for display - * - * @param url - Full URL string - * @returns Domain name or the original URL if parsing fails - */ -export function extractDomainFromUrl(url: string): string { - try { - const urlObj = new URL(url); - // Remove 'www.' prefix if present - return urlObj.hostname.replace(/^www\./, ""); - } catch { - return url; - } -} - -/** - * Remove all blocks from content (complete and incomplete). - * Does not remove [cite-N] or markdown links; use removeAllCitations for that. - */ -export function removeCitationsBlocks(content: string): string { - if (!content) return content; - let result = content.replace(/[\s\S]*?<\/citations>/g, "").trim(); - if (result.includes("")) { - result = result.replace(/[\s\S]*$/g, "").trim(); - } - return result; -} - -/** - * Whether content contains a block (open tag). - */ -export function hasCitationsBlock(content: string): boolean { - return Boolean(content?.includes("")); -} - -/** Pattern for [cite-1], [cite-2], ... that should be replaced by parseCitations. */ -const UNREPLACED_CITE_REF = /\[cite-\d+\]/; - -/** - * Whether cleanContent still contains unreplaced [cite-N] refs (half-finished citations). - * When true, callers must not render this content and should show loading instead. - */ -export function hasUnreplacedCitationRefs(cleanContent: string): boolean { - return Boolean(cleanContent && UNREPLACED_CITE_REF.test(cleanContent)); -} - -/** - * Single source of truth: true when body must not be rendered (show loading instead). - * Use after parseCitations: pass raw content, parsed cleanContent, and isLoading. - * Never show body when cleanContent still has [cite-N] (e.g. refs arrived before - * block in stream); also show loading while streaming with citation block. - */ -export function shouldShowCitationLoading( - rawContent: string, - cleanContent: string, - isLoading: boolean, -): boolean { - if (hasUnreplacedCitationRefs(cleanContent)) return true; - return isLoading && hasCitationsBlock(rawContent); -} - -/** - * Strip citation markdown links from already-cleaned content (from parseCitations). - * Use when you already have ParseCitationsResult to avoid parsing twice. - */ -export function contentWithoutCitationsFromParsed( - parsed: ParseCitationsResult, -): string { - const citationUrls = new Set(parsed.citations.map((c) => c.url)); - const withoutLinks = parsed.cleanContent.replace( - /\[([^\]]+)\]\(([^)]+)\)/g, - (fullMatch, _text, url) => (citationUrls.has(url) ? "" : fullMatch), - ); - return withoutLinks.replace(/\n{3,}/g, "\n\n").trim(); -} - -/** - * Remove ALL citations from content (blocks, [cite-N], and citation links). - * Used for copy/download. For display you typically use parseCitations/useParsedCitations. - */ -export function removeAllCitations(content: string): string { - if (!content) return content; - return contentWithoutCitationsFromParsed(parseCitations(content)); -} diff --git a/frontend/src/core/i18n/locales/en-US.ts b/frontend/src/core/i18n/locales/en-US.ts index 262c412..11d0158 100644 --- a/frontend/src/core/i18n/locales/en-US.ts +++ b/frontend/src/core/i18n/locales/en-US.ts @@ -167,13 +167,6 @@ export const enUS: Translations = { startConversation: "Start a conversation to see messages here", }, - // Citations - citations: { - loadingCitations: "Organizing citations...", - loadingCitationsWithCount: (count: number) => - `Organizing ${count} citation${count === 1 ? "" : "s"}...`, - }, - // Chats chats: { searchChats: "Search chats", diff --git a/frontend/src/core/i18n/locales/types.ts b/frontend/src/core/i18n/locales/types.ts index c9e3706..843f517 100644 --- a/frontend/src/core/i18n/locales/types.ts +++ b/frontend/src/core/i18n/locales/types.ts @@ -115,12 +115,6 @@ export interface Translations { startConversation: string; }; - // Citations - citations: { - loadingCitations: string; - loadingCitationsWithCount: (count: number) => string; - }; - // Chats chats: { searchChats: string; diff --git a/frontend/src/core/i18n/locales/zh-CN.ts b/frontend/src/core/i18n/locales/zh-CN.ts index 6f10f68..25dba41 100644 --- a/frontend/src/core/i18n/locales/zh-CN.ts +++ b/frontend/src/core/i18n/locales/zh-CN.ts @@ -164,12 +164,6 @@ export const zhCN: Translations = { startConversation: "开始新的对话以查看消息", }, - // Citations - citations: { - loadingCitations: "正在整理引用...", - loadingCitationsWithCount: (count: number) => `正在整理 ${count} 个引用...`, - }, - // Chats chats: { searchChats: "搜索对话", diff --git a/frontend/src/lib/utils.ts b/frontend/src/lib/utils.ts index a414622..f8ff63a 100644 --- a/frontend/src/lib/utils.ts +++ b/frontend/src/lib/utils.ts @@ -8,5 +8,5 @@ export function cn(...inputs: ClassValue[]) { /** Shared class for external links (underline by default). */ export const externalLinkClass = "text-primary underline underline-offset-2 hover:no-underline"; -/** For streaming / loading state when link may be a citation (no underline). */ +/** Link style without underline by default (e.g. for streaming/loading). */ export const externalLinkClassNoUnderline = "text-primary hover:underline"; diff --git a/skills/public/github-deep-research/SKILL.md b/skills/public/github-deep-research/SKILL.md index b6672f8..fafdb83 100644 --- a/skills/public/github-deep-research/SKILL.md +++ b/skills/public/github-deep-research/SKILL.md @@ -147,5 +147,5 @@ Save report as: `research_{topic}_{YYYYMMDD}.md` 3. **Triangulate claims** - 2+ independent sources 4. **Note conflicting info** - Don't hide contradictions 5. **Distinguish fact vs opinion** - Label speculation clearly -6. **Cite inline** - Reference sources near claims +6. **Reference sources** - Add source references near claims where applicable 7. **Update as you go** - Don't wait until end to synthesize diff --git a/skills/public/market-analysis/SKILL.md b/skills/public/market-analysis/SKILL.md index d3e02b6..8c79a54 100644 --- a/skills/public/market-analysis/SKILL.md +++ b/skills/public/market-analysis/SKILL.md @@ -15,7 +15,7 @@ This skill generates professional, consulting-grade market analysis reports in M - Follow the **"Visual Anchor → Data Contrast → Integrated Analysis"** flow per sub-chapter - Produce insights following the **"Data → User Psychology → Strategy Implication"** chain - Embed pre-generated charts and construct comparison tables -- Generate inline citations formatted per **GB/T 7714-2015** standards +- Include references formatted per **GB/T 7714-2015** where applicable - Output reports entirely in Chinese with professional consulting tone ## When to Use This Skill @@ -36,7 +36,7 @@ The skill expects the following inputs from the upstream agentic workflow: | **Analysis Framework Outline** | Defines the logic flow and general topics for the report | Yes | | **Data Summary** | The source of truth containing raw numbers and metrics | Yes | | **Chart Files** | Local file paths for pre-generated chart images | Yes | -| **External Search Findings** | URLs and summaries for inline citations | Optional | +| **External Search Findings** | URLs and summaries for inline references | Optional | ## Workflow @@ -87,7 +87,7 @@ The report **MUST NOT** stop after the Conclusion — it **MUST** include Refere - **Tone**: McKinsey/BCG — Authoritative, Objective, Professional - **Language**: All headings and content strictly in **Chinese** - **Number Formatting**: Use English commas for thousands separators (`1,000` not `1,000`) -- **Data Citation**: **Bold** important viewpoints and key numbers +- **Data emphasis**: **Bold** important viewpoints and key numbers ### Titling Constraints - **Numbering**: Use standard numbering (`1.`, `1.1`) or Chinese numbering (`一、`) directly followed by the title @@ -109,11 +109,9 @@ Every insight must connect **Data → User Psychology → Strategy Implication** treating male audiences only as a secondary gift-giving segment." ``` -### Citations & References -- **Inline**: Use `[\[Index\]](URL)` format (e.g., `[\[1\]](https://example.com)`) -- **Placement**: Append citations at the end of sentences using information from External Search Findings -- **Index Assignment**: Sequential starting from **1** based on order of appearance -- **References Section**: Formatted strictly per **GB/T 7714-2015** +### References +- **Inline**: Use markdown links for sources (e.g. `[Source Title](URL)`) when using External Search Findings +- **References section**: Formatted strictly per **GB/T 7714-2015** ### Markdown Rules - **Immediate Start**: Begin directly with `# Report Title` — no introductory text @@ -183,7 +181,7 @@ Before considering the report complete, verify: - [ ] All headings are in Chinese with proper numbering (no "Chapter/Part/Section") - [ ] Charts are embedded with `![Description](path)` syntax - [ ] Numbers use English commas for thousands separators -- [ ] Inline citations use `[\[N\]](URL)` format +- [ ] Inline references use markdown links where applicable - [ ] References section follows GB/T 7714-2015 - [ ] No horizontal rules (`---`) in the document - [ ] Conclusion uses flowing prose — no bullet points