├── daily ├── .DS_Store ├── instruct.md ├── reports │ ├── 20250729 │ │ ├── task_20250729100000.md │ │ └── log_20250729100000.md │ ├── 20250730 │ │ ├── task_20250730100000.md │ │ └── log_20250730100000.md │ ├── 20250731 │ │ ├── task_20250731100000.md │ │ └── log_20250731100000.md │ ├── 20250729.md │ └── 20250727.md ├── report.md └── vis.md ├── ui ├── phase1_node.png ├── .env.example ├── postcss.config.js ├── tailwind.config.js ├── src │ ├── main.jsx │ ├── index.css │ ├── App.css │ ├── services │ │ ├── TaskQueue.js │ │ ├── PlannerService.js │ │ ├── CardSynthesizer.js │ │ ├── WorkflowOrchestrator.js │ │ ├── AgentExecutionWorkers.js │ │ └── ExecutionEngine.js │ ├── App.jsx │ ├── components │ │ ├── Header.jsx │ │ ├── EditableCard.jsx │ │ └── Card.jsx │ ├── types │ │ └── index.js │ ├── content │ │ └── sample-report.mdx │ └── assets │ │ └── react.svg ├── vite.config.js ├── .gitignore ├── index.html ├── eslint.config.js ├── package.json ├── public │ └── vite.svg ├── design-phase-one.md └── README.md ├── gui ├── postcss.config.js ├── tailwind.config.js ├── src │ ├── main.jsx │ ├── index.css │ ├── App.css │ ├── services │ │ ├── TaskQueue.js │ │ ├── PlannerService.js │ │ ├── CardSynthesizer.js │ │ ├── WorkflowOrchestrator.js │ │ ├── ServiceFactory.js │ │ └── AgentExecutionWorkers.js │ ├── components │ │ ├── Header.jsx │ │ ├── Navigation.jsx │ │ ├── EditableCard.jsx │ │ ├── CloudStatus.jsx │ │ └── Card.jsx │ ├── types │ │ └── index.js │ ├── content │ │ └── sample-report.mdx │ ├── App.jsx │ └── assets │ │ └── react.svg ├── vite.config.js ├── index.html ├── .gitignore ├── .env.example ├── worker │ ├── src │ │ ├── utils │ │ │ └── cors.js │ │ └── simple-index.js │ └── package.json ├── eslint.config.js ├── wrangler.toml.example ├── public │ └── vite.svg ├── package.json └── deploy.sh ├── .gitignore ├── example ├── earnings_call │ ├── task_microsoft_earnings_call_20250731_100000.md │ ├── vis_ebay_earnings_call_20250731.html │ ├── planning_ford_earnings_call_20250731.md │ ├── task_ebay_earnings_call_20250731_100000.md │ ├── planning_ebay_earnings_call_20250731.md │ ├── report_ebay_earnings_call_20250731.md │ ├── report_ford_earnings_call_20250731.md │ ├── report_ups_earnings_call_20250731.md │ ├── log_ford_earnings_call_20250731_100000.md │ ├── task_tariff_20250729_100000.md │ ├── vis_ups_earnings_call_20250731.html │ ├── planning_microsoft_earnings_call_20250731.md │ ├── vis_ford_earnings_call_20250731.html │ ├── planning_meta_earnings_call_20250731.md │ └── planning_arm_earnings_call_20250731.md ├── claude_tarrif │ ├── task_tariff_20250728_143022.md │ └── planning_tariff_20250728.md ├── pharma │ ├── task_tariff_20250728_143022.md │ └── planning_tariff_20250728.md └── gemini_tarrif │ ├── planning_tariff_20250729.md │ └── log_tariff_20250729_100000.md ├── legacy ├── tarrif.md ├── instruct_new.md └── log.md ├── instruct.md ├── README.md ├── instruct_v2.md └── vis.md /daily/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmquant/OpenResearch/HEAD/daily/.DS_Store -------------------------------------------------------------------------------- /ui/phase1_node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmquant/OpenResearch/HEAD/ui/phase1_node.png -------------------------------------------------------------------------------- /daily/instruct.md: -------------------------------------------------------------------------------- 1 | follow the instruct of @report.md to finish the report and webpage gen task 2 | -------------------------------------------------------------------------------- /ui/.env.example: -------------------------------------------------------------------------------- 1 | VITE_GEMINI_API_KEY='your gemini api key here' 2 | VITE_GEMINI_MODEL=gemini-2.5-flash -------------------------------------------------------------------------------- /gui/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | '@tailwindcss/postcss': {}, 4 | autoprefixer: {}, 5 | }, 6 | } -------------------------------------------------------------------------------- /ui/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | '@tailwindcss/postcss': {}, 4 | autoprefixer: {}, 5 | }, 6 | } -------------------------------------------------------------------------------- /gui/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | export default { 3 | content: [ 4 | "./index.html", 5 | "./src/**/*.{js,ts,jsx,tsx}", 6 | ], 7 | } -------------------------------------------------------------------------------- /ui/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | export default { 3 | content: [ 4 | "./index.html", 5 | "./src/**/*.{js,ts,jsx,tsx}", 6 | ], 7 | } -------------------------------------------------------------------------------- /gui/src/main.jsx: -------------------------------------------------------------------------------- 1 | import { StrictMode } from 'react' 2 | import { createRoot } from 'react-dom/client' 3 | import './index.css' 4 | import App from './App.jsx' 5 | 6 | createRoot(document.getElementById('root')).render( 7 | 8 | 9 | , 10 | ) 11 | -------------------------------------------------------------------------------- /ui/src/main.jsx: -------------------------------------------------------------------------------- 1 | import { StrictMode } from 'react' 2 | import { createRoot } from 'react-dom/client' 3 | import './index.css' 4 | import App from './App.jsx' 5 | 6 | createRoot(document.getElementById('root')).render( 7 | 8 | 9 | , 10 | ) 11 | -------------------------------------------------------------------------------- /gui/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | import mdx from '@mdx-js/rollup' 4 | 5 | // https://vite.dev/config/ 6 | export default defineConfig({ 7 | plugins: [ 8 | { enforce: 'pre', ...mdx() }, 9 | react() 10 | ], 11 | server: { 12 | port: 5173, 13 | host: true 14 | } 15 | }) 16 | -------------------------------------------------------------------------------- /ui/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | import mdx from '@mdx-js/rollup' 4 | 5 | // https://vite.dev/config/ 6 | export default defineConfig({ 7 | plugins: [ 8 | { enforce: 'pre', ...mdx() }, 9 | react() 10 | ], 11 | server: { 12 | port: 5173, 13 | host: true 14 | } 15 | }) 16 | -------------------------------------------------------------------------------- /ui/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | 26 | .env 27 | -------------------------------------------------------------------------------- /gui/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + React 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ui/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + React 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | 26 | # Environment files 27 | *.env 28 | .env* 29 | !.env.example -------------------------------------------------------------------------------- /ui/src/index.css: -------------------------------------------------------------------------------- 1 | @import "tailwindcss"; 2 | 3 | /* Custom animations for the treemap */ 4 | @keyframes fadeIn { 5 | from { 6 | opacity: 0; 7 | transform: translateY(-10px); 8 | } 9 | to { 10 | opacity: 1; 11 | transform: translateY(0); 12 | } 13 | } 14 | 15 | .animate-fadeIn { 16 | animation: fadeIn 0.3s ease-out; 17 | } 18 | 19 | /* Line clamp utility */ 20 | .line-clamp-2 { 21 | display: -webkit-box; 22 | -webkit-line-clamp: 2; 23 | -webkit-box-orient: vertical; 24 | overflow: hidden; 25 | } -------------------------------------------------------------------------------- /gui/src/index.css: -------------------------------------------------------------------------------- 1 | @import "tailwindcss"; 2 | 3 | /* Custom animations for the treemap */ 4 | @keyframes fadeIn { 5 | from { 6 | opacity: 0; 7 | transform: translateY(-10px); 8 | } 9 | to { 10 | opacity: 1; 11 | transform: translateY(0); 12 | } 13 | } 14 | 15 | .animate-fadeIn { 16 | animation: fadeIn 0.3s ease-out; 17 | } 18 | 19 | /* Line clamp utility */ 20 | .line-clamp-2 { 21 | display: -webkit-box; 22 | -webkit-line-clamp: 2; 23 | -webkit-box-orient: vertical; 24 | overflow: hidden; 25 | } -------------------------------------------------------------------------------- /gui/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | 26 | .env 27 | 28 | scripts/ 29 | .legacy/ 30 | .wrangler/ 31 | dist/ 32 | .claude/ 33 | 34 | wrangler.toml 35 | wrangler-kv.toml 36 | 37 | CLAUDE.md 38 | docs/roadmap.md 39 | 40 | -------------------------------------------------------------------------------- /gui/.env.example: -------------------------------------------------------------------------------- 1 | # Gemini API Configuration 2 | VITE_GEMINI_API_KEY=your_gemini_api_key_here 3 | VITE_GEMINI_MODEL=gemini-2.5-flash 4 | 5 | # Gemini Embedding Model 6 | VITE_GEMINI_EMBEDDING_MODEL=gemini-embedding-001 7 | 8 | # Cloudflare Worker API (optional - enables cloud features) 9 | VITE_WORKER_API_URL=https://your-worker.your-subdomain.workers.dev 10 | 11 | # Worker API Authentication (required for cloud mode) 12 | VITE_WORKER_API_TOKEN=your_worker_api_token_here 13 | 14 | # Development mode (set to 'cloud' to use Worker API, 'local' for direct API calls) 15 | VITE_MODE=local -------------------------------------------------------------------------------- /gui/worker/src/utils/cors.js: -------------------------------------------------------------------------------- 1 | export function cors(response) { 2 | const corsHeaders = { 3 | 'Access-Control-Allow-Origin': '*', 4 | 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS', 5 | 'Access-Control-Allow-Headers': 'Content-Type, Authorization', 6 | 'Access-Control-Max-Age': '86400', 7 | }; 8 | 9 | // Create new response with CORS headers 10 | const newResponse = new Response(response.body, { 11 | status: response.status, 12 | statusText: response.statusText, 13 | headers: { 14 | ...Object.fromEntries(response.headers), 15 | ...corsHeaders, 16 | }, 17 | }); 18 | 19 | return newResponse; 20 | } -------------------------------------------------------------------------------- /gui/worker/src/simple-index.js: -------------------------------------------------------------------------------- 1 | // Simple worker for testing deployment 2 | export default { 3 | async fetch(request, env, ctx) { 4 | const url = new URL(request.url); 5 | 6 | if (url.pathname === '/health') { 7 | return new Response(JSON.stringify({ 8 | status: 'ok', 9 | timestamp: new Date().toISOString(), 10 | message: 'OpenResearch Worker is running' 11 | }), { 12 | headers: { 'Content-Type': 'application/json' } 13 | }); 14 | } 15 | 16 | return new Response(JSON.stringify({ 17 | message: 'OpenResearch Worker API', 18 | endpoints: { 19 | health: '/health' 20 | } 21 | }), { 22 | headers: { 'Content-Type': 'application/json' } 23 | }); 24 | } 25 | }; -------------------------------------------------------------------------------- /gui/src/App.css: -------------------------------------------------------------------------------- 1 | #root { 2 | max-width: 1280px; 3 | margin: 0 auto; 4 | padding: 2rem; 5 | text-align: center; 6 | } 7 | 8 | .logo { 9 | height: 6em; 10 | padding: 1.5em; 11 | will-change: filter; 12 | transition: filter 300ms; 13 | } 14 | .logo:hover { 15 | filter: drop-shadow(0 0 2em #646cffaa); 16 | } 17 | .logo.react:hover { 18 | filter: drop-shadow(0 0 2em #61dafbaa); 19 | } 20 | 21 | @keyframes logo-spin { 22 | from { 23 | transform: rotate(0deg); 24 | } 25 | to { 26 | transform: rotate(360deg); 27 | } 28 | } 29 | 30 | @media (prefers-reduced-motion: no-preference) { 31 | a:nth-of-type(2) .logo { 32 | animation: logo-spin infinite 20s linear; 33 | } 34 | } 35 | 36 | .card { 37 | padding: 2em; 38 | } 39 | 40 | .read-the-docs { 41 | color: #888; 42 | } 43 | -------------------------------------------------------------------------------- /gui/src/services/TaskQueue.js: -------------------------------------------------------------------------------- 1 | // Simple task queue implementation 2 | class TaskQueue { 3 | constructor() { 4 | this.queue = [] 5 | } 6 | 7 | enqueue(task) { 8 | this.queue.push({ 9 | ...task, 10 | queuedAt: new Date().toISOString() 11 | }) 12 | console.log(`Task queued: ${task.title}`) 13 | } 14 | 15 | dequeue() { 16 | const task = this.queue.shift() 17 | if (task) { 18 | console.log(`Task dequeued: ${task.title}`) 19 | } 20 | return task 21 | } 22 | 23 | hasNext() { 24 | return this.queue.length > 0 25 | } 26 | 27 | size() { 28 | return this.queue.length 29 | } 30 | 31 | clear() { 32 | this.queue = [] 33 | } 34 | 35 | getAll() { 36 | return [...this.queue] 37 | } 38 | } 39 | 40 | export default new TaskQueue() -------------------------------------------------------------------------------- /ui/src/App.css: -------------------------------------------------------------------------------- 1 | #root { 2 | max-width: 1280px; 3 | margin: 0 auto; 4 | padding: 2rem; 5 | text-align: center; 6 | } 7 | 8 | .logo { 9 | height: 6em; 10 | padding: 1.5em; 11 | will-change: filter; 12 | transition: filter 300ms; 13 | } 14 | .logo:hover { 15 | filter: drop-shadow(0 0 2em #646cffaa); 16 | } 17 | .logo.react:hover { 18 | filter: drop-shadow(0 0 2em #61dafbaa); 19 | } 20 | 21 | @keyframes logo-spin { 22 | from { 23 | transform: rotate(0deg); 24 | } 25 | to { 26 | transform: rotate(360deg); 27 | } 28 | } 29 | 30 | @media (prefers-reduced-motion: no-preference) { 31 | a:nth-of-type(2) .logo { 32 | animation: logo-spin infinite 20s linear; 33 | } 34 | } 35 | 36 | .card { 37 | padding: 2em; 38 | } 39 | 40 | .read-the-docs { 41 | color: #888; 42 | } 43 | -------------------------------------------------------------------------------- /ui/src/services/TaskQueue.js: -------------------------------------------------------------------------------- 1 | // Simple task queue implementation 2 | class TaskQueue { 3 | constructor() { 4 | this.queue = [] 5 | } 6 | 7 | enqueue(task) { 8 | this.queue.push({ 9 | ...task, 10 | queuedAt: new Date().toISOString() 11 | }) 12 | console.log(`Task queued: ${task.title}`) 13 | } 14 | 15 | dequeue() { 16 | const task = this.queue.shift() 17 | if (task) { 18 | console.log(`Task dequeued: ${task.title}`) 19 | } 20 | return task 21 | } 22 | 23 | hasNext() { 24 | return this.queue.length > 0 25 | } 26 | 27 | size() { 28 | return this.queue.length 29 | } 30 | 31 | clear() { 32 | this.queue = [] 33 | } 34 | 35 | getAll() { 36 | return [...this.queue] 37 | } 38 | } 39 | 40 | export default new TaskQueue() -------------------------------------------------------------------------------- /ui/src/App.jsx: -------------------------------------------------------------------------------- 1 | import { WorkflowProvider } from './context/WorkflowContext' 2 | import Header from './components/Header' 3 | import TopicInput from './components/TopicInput' 4 | import PlanningPhase from './components/PlanningPhase' 5 | import ExecutionPhase from './components/ExecutionPhase' 6 | import ReportComposition from './components/ReportComposition' 7 | 8 | function App() { 9 | return ( 10 | 11 |
12 |
13 |
14 |
15 | 16 | 17 | 18 | 19 |
20 |
21 |
22 |
23 | ) 24 | } 25 | 26 | export default App -------------------------------------------------------------------------------- /gui/src/components/Header.jsx: -------------------------------------------------------------------------------- 1 | const Header = () => { 2 | return ( 3 |
4 |

5 | AI Research Planning Platform 6 |

7 |

8 | Generate comprehensive research plans using Gemini AI 9 |

10 |
11 |
12 | Phase 1: AI Research Planning 13 |
14 |
15 | Powered by Google Gemini • Enter your topic to generate a research plan 16 |
17 |
18 | ) 19 | } 20 | 21 | export default Header -------------------------------------------------------------------------------- /ui/src/components/Header.jsx: -------------------------------------------------------------------------------- 1 | const Header = () => { 2 | return ( 3 |
4 |

5 | AI Research Planning Platform 6 |

7 |

8 | Generate comprehensive research plans using Gemini AI 9 |

10 |
11 |
12 | Phase 1: AI Research Planning 13 |
14 |
15 | Powered by Google Gemini • Enter your topic to generate a research plan 16 |
17 |
18 | ) 19 | } 20 | 21 | export default Header -------------------------------------------------------------------------------- /ui/eslint.config.js: -------------------------------------------------------------------------------- 1 | import js from '@eslint/js' 2 | import globals from 'globals' 3 | import reactHooks from 'eslint-plugin-react-hooks' 4 | import reactRefresh from 'eslint-plugin-react-refresh' 5 | import { defineConfig, globalIgnores } from 'eslint/config' 6 | 7 | export default defineConfig([ 8 | globalIgnores(['dist']), 9 | { 10 | files: ['**/*.{js,jsx}'], 11 | extends: [ 12 | js.configs.recommended, 13 | reactHooks.configs['recommended-latest'], 14 | reactRefresh.configs.vite, 15 | ], 16 | languageOptions: { 17 | ecmaVersion: 2020, 18 | globals: globals.browser, 19 | parserOptions: { 20 | ecmaVersion: 'latest', 21 | ecmaFeatures: { jsx: true }, 22 | sourceType: 'module', 23 | }, 24 | }, 25 | rules: { 26 | 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }], 27 | }, 28 | }, 29 | ]) 30 | -------------------------------------------------------------------------------- /gui/eslint.config.js: -------------------------------------------------------------------------------- 1 | import js from '@eslint/js' 2 | import globals from 'globals' 3 | import reactHooks from 'eslint-plugin-react-hooks' 4 | import reactRefresh from 'eslint-plugin-react-refresh' 5 | import { defineConfig, globalIgnores } from 'eslint/config' 6 | 7 | export default defineConfig([ 8 | globalIgnores(['dist']), 9 | { 10 | files: ['**/*.{js,jsx}'], 11 | extends: [ 12 | js.configs.recommended, 13 | reactHooks.configs['recommended-latest'], 14 | reactRefresh.configs.vite, 15 | ], 16 | languageOptions: { 17 | ecmaVersion: 2020, 18 | globals: globals.browser, 19 | parserOptions: { 20 | ecmaVersion: 'latest', 21 | ecmaFeatures: { jsx: true }, 22 | sourceType: 'module', 23 | }, 24 | }, 25 | rules: { 26 | 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }], 27 | }, 28 | }, 29 | ]) 30 | -------------------------------------------------------------------------------- /ui/src/types/index.js: -------------------------------------------------------------------------------- 1 | // Workflow States 2 | export const WORKFLOW_PHASES = { 3 | TOPIC_INPUT: 'topic_input', 4 | PLANNING: 'planning', 5 | PLAN_CONFIRMATION: 'plan_confirmation', 6 | EXECUTION: 'execution', 7 | SYNTHESIS: 'synthesis', 8 | COMPOSITION: 'composition', 9 | COMPLETE: 'complete' 10 | } 11 | 12 | // Task Types 13 | export const TASK_TYPES = { 14 | LITERATURE_REVIEW: 'literature_review', 15 | CURRENT_DATA: 'current_data', 16 | EXPERT_ANALYSIS: 'expert_analysis', 17 | COMPARATIVE_STUDY: 'comparative_study', 18 | WEB_SEARCH: 'web_search', 19 | RAG_QUERY: 'rag_query', 20 | MCP_DATA: 'mcp_data' 21 | } 22 | 23 | // Card Types 24 | export const CARD_TYPES = { 25 | TEXT_SUMMARY: 'text_summary', 26 | CHART: 'chart', 27 | TABLE: 'table', 28 | QUOTE: 'quote', 29 | IMAGE: 'image' 30 | } 31 | 32 | // Agent Types 33 | export const AGENT_TYPES = { 34 | WEB: 'web', 35 | RAG: 'rag', 36 | MCP: 'mcp' 37 | } -------------------------------------------------------------------------------- /gui/src/types/index.js: -------------------------------------------------------------------------------- 1 | // Workflow States 2 | export const WORKFLOW_PHASES = { 3 | TOPIC_INPUT: 'topic_input', 4 | PLANNING: 'planning', 5 | PLAN_CONFIRMATION: 'plan_confirmation', 6 | EXECUTION: 'execution', 7 | SYNTHESIS: 'synthesis', 8 | COMPOSITION: 'composition', 9 | COMPLETE: 'complete' 10 | } 11 | 12 | // Task Types 13 | export const TASK_TYPES = { 14 | LITERATURE_REVIEW: 'literature_review', 15 | CURRENT_DATA: 'current_data', 16 | EXPERT_ANALYSIS: 'expert_analysis', 17 | COMPARATIVE_STUDY: 'comparative_study', 18 | WEB_SEARCH: 'web_search', 19 | RAG_QUERY: 'rag_query', 20 | MCP_DATA: 'mcp_data' 21 | } 22 | 23 | // Card Types 24 | export const CARD_TYPES = { 25 | TEXT_SUMMARY: 'text_summary', 26 | CHART: 'chart', 27 | TABLE: 'table', 28 | QUOTE: 'quote', 29 | IMAGE: 'image' 30 | } 31 | 32 | // Agent Types 33 | export const AGENT_TYPES = { 34 | WEB: 'web', 35 | RAG: 'rag', 36 | MCP: 'mcp' 37 | } -------------------------------------------------------------------------------- /gui/worker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "openresearch-worker", 3 | "version": "1.0.0", 4 | "private": true, 5 | "type": "module", 6 | "scripts": { 7 | "dev": "wrangler dev", 8 | "deploy": "wrangler deploy", 9 | "db:create": "wrangler d1 create openresearch-db", 10 | "db:migrate": "wrangler d1 migrations apply openresearch-db", 11 | "db:migrate-local": "wrangler d1 migrations apply openresearch-db --local", 12 | "vectorize:create": "wrangler vectorize create research-embeddings --dimensions=768 --metric=cosine", 13 | "r2:create-reports": "wrangler r2 bucket create openresearch-reports", 14 | "r2:create-assets": "wrangler r2 bucket create openresearch-assets", 15 | "setup": "npm run db:create && npm run vectorize:create && npm run r2:create-reports && npm run r2:create-assets" 16 | }, 17 | "dependencies": { 18 | "uuid": "^9.0.1" 19 | }, 20 | "devDependencies": { 21 | "@cloudflare/workers-types": "^4.20241218.0", 22 | "wrangler": "^3.92.0" 23 | } 24 | } -------------------------------------------------------------------------------- /example/earnings_call/task_microsoft_earnings_call_20250731_100000.md: -------------------------------------------------------------------------------- 1 | - [x] Identify the latest earnings call date. 2 | - [x] Search for official earnings release and transcript. 3 | - [x] Download/Access relevant documents (Earnings press release, Earnings call transcript, Investor presentation, 10-Q or 10-K filing). 4 | - [x] Extract and analyze Key Financial Metrics (Revenue, Net Income & EPS, Gross Margin, Operating Income, Net Margin, Cash Flow). 5 | - [x] Perform Segment Performance Deep Dive (Productivity and Business Processes, Intelligent Cloud, More Personal Computing). 6 | - [x] Identify Growth Drivers and Challenges. 7 | - [x] Analyze Management Commentary and Future Outlook (Guidance, Strategic Priorities, Macroeconomic Impact). 8 | - [x] Search for Analyst Reactions and Market Response. 9 | - [x] Compose the report in markdown format (report_microsoft_earnings_call_20250731.md). 10 | - [x] Craft a bilingual webpage (vis_microsoft_earnings_call_20250731.html) based on the report and `vis.md` instructions. -------------------------------------------------------------------------------- /ui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ui", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint .", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "@google/genai": "^1.12.0", 14 | "@mdx-js/react": "^3.1.0", 15 | "@mdx-js/rollup": "^3.1.0", 16 | "react": "^19.1.0", 17 | "react-dom": "^19.1.0", 18 | "reactflow": "^11.11.4" 19 | }, 20 | "devDependencies": { 21 | "@eslint/js": "^9.30.1", 22 | "@tailwindcss/postcss": "^4.1.11", 23 | "@types/react": "^19.1.9", 24 | "@types/react-dom": "^19.1.6", 25 | "@vitejs/plugin-react": "^4.6.0", 26 | "autoprefixer": "^10.4.21", 27 | "eslint": "^9.30.1", 28 | "eslint-plugin-react-hooks": "^5.2.0", 29 | "eslint-plugin-react-refresh": "^0.4.20", 30 | "globals": "^16.3.0", 31 | "postcss": "^8.5.6", 32 | "tailwindcss": "^4.1.11", 33 | "vite": "^7.0.4" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /gui/src/content/sample-report.mdx: -------------------------------------------------------------------------------- 1 | # Sample Research Report 2 | 3 | This is an example of how the **Phase 2: Composition** phase would work with MDX content. 4 | 5 | ## Research Overview 6 | 7 | The AI Research Planning Platform successfully generated the following insights: 8 | 9 | ### Key Findings 10 | 11 | - **Data Point 1**: Statistical analysis shows significant trends 12 | - **Data Point 2**: Comparative analysis reveals important patterns 13 | - **Data Point 3**: Expert opinions align with quantitative data 14 | 15 | ## Interactive Components 16 | 17 | You can embed React components directly in MDX: 18 | 19 | ```jsx 20 | 25 | ``` 26 | 27 | ## Conclusion 28 | 29 | The two-phase approach effectively balances AI automation with human oversight, ensuring high-quality research outputs. 30 | 31 | --- 32 | 33 | *This report was generated using the AI Research Planning Platform* -------------------------------------------------------------------------------- /ui/src/content/sample-report.mdx: -------------------------------------------------------------------------------- 1 | # Sample Research Report 2 | 3 | This is an example of how the **Phase 2: Composition** phase would work with MDX content. 4 | 5 | ## Research Overview 6 | 7 | The AI Research Planning Platform successfully generated the following insights: 8 | 9 | ### Key Findings 10 | 11 | - **Data Point 1**: Statistical analysis shows significant trends 12 | - **Data Point 2**: Comparative analysis reveals important patterns 13 | - **Data Point 3**: Expert opinions align with quantitative data 14 | 15 | ## Interactive Components 16 | 17 | You can embed React components directly in MDX: 18 | 19 | ```jsx 20 | 25 | ``` 26 | 27 | ## Conclusion 28 | 29 | The two-phase approach effectively balances AI automation with human oversight, ensuring high-quality research outputs. 30 | 31 | --- 32 | 33 | *This report was generated using the AI Research Planning Platform* -------------------------------------------------------------------------------- /gui/wrangler.toml.example: -------------------------------------------------------------------------------- 1 | name = "openresearch-worker" 2 | main = "worker/src/index.js" 3 | compatibility_date = "2025-01-15" 4 | compatibility_flags = ["nodejs_compat"] 5 | 6 | # Environment variables 7 | [vars] 8 | ENVIRONMENT = "production" 9 | 10 | # D1 Database bindings 11 | [[d1_databases]] 12 | binding = "DB" 13 | database_name = "openresearch-db" 14 | database_id = 15 | 16 | # Vectorize binding for embeddings 17 | [[vectorize]] 18 | binding = "VECTORIZE" 19 | index_name = "research-embeddings" 20 | 21 | # Workers AI binding for embeddings 22 | [ai] 23 | binding = "AI" 24 | 25 | # R2 bucket bindings 26 | [[r2_buckets]] 27 | binding = "REPORTS_BUCKET" 28 | bucket_name = "openresearch-reports" 29 | 30 | [[r2_buckets]] 31 | binding = "ASSETS_BUCKET" 32 | bucket_name = "openresearch-assets" 33 | 34 | # KV for caching (optional) - commented out until needed 35 | # [[kv_namespaces]] 36 | # binding = "CACHE" 37 | # id = "your_kv_namespace_id" 38 | # preview_id = "your_preview_kv_namespace_id" 39 | 40 | # Note: No secrets needed - Cloudflare AI is built-in -------------------------------------------------------------------------------- /example/earnings_call/vis_ebay_earnings_call_20250731.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | eBay Q2 2025 Earnings Call Visualization 5 | 20 | 21 | 22 | 23 |

eBay Q2 2025 Earnings Call Key Financials

24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 |
MetricValue
Revenue$2.73 billion
Non-GAAP Operating Income$775 million
Non-GAAP EPS$1.37
Net Income$368 million
Shareholder Returns$760 million
Gross Merchandise Volume (GMV)4% increase
55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /daily/reports/20250729/task_20250729100000.md: -------------------------------------------------------------------------------- 1 | # To-Do List for Daily Financial Market Report - 2025-07-29 2 | 3 | **Last Trading Day: 2025-07-28** 4 | 5 | ## Markdown Report Generation (report_20250729100000.md) 6 | 7 | - [ ] Search and fetch the latest performance of indexes like the Dow, S&P 500, Nasdaq of 2025-07-28 closing price. 8 | - [ ] Search and fetch the latest performance of commodities like oil and gold, and also crypto currencies of 2025-07-28 closing price. 9 | - [ ] Search and analyze the factors impacting the latest moves. 10 | - [ ] Search and analyze the performance of flagged stocks such as the Magnificent 7, banks, energy, manufactory and consumer-related stocks. 11 | - [ ] Search and fetch other top movers in both sectors and stocks within the US stock market. 12 | - [ ] Search and analyze upcoming events that may impact the market. 13 | - [ ] Search and analyze the short-term factors that impact the mood of market and do predictions. 14 | 15 | ## Single HTML File Generation (vis_20250729100000.html) 16 | 17 | - [ ] Follow the style instruction in @vis.md. 18 | - [ ] Implement bilingual language support of English and Simplified Chinese. 19 | - [ ] Implement a language toggle button on top right. -------------------------------------------------------------------------------- /daily/reports/20250730/task_20250730100000.md: -------------------------------------------------------------------------------- 1 | # To-Do List for 2025-07-30 2 | 3 | - [x] **Market Data Collection (Last Trading Day: 2025-07-29)** 4 | - [x] Fetch closing prices for Dow, S&P 500, and Nasdaq. 5 | - [x] Fetch closing prices for oil and gold. 6 | - [x] Fetch closing prices for major cryptocurrencies (Bitcoin, Ethereum). 7 | - [x] **Market Analysis** 8 | - [x] Analyze factors impacting recent market moves. 9 | - [x] Analyze performance of the Magnificent 7, banks, energy, manufacturing, and consumer stocks. 10 | - [x] Identify and analyze top moving sectors and stocks in the US market. 11 | - [x] Research and analyze upcoming market-moving events. 12 | - [x] Analyze short-term market sentiment and provide predictions. 13 | - [x] **Report Generation** 14 | - [x] Draft the markdown report (`report_20250730100000.md`). 15 | - [x] **Webpage Generation** 16 | - [x] Generate the HTML report (`vis_20250730100000.html`) with bilingual support and a language toggle, following the style guide in `vis.md`. 17 | - [x] **Logging** 18 | - [x] Log all steps in `log_20250730100000.md`. 19 | - [x] **Review** 20 | - [x] Review all generated files for accuracy and completeness. 21 | -------------------------------------------------------------------------------- /daily/reports/20250731/task_20250731100000.md: -------------------------------------------------------------------------------- 1 | # To-Do List for 2025-07-31 2 | 3 | ## Step 1: Plan and Gen To-Do List 4 | - [x] Create this to-do list. 5 | 6 | ## Step 2: Markdown Report Generation 7 | - [ ] Search and fetch the latest performance of indexes like the Dow, S&P 500, Nasdaq of 2025-07-30 closing price and daily chg in %. 8 | - [ ] Search and fetch the latest performance of commodities like oil and gold, and also crypto currencies of 2025-07-30 closing price and daily chg in %. 9 | - [ ] Search and analyze the factors impacting the latest moves. 10 | - [ ] Search and analyze the performance of flagged stocks such as the Magnificent 7, banks, enengy, manufactory and consumer-related stocks. 11 | - [ ] Seacrh and fetch other top movers in both sectors and stocks within the US stock market. 12 | - [ ] Search and analyze upcoming events that may impact the market. 13 | - [ ] Search and analyze the short-term factors that impact the mood of market and do predictions. 14 | 15 | ## Step 3: Single HTML File Generation 16 | - [ ] Generate a single html names `reports/20250731/vis_20250731100000.html` with bilingual support and a language toggle. 17 | 18 | ## Step 4: Execution and Logging 19 | - [ ] Log the whole process in file `reports/20250731/log_20250731100000.md`. 20 | 21 | ## Step 5: Review 22 | - [ ] Review the generated files to end the whole task. 23 | -------------------------------------------------------------------------------- /gui/src/services/PlannerService.js: -------------------------------------------------------------------------------- 1 | import LLMAbstractionLayer from './LLMAbstractionLayer' 2 | import { TASK_TYPES } from '../types' 3 | 4 | class PlannerService { 5 | async createResearchPlan(topic) { 6 | if (!topic.trim()) { 7 | throw new Error('Topic is required') 8 | } 9 | 10 | try { 11 | const plan = await LLMAbstractionLayer.generateResearchPlan(topic) 12 | return this.validatePlan(plan) 13 | } catch (error) { 14 | console.error('Error creating research plan:', error) 15 | throw new Error('Failed to create research plan') 16 | } 17 | } 18 | 19 | validatePlan(plan) { 20 | if (!plan.tasks || plan.tasks.length === 0) { 21 | throw new Error('Plan must contain at least one task') 22 | } 23 | 24 | // Validate each task 25 | plan.tasks.forEach(task => { 26 | if (!task.type || !Object.values(TASK_TYPES).includes(task.type)) { 27 | throw new Error(`Invalid task type: ${task.type}`) 28 | } 29 | if (!task.title || !task.description) { 30 | throw new Error('Task must have title and description') 31 | } 32 | }) 33 | 34 | return plan 35 | } 36 | 37 | async updatePlan(planId, updates) { 38 | // In real implementation, would update plan in database 39 | return { ...updates, id: planId, updatedAt: new Date().toISOString() } 40 | } 41 | } 42 | 43 | export default new PlannerService() -------------------------------------------------------------------------------- /ui/src/services/PlannerService.js: -------------------------------------------------------------------------------- 1 | import LLMAbstractionLayer from './LLMAbstractionLayer' 2 | import { TASK_TYPES } from '../types' 3 | 4 | class PlannerService { 5 | async createResearchPlan(topic) { 6 | if (!topic.trim()) { 7 | throw new Error('Topic is required') 8 | } 9 | 10 | try { 11 | const plan = await LLMAbstractionLayer.generateResearchPlan(topic) 12 | return this.validatePlan(plan) 13 | } catch (error) { 14 | console.error('Error creating research plan:', error) 15 | throw new Error('Failed to create research plan') 16 | } 17 | } 18 | 19 | validatePlan(plan) { 20 | if (!plan.tasks || plan.tasks.length === 0) { 21 | throw new Error('Plan must contain at least one task') 22 | } 23 | 24 | // Validate each task 25 | plan.tasks.forEach(task => { 26 | if (!task.type || !Object.values(TASK_TYPES).includes(task.type)) { 27 | throw new Error(`Invalid task type: ${task.type}`) 28 | } 29 | if (!task.title || !task.description) { 30 | throw new Error('Task must have title and description') 31 | } 32 | }) 33 | 34 | return plan 35 | } 36 | 37 | async updatePlan(planId, updates) { 38 | // In real implementation, would update plan in database 39 | return { ...updates, id: planId, updatedAt: new Date().toISOString() } 40 | } 41 | } 42 | 43 | export default new PlannerService() -------------------------------------------------------------------------------- /gui/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /example/earnings_call/planning_ford_earnings_call_20250731.md: -------------------------------------------------------------------------------- 1 | # Planning: Ford Motor Q2 2025 Earnings Call Research 2 | 3 | ## Objective 4 | To conduct a deep research on Ford Motor Company's Q2 2025 earnings call, synthesizing key financial highlights, segment performance, and future outlook into a comprehensive report. 5 | 6 | ## Data Sources 7 | - Web search results for "Ford Motor latest earnings call" (already performed). 8 | - Official Ford Motor Company investor relations website (if more detailed information is needed). 9 | 10 | ## Report Structure (based on instruct.md) 11 | 1. **Executive Summary:** 12 | * Brief overview of Q2 2025 performance. 13 | * Key financial metrics (EPS, Revenue). 14 | * Overall sentiment. 15 | 2. **Financial Highlights:** 16 | * Detailed EPS and Revenue figures vs. estimates. 17 | * Dividend declaration. 18 | 3. **Segment Performance:** 19 | * Ford Pro EBIT. 20 | * Ford Blue EBIT. 21 | * Ford Model e EBIT. 22 | * Ford Credit earnings. 23 | 4. **Key Takeaways & Future Outlook:** 24 | * Reinstated full-year 2025 guidance. 25 | * Impact of tariff-related costs. 26 | * Any other significant announcements or forward-looking statements. 27 | 5. **Conclusion:** 28 | * Summary of findings and overall assessment. 29 | 30 | ## Next Steps 31 | 1. Create log file with raw search results. 32 | 2. Draft the research report based on the above structure and gathered information. 33 | 3. Review and refine the report for clarity, accuracy, and completeness. -------------------------------------------------------------------------------- /example/earnings_call/task_ebay_earnings_call_20250731_100000.md: -------------------------------------------------------------------------------- 1 | # Task for eBay Q2 2025 Earnings Call Research 2 | 3 | ## Objective 4 | 5 | To conduct a deep research on eBay's Q2 2025 earnings call, summarizing key financial highlights, growth drivers, forward-looking guidance, and stock performance. 6 | 7 | ## Tasks Performed 8 | 9 | 1. **Searched for Earnings Call Transcript:** Used Google Web Search with queries like "ebay latest earnings call transcript" and "eBay Q2 2025 earnings call transcript Investing.com" to find relevant information. 10 | 2. **Extracted Key Financial Metrics:** Identified and recorded revenue, non-GAAP operating income, non-GAAP EPS, net income, shareholder returns, and GMV from the search results. 11 | 3. **Identified Growth Drivers:** Noted AI-driven initiatives and strategic partnerships as key contributors to growth, along with strong performance in collectibles and luxury items. 12 | 4. **Extracted Forward-Looking Guidance:** Recorded the projected revenue for Q3 2025. 13 | 5. **Noted Stock Performance:** Observed the 1.2% stock decline post-earnings. 14 | 6. **Generated Report:** Created `report_ebay_earnings_call_20250731.md` summarizing all findings. 15 | 7. **Generated Planning Document:** Created `planning_ebay_earnings_call_20250731.md` outlining the research plan. 16 | 8. **Generated Task Document:** Created this document (`task_ebay_earnings_call_20250731_100000.md`). 17 | 9. **Generated Log Document:** Created `log_ebay_earnings_call_20250731_100000.md` detailing all tool calls. 18 | 10. **Generated Visualization:** Created `vis_ebay_earnings_call_20250731.html` with a basic table of financial metrics. 19 | -------------------------------------------------------------------------------- /gui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ui", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint .", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "@google/genai": "^1.12.0", 14 | "@google/generative-ai": "^0.24.1", 15 | "@mdx-js/react": "^3.1.0", 16 | "@mdx-js/rollup": "^3.1.0", 17 | "@tiptap/extension-code-block-lowlight": "^3.2.0", 18 | "@tiptap/extension-color": "^3.2.0", 19 | "@tiptap/extension-highlight": "^3.2.0", 20 | "@tiptap/extension-image": "^3.2.0", 21 | "@tiptap/extension-link": "^3.2.0", 22 | "@tiptap/extension-table": "^3.2.0", 23 | "@tiptap/extension-table-cell": "^3.2.0", 24 | "@tiptap/extension-table-header": "^3.2.0", 25 | "@tiptap/extension-table-row": "^3.2.0", 26 | "@tiptap/extension-text-style": "^3.2.0", 27 | "@tiptap/react": "^3.2.0", 28 | "@tiptap/starter-kit": "^3.2.0", 29 | "dotenv": "^17.2.1", 30 | "jszip": "^3.10.1", 31 | "lowlight": "^3.3.0", 32 | "react": "^19.1.0", 33 | "react-dom": "^19.1.0", 34 | "react-router-dom": "^7.8.1", 35 | "reactflow": "^11.11.4" 36 | }, 37 | "devDependencies": { 38 | "@eslint/js": "^9.30.1", 39 | "@tailwindcss/postcss": "^4.1.11", 40 | "@types/react": "^19.1.9", 41 | "@types/react-dom": "^19.1.6", 42 | "@vitejs/plugin-react": "^4.6.0", 43 | "autoprefixer": "^10.4.21", 44 | "eslint": "^9.30.1", 45 | "eslint-plugin-react-hooks": "^5.2.0", 46 | "eslint-plugin-react-refresh": "^0.4.20", 47 | "globals": "^16.3.0", 48 | "postcss": "^8.5.6", 49 | "tailwindcss": "^4.1.11", 50 | "vite": "^7.0.4" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /gui/src/services/CardSynthesizer.js: -------------------------------------------------------------------------------- 1 | import LLMAbstractionLayer from './LLMAbstractionLayer' 2 | import { CARD_TYPES } from '../types' 3 | 4 | class CardSynthesizer { 5 | async synthesize(rawData, taskType) { 6 | console.log(`Synthesizing card from ${taskType} data:`, rawData.title) 7 | 8 | // Determine appropriate card type based on data 9 | const cardType = this.determineCardType(rawData, taskType) 10 | 11 | // Use LLM to synthesize the raw data into a structured card 12 | const card = await LLMAbstractionLayer.synthesizeCard(rawData, cardType) 13 | 14 | return { 15 | ...card, 16 | originalTask: taskType, 17 | rawData: rawData, 18 | synthesizedAt: new Date().toISOString() 19 | } 20 | } 21 | 22 | determineCardType(rawData, taskType) { 23 | // Simple heuristics to determine card type 24 | // In real implementation, would use more sophisticated analysis 25 | 26 | if (rawData.data?.results?.length > 0) { 27 | return CARD_TYPES.TEXT_SUMMARY 28 | } 29 | 30 | if (rawData.data?.records?.length > 0) { 31 | return CARD_TYPES.TABLE 32 | } 33 | 34 | if (rawData.source === 'web_search') { 35 | return CARD_TYPES.TEXT_SUMMARY 36 | } 37 | 38 | return CARD_TYPES.TEXT_SUMMARY 39 | } 40 | 41 | async createCustomCard(type, content, metadata = {}) { 42 | return { 43 | id: Date.now(), 44 | type, 45 | title: content.title || 'Custom Card', 46 | content: content.body || content.text || '', 47 | metadata: { 48 | ...metadata, 49 | createdAt: new Date().toISOString(), 50 | source: 'manual' 51 | } 52 | } 53 | } 54 | } 55 | 56 | export default new CardSynthesizer() -------------------------------------------------------------------------------- /ui/src/services/CardSynthesizer.js: -------------------------------------------------------------------------------- 1 | import LLMAbstractionLayer from './LLMAbstractionLayer' 2 | import { CARD_TYPES } from '../types' 3 | 4 | class CardSynthesizer { 5 | async synthesize(rawData, taskType) { 6 | console.log(`Synthesizing card from ${taskType} data:`, rawData.title) 7 | 8 | // Determine appropriate card type based on data 9 | const cardType = this.determineCardType(rawData, taskType) 10 | 11 | // Use LLM to synthesize the raw data into a structured card 12 | const card = await LLMAbstractionLayer.synthesizeCard(rawData, cardType) 13 | 14 | return { 15 | ...card, 16 | originalTask: taskType, 17 | rawData: rawData, 18 | synthesizedAt: new Date().toISOString() 19 | } 20 | } 21 | 22 | determineCardType(rawData, taskType) { 23 | // Simple heuristics to determine card type 24 | // In real implementation, would use more sophisticated analysis 25 | 26 | if (rawData.data?.results?.length > 0) { 27 | return CARD_TYPES.TEXT_SUMMARY 28 | } 29 | 30 | if (rawData.data?.records?.length > 0) { 31 | return CARD_TYPES.TABLE 32 | } 33 | 34 | if (rawData.source === 'web_search') { 35 | return CARD_TYPES.TEXT_SUMMARY 36 | } 37 | 38 | return CARD_TYPES.TEXT_SUMMARY 39 | } 40 | 41 | async createCustomCard(type, content, metadata = {}) { 42 | return { 43 | id: Date.now(), 44 | type, 45 | title: content.title || 'Custom Card', 46 | content: content.body || content.text || '', 47 | metadata: { 48 | ...metadata, 49 | createdAt: new Date().toISOString(), 50 | source: 'manual' 51 | } 52 | } 53 | } 54 | } 55 | 56 | export default new CardSynthesizer() -------------------------------------------------------------------------------- /example/earnings_call/planning_ebay_earnings_call_20250731.md: -------------------------------------------------------------------------------- 1 | # Planning for eBay Q2 2025 Earnings Call Research 2 | 3 | ## Objective 4 | 5 | To conduct a deep research on eBay's Q2 2025 earnings call, summarizing key financial highlights, growth drivers, forward-looking guidance, and stock performance. 6 | 7 | ## Information Gathering 8 | 9 | 1. **Search for Earnings Call Transcript:** Utilize Google Web Search to find the official earnings call transcript and related news articles. 10 | 2. **Identify Key Financial Metrics:** Extract revenue, EPS, net income, operating income, GMV, and shareholder returns. 11 | 3. **Identify Growth Drivers:** Note down any mentioned strategic initiatives, AI-driven efforts, or specific categories contributing to growth. 12 | 4. **Extract Forward-Looking Guidance:** Record revenue projections for the next quarter. 13 | 5. **Note Stock Performance:** Observe immediate stock reaction post-earnings release. 14 | 15 | ## Output Generation 16 | 17 | 1. **Report (`report_ebay_earnings_call_20250731.md`):** Create a markdown report summarizing all gathered information, including an executive summary, financial highlights, growth drivers, guidance, and stock performance. 18 | 2. **Planning Document (`planning_ebay_earnings_call_20250731.md`):** This document, outlining the research plan. 19 | 3. **Task Document (`task_ebay_earnings_call_20250731_HHMMSS.md`):** A markdown file detailing the specific tasks performed during the research. 20 | 4. **Log Document (`log_ebay_earnings_call_20250731_HHMMSS.md`):** A markdown file logging all steps and tool calls made during the research process. 21 | 5. **Visualization (`vis_ebay_earnings_call_20250731.html`):** A simple HTML file to visualize key data points if applicable (e.g., a basic table of financial metrics). -------------------------------------------------------------------------------- /example/earnings_call/report_ebay_earnings_call_20250731.md: -------------------------------------------------------------------------------- 1 | # eBay Q2 2025 Earnings Call Report 2 | 3 | **Date:** July 31, 2025 4 | 5 | ## Executive Summary 6 | 7 | eBay reported strong financial results for Q2 2025, exceeding analyst expectations for both revenue and earnings per share (EPS). The company highlighted growth driven by AI-driven initiatives and strategic partnerships, with particular strength in focus categories such as collectibles and luxury items. Despite the positive financial performance, the stock experienced a slight decline post-earnings. 8 | 9 | ## Financial Highlights 10 | 11 | * **Revenue:** Grew by over 4% to $2.73 billion, surpassing the anticipated $2.64 billion. 12 | * **Non-GAAP Operating Income:** Increased by 8% to $775 million. 13 | * **Non-GAAP EPS:** Grew 16% year-over-year to $1.37, exceeding analysts' expectations of $1.30 per share. 14 | * **Net Income:** $368 million, or $0.79 per share, compared to $224 million, or $0.45 per share, in the same period last year. 15 | * **Shareholder Returns:** The company returned $760 million to shareholders through repurchases and dividends. 16 | * **Gross Merchandise Volume (GMV):** Increased by 4%. 17 | 18 | ## Key Growth Drivers and Strategic Initiatives 19 | 20 | eBay's growth in Q2 2025 was attributed to: 21 | 22 | * **AI-driven initiatives:** Expansion in AI-driven initiatives contributed to overall growth. 23 | * **Strategic partnerships:** New partnerships played a role in the company's performance. 24 | * **Focus Categories:** Strong performance was observed in key focus categories, particularly collectibles and luxury items. 25 | 26 | ## Forward-Looking Guidance 27 | 28 | For Q3 2025, eBay projects revenue to be between $2.69 billion and $2.74 billion. 29 | 30 | ## Stock Performance 31 | 32 | Despite the robust financial results, eBay's stock fell 1.2% post-earnings. -------------------------------------------------------------------------------- /legacy/tarrif.md: -------------------------------------------------------------------------------- 1 | (1) Establish the context of the US-EU 15% tariff agreement by identifying the key goods and services traded between the two economic blocs and the main sectors involved in this trade relationship. 2 | (2) Analyze the sector-specific impacts within the United States. For key industries like automotive, aerospace, technology, agriculture, and pharmaceuticals, investigate how a 15% tariff would affect production costs, consumer prices, corporate profitability, and employment. 3 | (3) Conduct a parallel sector-specific analysis for the European Union, focusing on major export industries such as German automotive manufacturing, French luxury goods and aerospace, Italian machinery, and Irish pharmaceuticals. 4 | (4) Evaluate the differential economic impact on individual EU member states, particularly those with high trade exposure to the US, including Germany, France, Ireland, Italy, and the Netherlands. Detail which national industries are most vulnerable. 5 | (5) Research macroeconomic modeling studies from economic think tanks and international organizations to quantify the potential effects on GDP growth, inflation rates, and overall trade volumes for both the US and the EU. 6 | (6) Investigate the potential long-term strategic shifts in global trade and supply chains. Explore whether companies might relocate manufacturing and how the US and EU might pivot to new trade partners in regions like Asia-Pacific or South America. 7 | (7) Analyze the geopolitical consequences of such a tariff agreement, including its potential effects on the transatlantic political alliance, cooperation on international security, and the global standing of the WTO. 8 | (8) Synthesize all findings to construct a comprehensive overview of the agreement's impact. Critique the policy by identifying the likely economic winners and losers, and speculate on the net long-term effect on the global economic and political order. 9 | -------------------------------------------------------------------------------- /instruct.md: -------------------------------------------------------------------------------- 1 | You are a professional,efficient and creative analyst, now try to craft a deep research on the topic of user's prompt: [prompt] 2 | 3 | # Step 1: Planning 4 | Please go through the [prompt] and create a plan with highly detailed to-do list, write it to a markdown file planning_[keyword]_[yyyymmdd].md, in which [keyword] stands for a keyword you extract from the [prompt], and [yyyymmdd] for the current date; 5 | 6 | # Step 2: Iteration of the planning 7 | 1. Read the planning markdown file(planning_[keyword]_[yyyymmdd].md you create in step 1), create task_[keyword]_[yyyymmdd]_[hhmmss].md file of to-do list tasks for agents to follow, [hhmmss] for current time; 8 | 2. Follow the to-do tasks of task_[keyword]_[yyyymmdd]_[hhmmss].md, do the research following the plan step by step; 9 | 3. For each iteration, do recursion and update the to-do tasks(task_[keyword]_[yyyymmdd]_[hhmmss].md) with appending if possible; Ticker one task if finished; 10 | 4. Make sure you search and utilize the most recent information as possible(news, events, data, etc...); 11 | 5. For each search, save the url links as source for both report composing and logging; 12 | 13 | # Step 3: Report Composing 14 | Compose the report in markdown format with the filename:report_[keyword]_[yyyymmdd].md; 15 | Use tables with data as possible as you can; 16 | Please include sources both in content and appendix; 17 | 18 | # Step 4: Report Vis 19 | upon the report, craft a in-depth bilingual(English and Simplified Chinese, for all content including texts) webpage like newspaper frontpage with style instructions in @vis.md with output filename vis_[keyword]_[yyyymmdd].html , and please check carefully to avoid the unstoppable extending height of chart axis; 20 | 21 | # Logging: 22 | log details of each step, including what you thought, what you did, what source you searched, and other actions, write them into a log file in markdown format with the filename:log_[keyword]_[yyyymmdd]_[hhmmss].md 23 | 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 8月19日更新:全新优化的GUI 2 | - 目录:gui/ 3 | ## [说明]() 4 | ## [架构]() 5 | 6 | ## 主要介绍 7 | - 加入Cloudeflare后台 8 | - 加入Dashboard 9 | - 集成tiptap编辑器(简版) 10 | 11 | 12 | 13 | # 历史更新 14 | 15 | ## 8月5日大更新:加入UI界面 16 | ### 加入子项目UI:可视化研究界面 17 | ### 使用方法 18 | - cd ui 19 | - npm install 20 | - cp .env.example .env 21 | - 编辑.env,设置自己的Gemini APIKEY(可在Google AI Studio中申请) 22 | - 设置模型,默认使用'gemini-2.5-flash',在当前场景下,2.5-pro模型不能正常使用,可选项是2.5-flash和2.5-flash-lite 23 | - npm run dev 24 | - 访问 localhost:5173 25 | 26 | ### 终端下的一键式研究(目前,它还是质量更好的方式,可使用2.5-pro,在任务迭代上质量略高,同时目前工作流支持一键生成可视化报告) 27 | ##### 安装Gemini CLI :Mac or Linux (Windows需要使用WSL子系统) 28 | - 1. 安装Node:https://nodejs.org/en/download 安装Node.js, 需要20及以上版本 29 | - 2. 在命令行下安装 30 | ```shell 31 | npx https://github.com/google-gemini/gemini-cli 32 | ``` 33 | 或者 34 | ```shell 35 | npm install -g @google/gemini-cli 36 | ``` 37 | - 3. 运行 Gemini CLI 38 | ```shell 39 | gemini 40 | ``` 41 | 42 | - 4. 进行深度研究,在Gemini CLI客户端里输入: 43 | > do a deep reserch under the instruction prompted at @instruct.md: 【提示词,中英文均可】 44 | 45 | 例如 46 | 47 | > do a deep reserch under the instruction prompted at @instruct.md: impacts of us-euro's 15% tariff agreement: for each country, each sector, and long-term impacts and shifts 48 | 49 | ## examples/ 50 | 将日常研究结果加入,作为分享。 51 | 52 | ## 2025-7-31日更新: 53 | 加入instruct_v2.md,修改了机制,可以生成更长的报告内容,但是稳定性会差一些。 54 | 55 | ## 2025-7-29更新: 56 | 加入日报生成功能: daily/ 57 | 提示词:follow the instruct of @report.md to finish the report and webpage gen task 58 | 59 | 60 | 61 | # 未解决的bug: 62 | 在Gemini Cli中,如果使用flash模型,需要输入提示词两次:第一次程序读取了指定的文件,然后“自认为”任务完成了,需要再输入一次相同的提示词才可以继续进行工作。 63 | 64 | 65 | # 初衷,如果您会看到这里的话 66 | 自从Deep Research问世后,冠以“OpenResearch”的复刻项目琳琅满目,那么我为什么还要写这个名字?其实原因很简单: 67 | 1. 技术应该是越来越简单,我想尽可能用简单的方式来实现一些复杂的输出,特别是在这个AI时代; 68 | 2. Research没什么好神秘的,在这个时代,任何人应该都可以利用公开信息和合适的工具实现99%的“研究”需求; 69 | 综上,这是我理解的“Open”。 -------------------------------------------------------------------------------- /gui/src/App.jsx: -------------------------------------------------------------------------------- 1 | import { BrowserRouter as Router, Routes, Route } from 'react-router-dom' 2 | import { WorkflowProvider } from './context/WorkflowContext' 3 | import Navigation from './components/Navigation' 4 | import Header from './components/Header' 5 | import CloudStatus from './components/CloudStatus' 6 | import TopicInput from './components/TopicInput' 7 | import PlanningPhase from './components/PlanningPhase' 8 | import ExecutionPhase from './components/ExecutionPhase' 9 | import ReportComposition from './components/ReportComposition' 10 | import SearchPage from './components/SearchPage' 11 | import KnowledgeDashboard from './components/KnowledgeDashboard' 12 | import ProjectDetails from './components/ProjectDetails' 13 | import WYSIWYGReportEditor from './components/WYSIWYGReportEditor' 14 | 15 | // Main Research Workflow Page 16 | const ResearchPage = () => { 17 | return ( 18 |
19 |
20 | 21 |
22 | 23 | 24 | 25 | 26 |
27 |
28 | ) 29 | } 30 | 31 | function App() { 32 | return ( 33 | 34 | 35 |
36 | 37 | 38 | } /> 39 | } /> 40 | } /> 41 | } /> 42 | } /> 43 | } /> 44 | } /> 45 | 46 |
47 |
48 |
49 | ) 50 | } 51 | 52 | export default App -------------------------------------------------------------------------------- /daily/report.md: -------------------------------------------------------------------------------- 1 | You are a professional,efficient and creative analyst, now try to craft a deep daily report of global financial market; 2 | # Step 1: Preparing 3 | 1. Create a new sub directory of {$date} for current date if the folder did not exist; 4 | 2. All generated files should be under the folder {$date}; 5 | 6 | # Step 2: Plan and gen to-do list task file {$date}/task_{$timestamp}.md for agents to follow according to the following instructions: 7 | 1. Do planning after go through this whole file; 8 | 2. Align the trading date: for different market, align the last trading date as {$lastday}; 9 | 3. Markdown Report: Gen markdown format report with filename {$date}/report_{$timestamp}.md with the following instruction: 10 | (1). Search and fetch the latest performance of indexes like the Dow, S&P 500, Nasdaq of {$lastday} closing price and daily chg in %; 11 | 12 | (2). Search and fetch the latest performance of commodities like oil and gold, and also crypto currencies of {$lastday} closing price and daily chg in %; 13 | 14 | (3). Search and analyze the factors impacting the latest moves. 15 | 16 | (4). Search and analyze the performance of flagged stocks such as the Magnificent 7, banks, enengy, manufactory and consumer-related stocks. 17 | 18 | (5). Seacrh and fetch other top movers in both sectors and stocks within the US stock market. 19 | 20 | (6). Search and analyze upcoming events that may impact the market. 21 | 22 | (7). Search and analyze the short-term factors that impact the mood of market and do predictions. 23 | 4. Single html file generation: Gen a single html names {$date}/vis_{$timestamp}.html: 24 | (1). Follow the style instruction in @vis.md; 25 | (2). Bilingual language support of English and Simplified Chinese; 26 | (3). Language toggle button on top right; 27 | 28 | # Step 3: Execution and Logging: 29 | 1. Follow the to-do tasks of {$date}/task_{$timestamp}.md, execute step by step; 30 | 2. Ticker one task if finised; 31 | 3. Log the whole process in file 20250731/log_100000.md with the following key information: 32 | (1). {$timestamp}; 33 | (2). Task; 34 | (3). URL processed and the {$title}; 35 | (4). Summary; 36 | Key: Append not overwrite the log file; 37 | 38 | # Step 4: Review: Review the files generated to end the whole task -------------------------------------------------------------------------------- /gui/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # OpenResearch Cloudflare Worker Deployment Script 4 | 5 | set -e 6 | 7 | echo "🚀 Deploying OpenResearch to Cloudflare..." 8 | 9 | # Check if wrangler is installed 10 | if ! command -v wrangler &> /dev/null; then 11 | echo "❌ Wrangler CLI not found. Please install it first:" 12 | echo "npm install -g wrangler" 13 | exit 1 14 | fi 15 | 16 | # Navigate to worker directory 17 | cd worker 18 | 19 | echo "📦 Installing worker dependencies..." 20 | npm install 21 | 22 | echo "🗄️ Creating D1 database..." 23 | wrangler d1 create openresearch-db || echo "Database may already exist" 24 | 25 | echo "📊 Creating Vectorize index..." 26 | wrangler vectorize create research-embeddings --dimensions=768 --metric=cosine || echo "Index may already exist" 27 | 28 | echo "🗂️ Creating R2 buckets..." 29 | wrangler r2 bucket create openresearch-reports || echo "Reports bucket may already exist" 30 | wrangler r2 bucket create openresearch-assets || echo "Assets bucket may already exist" 31 | 32 | echo "🔄 Running database migrations..." 33 | wrangler d1 migrations apply openresearch-db 34 | 35 | echo "🔐 Setting up secrets..." 36 | echo "Please set the following secrets using 'wrangler secret put ':" 37 | echo "- GEMINI_API_KEY" 38 | echo "- GEMINI_EMBEDDING_MODEL (optional, defaults to gemini-embedding-001)" 39 | echo "" 40 | echo "Example:" 41 | echo "wrangler secret put GEMINI_API_KEY" 42 | echo "wrangler secret put GEMINI_EMBEDDING_MODEL" 43 | 44 | read -p "Have you set the required secrets? (y/n): " -n 1 -r 45 | echo 46 | if [[ ! $REPLY =~ ^[Yy]$ ]]; then 47 | echo "❌ Please set the required secrets before continuing." 48 | exit 1 49 | fi 50 | 51 | echo "🚀 Deploying worker..." 52 | wrangler deploy 53 | 54 | echo "✅ Worker deployed successfully!" 55 | echo "" 56 | echo "🌐 Your worker is now available at:" 57 | wrangler whoami | grep "Account ID" | awk '{print "https://openresearch-worker.YOUR_SUBDOMAIN.workers.dev"}' 58 | echo "" 59 | echo "📝 Next steps:" 60 | echo "1. Update your frontend .env file with:" 61 | echo " VITE_WORKER_API_URL=https://your-worker-url.workers.dev" 62 | echo " VITE_MODE=cloud" 63 | echo "2. Rebuild and redeploy your frontend" 64 | echo "3. Test the integration" 65 | 66 | cd .. 67 | echo "🎉 Deployment complete!" -------------------------------------------------------------------------------- /example/earnings_call/report_ford_earnings_call_20250731.md: -------------------------------------------------------------------------------- 1 | # Report: Ford Motor Company Q2 2025 Earnings Call Analysis 2 | 3 | ## Executive Summary 4 | Ford Motor Company reported a strong second quarter for 2025, surpassing analyst expectations for both earnings per share (EPS) and revenue. The company reinstated its full-year 2025 guidance, signaling confidence despite anticipated impacts from tariff-related costs. While Ford Pro and Ford Credit delivered robust results, the Ford Model e segment continued to experience losses. 5 | 6 | ## Financial Highlights 7 | Ford's Q2 2025 performance exceeded market forecasts: 8 | * **Earnings Per Share (EPS):** $0.37, outperforming analyst estimates of $0.30 or $0.31. 9 | * **Revenue:** $50.18 billion, surpassing the consensus estimate of $45.29 billion. 10 | * **Dividend:** A third-quarter regular dividend of 15 cents per share was declared. 11 | 12 | ## Segment Performance 13 | * **Ford Pro:** Generated a significant EBIT of $2.3 billion, highlighting the strength of its commercial vehicle and services business. 14 | * **Ford Blue:** Earned a modest profit, indicating stable performance from its traditional internal combustion engine vehicle segment. 15 | * **Ford Model e:** Reported an EBIT loss of $1.3 billion, reflecting ongoing investments and challenges in the electric vehicle sector. 16 | * **Ford Credit:** Had a strong quarter with significantly increased earnings before taxes, contributing positively to the overall financial results. 17 | 18 | ## Key Takeaways & Future Outlook 19 | Ford reinstated its full-year 2025 guidance, suggesting a positive outlook for the remainder of the year. However, the company acknowledged the financial implications of tariff-related costs, estimating a gross adverse EBIT impact of $2.5 billion and a net adverse EBIT impact of approximately $1.5 billion for the full year 2025. This indicates that while the company is performing well, external factors like tariffs are posing a notable headwind. 20 | 21 | ## Conclusion 22 | Ford Motor Company's Q2 2025 earnings call demonstrates a resilient financial performance, driven by strong results in its commercial and financing divisions. Despite the continued losses in the electric vehicle segment and the impact of tariffs, the company's decision to reinstate its full-year guidance suggests a strategic approach to navigate current market conditions and maintain profitability. -------------------------------------------------------------------------------- /ui/design-phase-one.md: -------------------------------------------------------------------------------- 1 | This is a compelling and well-articulated concept for an AI-driven interactive report composing platform. The two-phase approach effectively balances AI-powered automation in the research phase with essential human oversight and creativity in the composition phase. The use of modular "Cards" and an MDX foundation sets the stage for flexible and rich outputs. 2 | 3 | Here is a detailed breakdown, a formalized visualization, and an analysis of your proposed workflow. 4 | 5 | Platform Workflow Breakdown 6 | The platform architecture is logically divided into two main phases: 7 | 8 | Phase 1: Research and Content Curation 9 | This phase focuses on gathering, processing, and organizing the raw materials for the report. 10 | 11 | Topic Input: The user initiates the process by defining the report topic. 12 | 13 | AI Planning & User Confirmation: The LLM analyzes the topic and drafts a research plan. Crucially, the user reviews, edits, and confirms this plan before execution. 14 | 15 | Agent Execution: AI agents execute the plan, utilizing various information sources: 16 | 17 | Web Search: For external, up-to-date information. Using gemini search tool, with api_key and model set in .env, and tool documented at https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/web-search.md 18 | 19 | 20 | 21 | # Detailed Interaction Flows 22 | 23 | Phase 1: Research and Curation 24 | Planning: The User submits a topic. The API Gateway routes it to the Workflow Orchestrator, which calls the Planner Service. The Planner Service uses the LLM Abstraction Layer to generate a plan. 25 | 26 | Confirmation: The plan is returned to the Client UI for user review and approval. 27 | 28 | Dispatch: Upon confirmation, the Orchestrator breaks the plan into tasks and pushes them to the Task Queue. 29 | 30 | Execution: The Agent Execution Workers (Web, RAG, MCP) pull tasks from the queue and retrieve raw data. 31 | 32 | Synthesis: The raw data is passed to the Card Synthesizer. This worker uses the LLM Abstraction Layer to format the data into structured Cards. 33 | 34 | 35 | # Future enhancement 36 | 37 | ## Add sources: 38 | Context (RAG): Retrieval-Augmented Generation for accessing internal knowledge bases or specific documents. 39 | 40 | MCP (Data/APIs): Accessing structured databases or other specific data sources. 41 | 42 | Card Generation: The results from each task are synthesized into atomic units called "Cards" (e.g., a text summary, a chart, a table). 43 | 44 | Context Base: The generated cards are stored in a central repository (the "Context Base") for the current project. 45 | -------------------------------------------------------------------------------- /gui/src/services/WorkflowOrchestrator.js: -------------------------------------------------------------------------------- 1 | import TaskQueue from './TaskQueue' 2 | import AgentExecutionWorkers from './AgentExecutionWorkers' 3 | import CardSynthesizer from './CardSynthesizer' 4 | 5 | class WorkflowOrchestrator { 6 | constructor() { 7 | this.activeWorkflows = new Map() 8 | } 9 | 10 | async startWorkflow(workflowId, researchPlan) { 11 | console.log(`Starting workflow ${workflowId} with plan:`, researchPlan) 12 | 13 | // Break plan into tasks and queue them 14 | const tasks = researchPlan.tasks.map(task => ({ 15 | ...task, 16 | workflowId, 17 | status: 'queued', 18 | createdAt: new Date().toISOString() 19 | })) 20 | 21 | // Add tasks to queue 22 | tasks.forEach(task => TaskQueue.enqueue(task)) 23 | 24 | // Store workflow state 25 | this.activeWorkflows.set(workflowId, { 26 | id: workflowId, 27 | plan: researchPlan, 28 | tasks, 29 | status: 'running', 30 | startedAt: new Date().toISOString() 31 | }) 32 | 33 | // Start processing tasks 34 | this.processTasks(workflowId) 35 | 36 | return workflowId 37 | } 38 | 39 | async processTasks(workflowId) { 40 | const workflow = this.activeWorkflows.get(workflowId) 41 | if (!workflow) return 42 | 43 | while (TaskQueue.hasNext()) { 44 | const task = TaskQueue.dequeue() 45 | if (task.workflowId !== workflowId) continue 46 | 47 | try { 48 | // Execute task with appropriate agent 49 | const rawData = await AgentExecutionWorkers.executeTask(task) 50 | 51 | // Synthesize raw data into card 52 | const card = await CardSynthesizer.synthesize(rawData, task.type) 53 | 54 | // Update task status 55 | task.status = 'completed' 56 | task.completedAt = new Date().toISOString() 57 | task.result = card 58 | 59 | // Notify observers (in real app, would emit events) 60 | console.log(`Task completed: ${task.title}`, card) 61 | 62 | } catch (error) { 63 | console.error(`Task failed: ${task.title}`, error) 64 | task.status = 'failed' 65 | task.error = error.message 66 | } 67 | } 68 | 69 | // Mark workflow as complete 70 | workflow.status = 'completed' 71 | workflow.completedAt = new Date().toISOString() 72 | console.log(`Workflow ${workflowId} completed`) 73 | } 74 | 75 | getWorkflowStatus(workflowId) { 76 | return this.activeWorkflows.get(workflowId) 77 | } 78 | 79 | async cancelWorkflow(workflowId) { 80 | const workflow = this.activeWorkflows.get(workflowId) 81 | if (workflow) { 82 | workflow.status = 'cancelled' 83 | workflow.cancelledAt = new Date().toISOString() 84 | } 85 | } 86 | } 87 | 88 | export default new WorkflowOrchestrator() -------------------------------------------------------------------------------- /ui/src/services/WorkflowOrchestrator.js: -------------------------------------------------------------------------------- 1 | import TaskQueue from './TaskQueue' 2 | import AgentExecutionWorkers from './AgentExecutionWorkers' 3 | import CardSynthesizer from './CardSynthesizer' 4 | 5 | class WorkflowOrchestrator { 6 | constructor() { 7 | this.activeWorkflows = new Map() 8 | } 9 | 10 | async startWorkflow(workflowId, researchPlan) { 11 | console.log(`Starting workflow ${workflowId} with plan:`, researchPlan) 12 | 13 | // Break plan into tasks and queue them 14 | const tasks = researchPlan.tasks.map(task => ({ 15 | ...task, 16 | workflowId, 17 | status: 'queued', 18 | createdAt: new Date().toISOString() 19 | })) 20 | 21 | // Add tasks to queue 22 | tasks.forEach(task => TaskQueue.enqueue(task)) 23 | 24 | // Store workflow state 25 | this.activeWorkflows.set(workflowId, { 26 | id: workflowId, 27 | plan: researchPlan, 28 | tasks, 29 | status: 'running', 30 | startedAt: new Date().toISOString() 31 | }) 32 | 33 | // Start processing tasks 34 | this.processTasks(workflowId) 35 | 36 | return workflowId 37 | } 38 | 39 | async processTasks(workflowId) { 40 | const workflow = this.activeWorkflows.get(workflowId) 41 | if (!workflow) return 42 | 43 | while (TaskQueue.hasNext()) { 44 | const task = TaskQueue.dequeue() 45 | if (task.workflowId !== workflowId) continue 46 | 47 | try { 48 | // Execute task with appropriate agent 49 | const rawData = await AgentExecutionWorkers.executeTask(task) 50 | 51 | // Synthesize raw data into card 52 | const card = await CardSynthesizer.synthesize(rawData, task.type) 53 | 54 | // Update task status 55 | task.status = 'completed' 56 | task.completedAt = new Date().toISOString() 57 | task.result = card 58 | 59 | // Notify observers (in real app, would emit events) 60 | console.log(`Task completed: ${task.title}`, card) 61 | 62 | } catch (error) { 63 | console.error(`Task failed: ${task.title}`, error) 64 | task.status = 'failed' 65 | task.error = error.message 66 | } 67 | } 68 | 69 | // Mark workflow as complete 70 | workflow.status = 'completed' 71 | workflow.completedAt = new Date().toISOString() 72 | console.log(`Workflow ${workflowId} completed`) 73 | } 74 | 75 | getWorkflowStatus(workflowId) { 76 | return this.activeWorkflows.get(workflowId) 77 | } 78 | 79 | async cancelWorkflow(workflowId) { 80 | const workflow = this.activeWorkflows.get(workflowId) 81 | if (workflow) { 82 | workflow.status = 'cancelled' 83 | workflow.cancelledAt = new Date().toISOString() 84 | } 85 | } 86 | } 87 | 88 | export default new WorkflowOrchestrator() -------------------------------------------------------------------------------- /daily/reports/20250731/log_20250731100000.md: -------------------------------------------------------------------------------- 1 | 20250731100000 2 | Task: Create directory 3 | Summary: Created directory reports/20250731 4 | 5 | 20250731100000 6 | Task: Generate task file 7 | Summary: Created task file reports/20250731/task_20250731100000.md 8 | 9 | 20250731100000 10 | Task: Search for major indexes performance 11 | URL processed and the title: Dow S&P 500 Nasdaq closing price July 30 2025 12 | Summary: Fetched closing prices and daily changes for Dow, S&P 500, and Nasdaq. 13 | 14 | 20250731100000 15 | Task: Search for commodities and cryptocurrencies performance 16 | URL processed and the title: oil gold and crypto currencies closing price July 30 2025 17 | Summary: Fetched closing prices for WTI Crude Oil, Brent Crude, Gold, Bitcoin, and Ethereum. 18 | 19 | 20250731100000 20 | Task: Search for factors impacting market moves 21 | URL processed and the title: factors impacting stock market July 30 2025 22 | Summary: Identified economic conditions, corporate performance, political/geopolitical factors, and market trends as key impacts. 23 | 24 | 20250731100000 25 | Task: Search for Magnificent 7 stocks performance 26 | URL processed and the title: Magnificent 7 stocks performance July 30 2025 27 | Summary: Gathered performance data for Magnificent 7 stocks, noting mixed results. 28 | 29 | 20250731100000 30 | Task: Search for bank stocks performance 31 | URL processed and the title: bank stocks performance July 30 2025 32 | Summary: No specific data for bank stock performance on July 30, 2025, was available. 33 | 34 | 20250731100000 35 | Task: Search for energy stocks performance 36 | URL processed and the title: energy stocks performance July 30 2025 37 | Summary: Gathered information on overall trends, company-specific performance, and renewable energy stocks. 38 | 39 | 20250731100000 40 | Task: Search for manufacturing stocks performance 41 | URL processed and the title: manufacturing stocks performance July 30 2025 42 | Summary: No specific data for manufacturing stock performance on July 30, 2025, was available. 43 | 44 | 20250731100000 45 | Task: Search for consumer-related stocks performance 46 | URL processed and the title: consumer-related stocks performance July 30 2025 47 | Summary: Gathered information on varied performance across markets and sub-sectors. 48 | 49 | 20250731100000 50 | Task: Search for top movers in US stock market 51 | URL processed and the title: top movers US stock market sectors and stocks July 30 2025 52 | Summary: Identified top moving sectors and individual stocks (gainers and losers). 53 | 54 | 20250731100000 55 | Task: Generate markdown report 56 | Summary: Created reports/20250731/report_20250731100000.md with gathered market data. 57 | 58 | 20250731100000 59 | Task: Generate HTML visualization 60 | Summary: Created reports/20250731/vis_20250731100000.html with bilingual support and charts. 61 | -------------------------------------------------------------------------------- /instruct_v2.md: -------------------------------------------------------------------------------- 1 | You are a professional,efficient and creative analyst, now try to craft a deep research on the topic of user's prompt: [prompt] 2 | 3 | # [vis_instruct] : vis.md under current directory, which is prompt of visulization html generation; 4 | 5 | # Preparation 6 | Create a new [folder] with name [keyword]_[date] 7 | Create 5 blank files under [folder] for the whole process: 8 | 1. [plan_file]: markdown file plan_[keyword]_[date].md, in which [keyword] stands for a keyword extracted from the [prompt] 9 | 2. [task_file]: task_[keyword]_[date].md 10 | 3. [log_file]: markdown format with the filename log_[keyword]_[date].md 11 | 4. [report_file]: markdown format with the file name report_[keyword]_[date].md 12 | 5. [vis_file]: vis_[keyword]_[date].html 13 | 14 | # Step 1: Planning 15 | Please go through the [prompt] and create a highly-detailed research plan, write it to a [plan_file]. The plan should contain following parts: Research, Report Composing, Validation, Visualization HTML Generation referring to [vis_instruct], Validation of visualization; 16 | 17 | # Step 2: Create Tasks 18 | Create a highly-detailed to-do task list, write to [task_file], please follow the format as: 19 | 20 | --- Task Sample 21 | ### Step 1 {Step One} 22 | **1.1 {Task 1.1} 23 | [ ] {subtask} 24 | --- 25 | 26 | The to-do task should contain following parts: Research, Report Composing, Validation, Visualization HTML Generation referring to [vis_file], Validation of visualization; 27 | 28 | Fill the [log_file] and [report_file] with structures in to-do list task 29 | 30 | # Step 3: Task Iteration 31 | Iterate the to-do list of [task_file], cross "[ ]" of [task_file] after each task, and append [log_file] with the following items too: 32 | 1. What you thought; 33 | 2. What you did; 34 | 3. What you got; 35 | 4. Sources you searched or process; 36 | 5. Other important information to remember for further report composing; 37 | 38 | # Step 4: Report Composing 39 | Iterate and update each part of [report_file] 40 | 41 | # Step 5: Report Validation 42 | Go through the [report_file] for validation and detail refinery, refer to [log_file] to recall important information for validation and supplementation; 43 | 44 | # Step 6: Visualization 45 | Refer to [vis_instruct], craft a in-depth bilingual(English and Simplified Chinese, for all content including texts, language toggle swtich on top right) webpage like newspaper frontpage write to [vis_file]; 46 | 47 | # Step 7: Visualization Validation and refinery 48 | Go throught the [vis_file] for validation, check carefully to avoid the unstoppable extending height of chart axis. And for each content div in [vis_file], add more details referring to [report_file]. 49 | 50 | # Finishing 51 | Complete all 5 files:[plan_file],[task_file],[log_file],[report_file],[vis_file] 52 | Return a execution summary 53 | 54 | # Important 55 | Do not modify [vis_instruct] 56 | 57 | 58 | -------------------------------------------------------------------------------- /gui/src/services/ServiceFactory.js: -------------------------------------------------------------------------------- 1 | import LLMAbstractionLayer from './LLMAbstractionLayer.js'; 2 | import { HybridLLMService } from './HybridLLMService.js'; 3 | 4 | /** 5 | * Service Factory - creates appropriate service instances based on configuration 6 | */ 7 | class ServiceFactoryImpl { 8 | constructor() { 9 | this.mode = import.meta.env.VITE_MODE || 'local'; 10 | this.hasWorkerApi = !!import.meta.env.VITE_WORKER_API_URL; 11 | this.llmServiceInstance = null; // Singleton instance 12 | 13 | // Only log once during first initialization 14 | if (!ServiceFactoryImpl._initialized) { 15 | console.log('🏭 ServiceFactory initialized:', { 16 | mode: this.mode, 17 | hasWorkerApi: this.hasWorkerApi, 18 | workerUrl: this.hasWorkerApi ? '✅ Connected' : '❌ Not configured' 19 | }); 20 | ServiceFactoryImpl._initialized = true; 21 | } 22 | } 23 | 24 | /** 25 | * Create LLM service instance (singleton pattern) 26 | */ 27 | createLLMService() { 28 | // Return existing instance if available 29 | if (this.llmServiceInstance) { 30 | return this.llmServiceInstance; 31 | } 32 | 33 | if (this.mode === 'cloud' && this.hasWorkerApi) { 34 | console.log('🚀 Creating HybridLLMService (Local AI + Worker Infrastructure)'); 35 | this.llmServiceInstance = new HybridLLMService(); 36 | } else { 37 | console.log('🔧 Using local LLMAbstractionLayer'); 38 | this.llmServiceInstance = LLMAbstractionLayer; // This is already an instance 39 | } 40 | 41 | return this.llmServiceInstance; 42 | } 43 | 44 | /** 45 | * Check if cloud features are available 46 | */ 47 | isCloudModeEnabled() { 48 | return this.mode === 'cloud' && this.hasWorkerApi; 49 | } 50 | 51 | /** 52 | * Get service mode 53 | */ 54 | getMode() { 55 | return this.mode; 56 | } 57 | 58 | /** 59 | * Get feature availability 60 | */ 61 | getFeatures() { 62 | const isCloud = this.isCloudModeEnabled(); 63 | 64 | return { 65 | semanticSearch: isCloud, 66 | vectorStorage: isCloud, 67 | persistentStorage: isCloud, 68 | backgroundExecution: isCloud, 69 | projectManagement: isCloud, 70 | exportToCloud: isCloud, 71 | multiLanguageReports: true, // Available in both modes 72 | realTimeExecution: !isCloud, // Local mode has real-time, cloud mode uses polling 73 | }; 74 | } 75 | } 76 | 77 | // Initialize static property 78 | ServiceFactoryImpl._initialized = false; 79 | 80 | // Create singleton instance 81 | const factory = new ServiceFactoryImpl(); 82 | 83 | /** 84 | * Singleton access to service factory and LLM service 85 | */ 86 | export class ServiceFactory { 87 | static getInstance() { 88 | return factory.createLLMService(); 89 | } 90 | 91 | static getFactory() { 92 | return factory; 93 | } 94 | } 95 | 96 | export const serviceFactory = factory; -------------------------------------------------------------------------------- /legacy/instruct_new.md: -------------------------------------------------------------------------------- 1 | You are a professional, efficient, and creative analyst. Your task is to conduct a deep research study based on the user's provided prompt. 2 | 3 | # Step 1: Planning 4 | 1. **Understand the Prompt:** Carefully analyze the user's research prompt. 5 | 2. **Extract Keyword & Date:** Identify a concise keyword from the prompt and note the current date in `YYYYMMDD` format. 6 | 3. **Create Research Plan:** Develop a highly detailed research plan, outlining all necessary steps and sub-tasks. Save this plan to a markdown file named `planning_[keyword]_[yyyymmdd].md`. 7 | 8 | # Step 2: Iterative Research Execution 9 | 1. **Generate Task List:** Based on the `planning_[keyword]_[yyyymmdd].md` file, create a comprehensive to-do list for research agents. Save this list to a markdown file named `task_[keyword]_[yyyymmdd]_[hhmmss].md`, where `[hhmmss]` represents the current timestamp. 10 | 2. **Execute Research Tasks:** Follow the tasks outlined in `task_[keyword]_[yyyymmdd]_[hhmmss].md` step by step. 11 | * **Information Gathering:** Utilize `google_web_search` to find the most recent and relevant information (news, events, data, reports). Prioritize official reports, reputable economic analyses, and established financial news outlets. 12 | * **Analysis and Synthesis:** Extract key data points, trends, and expert opinions. Identify specific impacts (positive/negative) and analyze long-term shifts. 13 | * **Information Structuring:** Organize findings logically, typically by country, sector, and long-term impact. 14 | 3. **Iterative Task Management:** For each completed task, mark it as finished in `task_[keyword]_[yyyymmdd]_[hhmmss].md`. Continuously refine and append new sub-tasks to this file as new research avenues emerge. 15 | 16 | # Step 3: Report Composing 17 | 1. **Draft Report:** Compile all gathered and analyzed information into a comprehensive report. Save the report in markdown format with the filename: `report_[keyword]_[yyyymmdd].md`. 18 | 2. **Data Presentation:** Use tables with data wherever possible to present information clearly and concisely. 19 | 3. **Comprehensive Coverage:** Ensure the report is well-structured and addresses all aspects of the original research prompt. 20 | 21 | # Step 4: Report Visualization 22 | 1. **Webpage Creation:** Based on the final report, craft an in-depth bilingual (English and Simplified Chinese, for all content including texts) webpage. The webpage should resemble a newspaper front page and adhere to the style instructions provided in `@vis.md`. 23 | 2. **Output Filename:** Save the webpage as `vis_[keyword]_[yyyymmdd].html`. 24 | 3. **Chart Axis Check:** Pay careful attention to chart generation to prevent the y-axis height from extending uncontrollably. 25 | 26 | # Logging 27 | 1. **Maintain Detailed Log:** Throughout the entire process, maintain a detailed log of all steps taken, thoughts, actions, search queries, and sources. Save this log in markdown format with the filename: `log_[keyword]_[yyyymmdd]_[hhmmss].md`. 28 | -------------------------------------------------------------------------------- /daily/reports/20250730/log_20250730100000.md: -------------------------------------------------------------------------------- 1 | 2 | # Log for 2025-07-30 3 | 4 | **Timestamp:** 20250730100000 5 | 6 | **Task:** Create directory for today's report 7 | **Summary:** Created the `reports/20250730` directory. 8 | 9 | --- 10 | 11 | **Timestamp:** 20250730100000 12 | 13 | **Task:** Generate to-do list 14 | **Summary:** Created `reports/20250730/task_20250730100000.md` with the plan for the day. 15 | 16 | --- 17 | 18 | **Timestamp:** 20250730100000 19 | 20 | **Task:** Fetch Major Index Data 21 | **URL Processed:** google.com 22 | **Title:** closing prices for Dow, S&P 500, and Nasdaq on July 29, 2025 23 | **Summary:** Fetched closing prices for the Dow, S&P 500, and Nasdaq. 24 | 25 | --- 26 | 27 | **Timestamp:** 20250730100000 28 | 29 | **Task:** Fetch Commodity Data 30 | **URL Processed:** google.com 31 | **Title:** closing price of oil and gold on July 29, 2025 32 | **Summary:** Fetched closing prices for oil and gold. 33 | 34 | --- 35 | 36 | **Timestamp:** 20250730100000 37 | 38 | **Task:** Fetch Cryptocurrency Data 39 | **URL Processed:** google.com 40 | **Title:** closing price of Bitcoin and Ethereum on July 29, 2025 41 | **Summary:** Fetched closing prices for Bitcoin and Ethereum. 42 | 43 | --- 44 | 45 | **Timestamp:** 20250730100000 46 | 47 | **Task:** Draft Markdown Report 48 | **Summary:** Created and populated the initial markdown report with market data. 49 | 50 | --- 51 | 52 | **Timestamp:** 20250730100000 53 | 54 | **Task:** Analyze Market Drivers 55 | **URL Processed:** google.com 56 | **Title:** factors impacting stock market on July 29, 2025 57 | **Summary:** Analyzed and added key market drivers to the report. 58 | 59 | --- 60 | 61 | **Timestamp:** 20250730100000 62 | 63 | **Task:** Analyze Flagged Stocks 64 | **URL Processed:** google.com 65 | **Title:** performance of Magnificent 7, banks, energy, manufacturing, and consumer stocks on July 29, 2025 66 | **Summary:** Analyzed and added performance of flagged stocks to the report. 67 | 68 | --- 69 | 70 | **Timestamp:** 20250730100000 71 | 72 | **Task:** Analyze Top Movers 73 | **URL Processed:** google.com 74 | **Title:** top movers in US stock market on July 29, 2025 75 | **Summary:** Analyzed and added top movers to the report. 76 | 77 | --- 78 | 79 | **Timestamp:** 20250730100000 80 | 81 | **Task:** Analyze Upcoming Events 82 | **URL Processed:** google.com 83 | **Title:** upcoming events that may impact the stock market July 2025 84 | **Summary:** Analyzed and added upcoming events to the report. 85 | 86 | --- 87 | 88 | **Timestamp:** 20250730100000 89 | 90 | **Task:** Analyze Short-Term Outlook 91 | **URL Processed:** google.com 92 | **Title:** short-term stock market prediction July 30 2025 93 | **Summary:** Analyzed and added the short-term outlook and prediction to the report. 94 | 95 | --- 96 | 97 | **Timestamp:** 20250730100000 98 | 99 | **Task:** Generate HTML Report 100 | **Summary:** Generated the HTML report `vis_20250730100000.html` with bilingual support and charts. 101 | 102 | --- 103 | 104 | **Timestamp:** 20250730100000 105 | 106 | **Task:** Final Review 107 | **Summary:** All files have been generated and reviewed. 108 | -------------------------------------------------------------------------------- /example/claude_tarrif/task_tariff_20250728_143022.md: -------------------------------------------------------------------------------- 1 | # Task List: US-Euro 15% Tariff Agreement Research 2 | 3 | ## Current Time: 14:30:22, July 28, 2025 4 | 5 | ### Phase 1: Background Research Tasks 6 | - [ ] **Task 1.1**: Search for recent US-EU trade statistics and current tariff structures 7 | - [ ] **Task 1.2**: Research historical precedents of similar tariff agreements 8 | - [ ] **Task 1.3**: Gather baseline economic data for major US states and EU countries 9 | 10 | ### Phase 2: Country-Specific Impact Research 11 | - [ ] **Task 2.1**: Analyze US state-level impacts (California, Texas, New York, Florida, others) 12 | - [ ] **Task 2.2**: Research major EU country impacts (Germany, France, Italy, Netherlands, Spain) 13 | - [ ] **Task 2.3**: Examine smaller EU member state vulnerabilities 14 | - [ ] **Task 2.4**: Assess regional economic variations within countries 15 | 16 | ### Phase 3: Sectoral Analysis Tasks 17 | - [ ] **Task 3.1**: Manufacturing sector analysis (automotive, machinery, chemicals, steel, electronics) 18 | - [ ] **Task 3.2**: Agricultural sector impacts (food, commodities, wine, dairy) 19 | - [ ] **Task 3.3**: Services sector effects (financial, logistics, digital) 20 | - [ ] **Task 3.4**: Energy sector implications (renewable, traditional, infrastructure) 21 | 22 | ### Phase 4: Long-term Impact Assessment 23 | - [ ] **Task 4.1**: Model trade flow redirections and supply chain shifts 24 | - [ ] **Task 4.2**: Analyze investment pattern changes and FDI flows 25 | - [ ] **Task 4.3**: Assess geopolitical and strategic implications 26 | - [ ] **Task 4.4**: Evaluate innovation and competitiveness effects 27 | 28 | ### Phase 5: Data Collection and Quantitative Analysis 29 | - [ ] **Task 5.1**: Compile official government trade and economic statistics 30 | - [ ] **Task 5.2**: Gather industry reports and business impact assessments 31 | - [ ] **Task 5.3**: Collect academic research and think tank analyses 32 | - [ ] **Task 5.4**: Perform quantitative modeling and projections 33 | 34 | ### Phase 6: Report Composition 35 | - [ ] **Task 6.1**: Structure executive summary with key findings 36 | - [ ] **Task 6.2**: Compose country-specific analysis sections 37 | - [ ] **Task 6.3**: Write detailed sector impact analysis 38 | - [ ] **Task 6.4**: Develop long-term projection scenarios 39 | - [ ] **Task 6.5**: Create data tables and supporting charts 40 | 41 | ### Logging Tasks (Ongoing) 42 | - [ ] **Log 1**: Document search strategies and sources accessed 43 | - [ ] **Log 2**: Record analysis methods and key insights 44 | - [ ] **Log 3**: Track challenges and limitations encountered 45 | - [ ] **Log 4**: Note data quality and reliability assessments 46 | 47 | ## Priority Order 48 | 1. Background research (Tasks 1.1-1.3) 49 | 2. Current economic data collection (Task 5.1) 50 | 3. Country-specific analysis (Tasks 2.1-2.4) 51 | 4. Sectoral analysis (Tasks 3.1-3.4) 52 | 5. Long-term impact modeling (Tasks 4.1-4.4) 53 | 6. Report composition (Tasks 6.1-6.5) 54 | 55 | ## Success Criteria for Each Task 56 | - Use multiple credible sources (minimum 3 per major finding) 57 | - Include quantitative data wherever possible 58 | - Cross-reference information for accuracy 59 | - Document sources and methodology 60 | - Focus on recent data (2023-2025 preferred) -------------------------------------------------------------------------------- /example/pharma/task_tariff_20250728_143022.md: -------------------------------------------------------------------------------- 1 | # Research Tasks for Deep Research: Impacts to Pharmaceuticals of US Tariffs for Other Countries 2 | 3 | ## To-Do List (Generated: 2025-07-28 14:30:22) 4 | 5 | ### Step 2.1: Understand the Scope and Key Players 6 | - [x] Define "US tariffs" in the context of pharmaceuticals (e.g., specific acts, trade wars, general tariff policies). 7 | - [x] Identify "other countries" most affected or relevant to pharmaceutical trade with the US (e.g., China, India, EU, Canada, Mexico). 8 | - [x] Identify key pharmaceutical products/categories that might be impacted. 9 | - [x] Research the current state of the global pharmaceutical supply chain. 10 | 11 | ### Step 2.2: Identify Existing Tariffs and Their Application 12 | - [x] Search for specific US tariffs imposed on pharmaceutical products or related raw materials/components from identified countries. 13 | - [x] Determine the effective dates and duration of these tariffs. 14 | - [x] Investigate any retaliatory tariffs imposed by other countries on US pharmaceutical exports. 15 | 16 | ### Step 2.3: Analyze Economic Impacts 17 | - [ ] **For US Consumers/Patients:** 18 | - [x] Impact on drug prices (increase/decrease). 19 | - [x] Impact on drug availability/shortages. 20 | - [x] Impact on innovation and R&D within the US. 21 | - [ ] **For US Pharmaceutical Companies:** 22 | - [x] Impact on manufacturing costs (if raw materials are imported). 23 | - [x] Impact on export competitiveness. 24 | - [x] Impact on supply chain resilience and diversification strategies. 25 | - [x] Impact on investment decisions (e.g., reshoring, nearshoring). 26 | - [ ] **For Pharmaceutical Companies in Other Countries:** 27 | - [x] Impact on export volumes to the US. 28 | - [x] Impact on profitability and market share. 29 | - [x] Strategies adopted (e.g., finding new markets, reducing costs, shifting production). 30 | - [ ] **For Global Pharmaceutical Supply Chain:** 31 | - [x] Diversification of supply sources. 32 | - [x] Regionalization of manufacturing. 33 | - [x] Changes in trade flows. 34 | 35 | ### Step 2.4: Analyze Non-Economic Impacts 36 | - [ ] **Geopolitical Implications:** 37 | - [x] Impact on trade relations between the US and other countries. 38 | - [ ] Potential for trade disputes and their resolution. 39 | - [ ] **Regulatory and Quality Control:** 40 | - [x] How tariffs might affect regulatory compliance and quality standards if supply chains shift. 41 | - [ ] **Public Health Implications:** 42 | - [x] Long-term effects on global health security and access to essential medicines. 43 | 44 | ### Step 2.5: Gather Data and Case Studies 45 | - [ ] Collect relevant economic data (e.g., trade volumes, price indices, import/export figures). 46 | - [ ] Look for specific case studies of pharmaceutical companies or products affected by tariffs. 47 | - [ ] Utilize recent news articles, academic papers, industry reports, and government publications. 48 | 49 | ### Step 2.6: Identify Future Trends and Outlook 50 | - [x] Forecast potential future tariff policies. 51 | - [x] Analyze long-term implications for the pharmaceutical industry. 52 | - [x] Identify potential mitigation strategies or policy recommendations. 53 | 54 | ### Logging 55 | - [ ] Continuously update `log_tariff_20250728_143022.md` with actions, thoughts, and sources. 56 | -------------------------------------------------------------------------------- /gui/src/components/Navigation.jsx: -------------------------------------------------------------------------------- 1 | import { Link, useLocation } from 'react-router-dom' 2 | 3 | const Navigation = () => { 4 | const location = useLocation() 5 | 6 | const navItems = [ 7 | { 8 | path: '/', 9 | label: 'Research', 10 | icon: '🔬', 11 | description: 'Create new research projects' 12 | }, 13 | { 14 | path: '/knowledge', 15 | label: 'Knowledge Base', 16 | icon: '🧠', 17 | description: 'Explore all projects, search, and analytics' 18 | } 19 | ] 20 | 21 | // Show editor tab only if we're on an editor page 22 | const isEditorPage = location.pathname.includes('/edit') 23 | 24 | if (isEditorPage) { 25 | navItems.push({ 26 | path: location.pathname, 27 | label: 'Report Editor', 28 | icon: '✏️', 29 | description: 'WYSIWYG report editor' 30 | }) 31 | } 32 | 33 | return ( 34 | 90 | ) 91 | } 92 | 93 | export default Navigation -------------------------------------------------------------------------------- /daily/reports/20250729/log_20250729100000.md: -------------------------------------------------------------------------------- 1 | 20250729100000 2 | Task: Create directory for today's report. 3 | URL processed: N/A 4 | Summary: Created directory /Users/daoming/prog/work/reports/daily/reports/20250729. 5 | 6 | 20250729100000 7 | Task: Generate to-do list task file. 8 | URL processed: N/A 9 | Summary: Generated task_20250729100000.md with a plan for report and webpage generation. 10 | 11 | 20250729100000 12 | Task: Search and fetch latest performance of indexes, commodities, and cryptocurrencies. 13 | URL processed: greenwichtime.com, sfgate.com, latimes.com, tradingeconomics.com, hartenergy.com, investopedia.com, morningstar.com, mining.com, cryptonews.com, zacks.com 14 | Summary: Gathered closing prices for Dow, S&P 500, Nasdaq, Brent Crude, WTI Crude, Gold, and Bitcoin for July 28, 2025. 15 | 16 | 20250729100000 17 | Task: Search and analyze factors impacting latest market moves. 18 | URL processed: investopedia.com, latimes.com, ahdb.org.uk, marketpulse.com, ajg.com, hartenergy.com, fxleaders.com, pbs.org, spglobal.com, forvismazars.us, blackrock.com, icmarkets.com, youtube.com, business-standard.com 19 | Summary: Identified trade deals, geopolitical developments, economic data, central bank policies, corporate earnings, and commodity trends as key factors. 20 | 21 | 20250729100000 22 | Task: Search and analyze performance of flagged stocks (Magnificent 7, banks, energy, manufacturing, consumer-related). 23 | URL processed: coincentral.com, investing.com, techi.com, fool.com, nasdaq.com, marketbeat.com, seekingalpha.com, interactivebrokers.com, 247wallst.com, trefis.com, tradersunion.com, huntsvillebusinessjournal.com, prnewswire.com, californiabankofcommerce.com, icicidirect.com, nucor.com, spragueenergy.com 24 | Summary: Detailed performance of Magnificent 7 stocks and provided an overview of banks, energy, manufacturing, and consumer-related sectors. 25 | 26 | 20250729100000 27 | Task: Search and fetch top movers in US stock market. 28 | URL processed: investopedia.com, latimes.com, timesunion.com, thestreet.com, indopremier.com 29 | Summary: Identified top gainers (Super Micro Computer, AMD, Nike, Tesla) and top losers (Albemarle, Revvity, Centene, Nucor). 30 | 31 | 20250729100000 32 | Task: Search and analyze upcoming events that may impact the market. 33 | URL processed: icmarkets.com, mortgageelements.com, hancockwhitney.com, seekingalpha.com, oldpoint.com 34 | Summary: Noted upcoming Eurozone GDP and inflation data, and the Bank of Japan meeting. 35 | 36 | 20250729100000 37 | Task: Search and analyze short-term factors impacting market and predictions. 38 | URL processed: guggenheiminvestments.com, seekingalpha.com, ey.com, home.saxo, economictimes.com, forvismazars.us, 4xsolutions.com, morganstanley.com, carnegieinvest.com, fanniemae.com, ccrwealth.com 39 | Summary: Discussed tariffs, inflation, labor market, GDP, consumer spending, Fed policy, corporate earnings, geopolitical tensions, and market valuations as short-term factors, and predicted continued volatility. 40 | 41 | 20250729100000 42 | Task: Generate markdown format report. 43 | URL processed: N/A 44 | Summary: Created report_20250729100000.md with all gathered financial market information. 45 | 46 | 20250729100000 47 | Task: Generate single HTML file. 48 | URL processed: N/A 49 | Summary: Created vis_20250729100000.html with data visualization and bilingual support based on vis.md instructions. -------------------------------------------------------------------------------- /example/earnings_call/report_ups_earnings_call_20250731.md: -------------------------------------------------------------------------------- 1 | # UPS Q2 2025 Earnings Call Research Report 2 | 3 | ## 1. Executive Summary 4 | 5 | UPS reported a mixed financial performance for Q2 2025. While consolidated revenue of $21.2 billion surpassed forecasts, diluted earnings per share (EPS) of $1.55 slightly missed expectations. The company is actively pursuing strategic actions, including significant cost reduction programs and network reconfiguration, aiming for $3.5 billion in cost savings for 2025. Challenges include a softer U.S. small package market, subdued manufacturing activity, and the impact of trade policy changes. UPS is also continuing its strategic decision to reduce lower-margin business, particularly from Amazon. 6 | 7 | ## 2. Financial Performance Analysis 8 | 9 | ### Revenue Breakdown 10 | * **Consolidated Revenue:** $21.2 billion, a 2.7% decrease compared to the same period last year, but exceeding the anticipated $20.8 billion. 11 | * **U.S. Domestic Package:** Revenue was $14.1 billion, a 0.8% decline year-over-year. This was primarily due to an expected volume decrease, partially offset by increases in air cargo and revenue per piece. Average daily volume in this segment declined by 7.3%. 12 | * **International:** Revenue increased by 2.6% to $4.5 billion, driven by a 3.9% growth in total average daily volume. 13 | * **Supply Chain Solutions:** Revenue decreased by 18.3% to $2.7 billion, mainly due to the divestiture of Coyote Logistics in Q3 2024. 14 | 15 | ### Profitability 16 | * **Consolidated Operating Profit:** $1.9 billion (non-GAAP adjusted). 17 | * **Consolidated Operating Margin:** 8.8% (non-GAAP adjusted). 18 | 19 | ### Earnings Per Share (EPS) 20 | * **Diluted Earnings Per Share (EPS):** $1.55 (non-GAAP adjusted), slightly below the $1.57 forecast. 21 | 22 | ### Cash Flow 23 | * **Free Cash Flow:** $742 million. 24 | * **Dividends Paid Year-to-Date:** $2.7 billion. 25 | 26 | ## 3. Key Strategic Initiatives and Future Outlook 27 | 28 | ### Strategic Actions 29 | UPS is actively pursuing strategic actions, including: 30 | * Targeting $3.5 billion in cost reductions for 2025 through network reconfiguration and efficiency initiatives. 31 | * Expanding its healthcare logistics capabilities, with plans to acquire Andlauer Healthcare Group to enhance its presence in Canadian and U.S. markets. 32 | * Continuing its strategic decision to reduce lower-margin business, particularly from Amazon. 33 | 34 | ### Market Conditions and Challenges 35 | Challenges faced during the quarter included: 36 | * A softer U.S. small package market. 37 | * Subdued manufacturing activity. 38 | * The impact of trade policy changes and tariffs. 39 | 40 | ## 4. Q&A Highlights 41 | 42 | *Due to the unavailability of the full earnings call transcript, this section is limited to information gleaned from summaries.* 43 | 44 | The summaries indicate that investor concerns were primarily related to broader market conditions and uncertainties regarding future guidance, leading to a drop in share price despite the revenue beat. Management's responses likely focused on the strategic cost-cutting measures and network optimization efforts as ways to navigate these challenges and improve future profitability. 45 | 46 | ## 5. Conclusion 47 | 48 | UPS's Q2 2025 performance reflects a company in transition, strategically adjusting its operations to optimize profitability amidst a challenging market. While revenue growth was modest and EPS slightly missed targets, the aggressive cost reduction initiatives and strategic acquisitions in healthcare logistics demonstrate a proactive approach to long-term growth and efficiency. The company faces headwinds from a softer market and trade policies, but its focus on network optimization and shedding lower-margin business suggests a commitment to improving its financial standing. 49 | -------------------------------------------------------------------------------- /gui/src/services/AgentExecutionWorkers.js: -------------------------------------------------------------------------------- 1 | import { AGENT_TYPES } from '../types' 2 | 3 | class AgentExecutionWorkers { 4 | async executeTask(task) { 5 | console.log(`Executing task: ${task.title} with agent: ${task.agent}`) 6 | 7 | switch (task.agent) { 8 | case AGENT_TYPES.WEB: 9 | return this.executeWebSearch(task) 10 | case AGENT_TYPES.RAG: 11 | return this.executeRAGQuery(task) 12 | case AGENT_TYPES.MCP: 13 | return this.executeMCPQuery(task) 14 | default: 15 | throw new Error(`Unknown agent type: ${task.agent}`) 16 | } 17 | } 18 | 19 | async executeWebSearch(task) { 20 | // Simulate web search using Gemini search tool 21 | // In real implementation, would use the Gemini CLI tool as documented 22 | return new Promise((resolve) => { 23 | setTimeout(() => { 24 | resolve({ 25 | title: task.title, 26 | content: `Web search results for: ${task.query}`, 27 | source: 'web_search', 28 | data: { 29 | query: task.query, 30 | results: [ 31 | { 32 | title: `Academic paper on ${task.query}`, 33 | url: 'https://example.com/paper1', 34 | snippet: 'Relevant research findings...' 35 | }, 36 | { 37 | title: `Industry report on ${task.query}`, 38 | url: 'https://example.com/report1', 39 | snippet: 'Statistical analysis shows...' 40 | } 41 | ] 42 | }, 43 | metadata: { 44 | searchEngine: 'gemini', 45 | timestamp: new Date().toISOString(), 46 | resultCount: 2 47 | } 48 | }) 49 | }, 2000 + Math.random() * 2000) // 2-4 seconds 50 | }) 51 | } 52 | 53 | async executeRAGQuery(task) { 54 | // Simulate RAG query against internal knowledge base 55 | return new Promise((resolve) => { 56 | setTimeout(() => { 57 | resolve({ 58 | title: task.title, 59 | content: `Internal knowledge results for: ${task.query}`, 60 | source: 'rag_query', 61 | data: { 62 | query: task.query, 63 | documents: [ 64 | { 65 | id: 'doc1', 66 | title: 'Internal research document', 67 | relevance: 0.85, 68 | excerpt: 'Previous analysis indicates...' 69 | } 70 | ] 71 | }, 72 | metadata: { 73 | knowledgeBase: 'internal', 74 | timestamp: new Date().toISOString(), 75 | relevanceScore: 0.85 76 | } 77 | }) 78 | }, 1500 + Math.random() * 1500) // 1.5-3 seconds 79 | }) 80 | } 81 | 82 | async executeMCPQuery(task) { 83 | // Simulate MCP (Model Context Protocol) data access 84 | return new Promise((resolve) => { 85 | setTimeout(() => { 86 | resolve({ 87 | title: task.title, 88 | content: `Database/API results for: ${task.query}`, 89 | source: 'mcp_data', 90 | data: { 91 | query: task.query, 92 | records: [ 93 | { 94 | id: 'record1', 95 | type: 'statistical_data', 96 | value: Math.random() * 1000, 97 | unit: 'units' 98 | } 99 | ] 100 | }, 101 | metadata: { 102 | database: 'structured_data', 103 | timestamp: new Date().toISOString(), 104 | recordCount: 1 105 | } 106 | }) 107 | }, 1000 + Math.random() * 1000) // 1-2 seconds 108 | }) 109 | } 110 | } 111 | 112 | export default new AgentExecutionWorkers() -------------------------------------------------------------------------------- /ui/src/services/AgentExecutionWorkers.js: -------------------------------------------------------------------------------- 1 | import { AGENT_TYPES } from '../types' 2 | 3 | class AgentExecutionWorkers { 4 | async executeTask(task) { 5 | console.log(`Executing task: ${task.title} with agent: ${task.agent}`) 6 | 7 | switch (task.agent) { 8 | case AGENT_TYPES.WEB: 9 | return this.executeWebSearch(task) 10 | case AGENT_TYPES.RAG: 11 | return this.executeRAGQuery(task) 12 | case AGENT_TYPES.MCP: 13 | return this.executeMCPQuery(task) 14 | default: 15 | throw new Error(`Unknown agent type: ${task.agent}`) 16 | } 17 | } 18 | 19 | async executeWebSearch(task) { 20 | // Simulate web search using Gemini search tool 21 | // In real implementation, would use the Gemini CLI tool as documented 22 | return new Promise((resolve) => { 23 | setTimeout(() => { 24 | resolve({ 25 | title: task.title, 26 | content: `Web search results for: ${task.query}`, 27 | source: 'web_search', 28 | data: { 29 | query: task.query, 30 | results: [ 31 | { 32 | title: `Academic paper on ${task.query}`, 33 | url: 'https://example.com/paper1', 34 | snippet: 'Relevant research findings...' 35 | }, 36 | { 37 | title: `Industry report on ${task.query}`, 38 | url: 'https://example.com/report1', 39 | snippet: 'Statistical analysis shows...' 40 | } 41 | ] 42 | }, 43 | metadata: { 44 | searchEngine: 'gemini', 45 | timestamp: new Date().toISOString(), 46 | resultCount: 2 47 | } 48 | }) 49 | }, 2000 + Math.random() * 2000) // 2-4 seconds 50 | }) 51 | } 52 | 53 | async executeRAGQuery(task) { 54 | // Simulate RAG query against internal knowledge base 55 | return new Promise((resolve) => { 56 | setTimeout(() => { 57 | resolve({ 58 | title: task.title, 59 | content: `Internal knowledge results for: ${task.query}`, 60 | source: 'rag_query', 61 | data: { 62 | query: task.query, 63 | documents: [ 64 | { 65 | id: 'doc1', 66 | title: 'Internal research document', 67 | relevance: 0.85, 68 | excerpt: 'Previous analysis indicates...' 69 | } 70 | ] 71 | }, 72 | metadata: { 73 | knowledgeBase: 'internal', 74 | timestamp: new Date().toISOString(), 75 | relevanceScore: 0.85 76 | } 77 | }) 78 | }, 1500 + Math.random() * 1500) // 1.5-3 seconds 79 | }) 80 | } 81 | 82 | async executeMCPQuery(task) { 83 | // Simulate MCP (Model Context Protocol) data access 84 | return new Promise((resolve) => { 85 | setTimeout(() => { 86 | resolve({ 87 | title: task.title, 88 | content: `Database/API results for: ${task.query}`, 89 | source: 'mcp_data', 90 | data: { 91 | query: task.query, 92 | records: [ 93 | { 94 | id: 'record1', 95 | type: 'statistical_data', 96 | value: Math.random() * 1000, 97 | unit: 'units' 98 | } 99 | ] 100 | }, 101 | metadata: { 102 | database: 'structured_data', 103 | timestamp: new Date().toISOString(), 104 | recordCount: 1 105 | } 106 | }) 107 | }, 1000 + Math.random() * 1000) // 1-2 seconds 108 | }) 109 | } 110 | } 111 | 112 | export default new AgentExecutionWorkers() -------------------------------------------------------------------------------- /daily/vis.md: -------------------------------------------------------------------------------- 1 | You are an expert web designer specializing in professional financial data visualization. Your task is to take a raw text financial report provided by the user and transform it into a sophisticated, single-file HTML report with a specific visual theme. 2 | 3 | All content, including text, numbers, and table entries, must be derived directly from the user's input. Your primary role is the visual and structural transformation based on the theme defined below. 4 | 5 | 1. Overall Theme & Layout 6 | Theme: A modern, professional dark theme using a slate blue and gold palette. The aesthetic should be clean, data-focused, and authoritative. 7 | 8 | Structure: Generate a single, self-contained HTML file. Use semantic HTML tags (
,
,
,

, etc.) to structure the document logically based on the headings in the source text. 9 | 10 | Dependencies: Use CDN links for Tailwind CSS for styling and Chart.js for data visualization. 11 | 12 | 2. Typography (Fonts, Size, Color) 13 | Font Family: Use a clean, professional sans-serif font stack: font-family: 'Inter', sans-serif;. 14 | 15 | Color Palette (Dark Theme): 16 | 17 | Page Background: Dark, desaturated slate blue (#1e293b). 18 | 19 | Primary Text: Off-white (#f8fafc). 20 | 21 | Container Backgrounds (Tables/Charts): A slightly lighter slate blue to create depth (e.g., #283447). 22 | 23 | Accent / Title Border: Muted, elegant gold (#c0a062). 24 | 25 | Muted / Note Text: A light, muted gray-blue (#94a3b8). 26 | 27 | Positive Values (Up): A professional, medium blue (#3b82f6). 28 | 29 | Negative Values (Down): A clear, desaturated red (#ef4444). 30 | 31 | Sizing & Weight: 32 | 33 | Main Title (

): Large and bold (e.g., Tailwind text-3xl font-bold). 34 | 35 | Section Titles (

): Very prominent (e.g., text-xl font-bold) with a 2px gold bottom border. 36 | 37 | Subsection Titles (

): Moderately prominent (e.g., text-lg font-semibold). 38 | 39 | Body Text (

): Standard size and weight for readability. 40 | 41 | 3. Table Styling 42 | Structure: When the source text contains tabular data, format it into a proper HTML . 43 | 44 | Header (): Use the container background color and gold (#c0a062) bold text. 45 | 46 | Rows (): Use the main page background and the slightly lighter container background for alternating row colors. Use a subtle bottom border (1px solid #334155) for each row. 47 | 48 | Data Formatting: For columns showing market changes, automatically format the data: 49 | 50 | Positive numbers should be colored blue (#3b82f6). 51 | 52 | Negative numbers should be colored red (#ef4444). 53 | 54 | 4. Chart Generation & Style 55 | Automatic Generation: Analyze the input text to identify opportunities for data visualization. If the text compares several items (e.g., index performance, stock movers, sector changes), generate a chart. 56 | 57 | Chart Type: Primarily use horizontal bar charts (type: 'bar', indexAxis: 'y') for clear comparison. 58 | 59 | Styling (Chart.js options): 60 | 61 | Container: Place each inside a
with the container background color, rounded corners, and padding. 62 | 63 | Colors: Bar colors must correspond to the data. 64 | 65 | For positive values, use the blue (#3b82f6). For visual appeal, you can create a gradient from this blue (#3b82f6) to a lighter sky blue (#93c5fd). 66 | 67 | For negative values, use the red (#ef4444). 68 | 69 | Axes & Grid: Use subtle, dark grid lines that match the theme (e.g., #334155). Axis labels should be off-white (#f8fafc). 70 | 71 | Tooltips & Legend: Style tooltips for clarity. Disable the legend (plugins: { legend: { display: false } }) if the chart is self-explanatory. 72 | 73 | Axis Tick Formatting: Ensure numerical axis labels are clean. For percentages, format them to two decimal places and append a % sign (e.g., value.toFixed(2) + '%'). 74 | 75 | Implementation: Include the necessary 6 | 38 | 39 | 40 |
41 |

Ford Motor Company Q2 2025 Earnings Overview

42 | 43 |

Segment Performance (EBIT in Billions USD)

44 | 45 | 46 |
47 |

Key Financial Highlights:

48 |
    49 |
  • Earnings Per Share (EPS): $0.37 (vs. estimates of $0.30-$0.31)
  • 50 |
  • Revenue: $50.18 billion (vs. estimates of $45.29 billion)
  • 51 |
  • Dividend: 15 cents per share declared for Q3
  • 52 |
53 |

Future Outlook:

54 |

Full-year 2025 guidance reinstated. Anticipated gross adverse EBIT impact of $2.5 billion and net adverse EBIT impact of approximately $1.5 billion from tariff-related costs.

55 |
56 |
57 | 58 | 120 | 121 | -------------------------------------------------------------------------------- /example/earnings_call/planning_meta_earnings_call_20250731.md: -------------------------------------------------------------------------------- 1 | # Planning: Deep Research on Meta's Latest Earnings Call 2 | 3 | **Keyword:** meta_earnings_call 4 | **Date:** 20250731 5 | 6 | ## Objective: 7 | To conduct a comprehensive deep research on Meta's latest earnings call, covering key financial highlights, strategic insights, future outlook, and market reactions. The research will culminate in a detailed markdown report and a bilingual HTML visualization. 8 | 9 | ## Step 1: Information Gathering (Research Phase) 10 | 11 | ### 1.1 Identify the Latest Earnings Call: 12 | * **Action:** Determine the date and quarter of Meta's most recent earnings call. 13 | * **Tool:** `google_web_search` (e.g., "Meta latest earnings call date", "Meta Q2 2025 earnings call"). 14 | 15 | ### 1.2 Obtain Earnings Call Transcript and Related Documents: 16 | * **Action:** Locate and access the official transcript, press release, and investor presentation for the identified earnings call. 17 | * **Tool:** `google_web_search` (e.g., "Meta Q2 2025 earnings call transcript", "Meta investor relations"). Prioritize official Meta Platforms Inc. sources (investor.fb.com or similar). 18 | 19 | ### 1.3 Analyze Financial Performance: 20 | * **Action:** Extract key financial metrics: revenue (total, by segment), net income, EPS, operating income, free cash flow, user growth (DAU, MAU for Facebook, Instagram, WhatsApp), and capital expenditures. 21 | * **Tool:** Read and parse the earnings call transcript and investor presentation. 22 | 23 | ### 1.4 Identify Strategic Highlights and Key Announcements: 24 | * **Action:** Pinpoint major announcements, strategic shifts, product updates, and significant investments discussed during the call (e.g., AI initiatives, metaverse developments, advertising trends, regulatory challenges). 25 | * **Tool:** Read and analyze the transcript, focusing on management commentary and Q&A sessions. 26 | 27 | ### 1.5 Understand Future Outlook and Guidance: 28 | * **Action:** Document Meta's forward-looking statements, revenue guidance, expense projections, and any other future-oriented commentary. 29 | * **Tool:** Read and analyze the transcript, specifically the outlook section and management's responses to analyst questions. 30 | 31 | ### 1.6 Assess Market and Analyst Reactions: 32 | * **Action:** Research how financial analysts and news outlets reacted to the earnings call (e.g., stock price movement, analyst ratings, key takeaways from financial news). 33 | * **Tool:** `google_web_search` (e.g., "Meta earnings call reaction", "analyst reports Meta Q2 2025"). 34 | 35 | ## Step 2: Data Structuring and Report Composing 36 | 37 | ### 2.1 Outline Report Structure: 38 | * **Action:** Define sections for the markdown report: Executive Summary, Financial Highlights, Strategic Insights, Future Outlook, Market Reaction, and Appendix (Sources). 39 | 40 | ### 2.2 Populate Report Sections: 41 | * **Action:** Synthesize gathered information into concise, well-structured paragraphs and bullet points. 42 | * **Action:** Create tables for financial data where appropriate (e.g., revenue breakdown, user metrics). 43 | * **Action:** Ensure all claims are supported by data or direct quotes from the earnings call. 44 | 45 | ### 2.3 Include Sources: 46 | * **Action:** List all URLs of sources used in an "Appendix" section of the report. 47 | * **Action:** Integrate in-text citations or references where necessary. 48 | 49 | ## Step 3: Visualization (HTML Webpage) 50 | 51 | ### 3.1 Read Visualization Instructions: 52 | * **Action:** Read the `vis.md` file to understand the styling and layout requirements for the HTML webpage. 53 | * **Tool:** `read_file` for `/Users/daoming/prog/work/reports/deep/vis.md`. 54 | 55 | ### 3.2 Design Webpage Layout: 56 | * **Action:** Plan the layout of the bilingual webpage, ensuring a newspaper-like front page aesthetic. Consider sections for headlines, key financial figures, strategic summaries, and charts. 57 | 58 | ### 3.3 Implement Bilingual Content: 59 | * **Action:** Translate all key content (headlines, summaries, table headers, chart labels) into Simplified Chinese. 60 | 61 | ### 3.4 Create Data Visualizations: 62 | * **Action:** Design and implement charts (e.g., bar charts for revenue, line charts for user growth) using appropriate web technologies (e.g., JavaScript libraries like Chart.js or D3.js, or simple HTML/CSS for static representations if dynamic charts are not feasible within the tool's constraints). 63 | * **Constraint:** Pay close attention to avoiding "unstoppable extending height of chart axis" as per `instruct.md`. 64 | 65 | ### 3.5 Assemble HTML: 66 | * **Action:** Write the HTML, CSS, and JavaScript (if dynamic charts are used) to create the `vis_meta_earnings_call_20250731.html` file. 67 | 68 | ## Step 4: Logging 69 | 70 | ### 4.1 Maintain a Detailed Log: 71 | * **Action:** Continuously record all steps taken, tools used, search queries, key findings, and any challenges encountered. 72 | * **Tool:** Append to `log_meta_earnings_call_20250731_[hhmmss].md` throughout the entire process. 73 | -------------------------------------------------------------------------------- /gui/src/components/Card.jsx: -------------------------------------------------------------------------------- 1 | import { useState } from 'react' 2 | import { CARD_TYPES } from '../types' 3 | 4 | const Card = ({ card }) => { 5 | const [isExpanded, setIsExpanded] = useState(false) 6 | 7 | const getCardIcon = (type) => { 8 | switch (type) { 9 | case CARD_TYPES.TEXT_SUMMARY: return '📄' 10 | case CARD_TYPES.CHART: return '📊' 11 | case CARD_TYPES.TABLE: return '📋' 12 | case CARD_TYPES.QUOTE: return '💬' 13 | case CARD_TYPES.IMAGE: return '🖼️' 14 | default: return '📄' 15 | } 16 | } 17 | 18 | const getCardColor = (type) => { 19 | switch (type) { 20 | case CARD_TYPES.TEXT_SUMMARY: return 'border-blue-200 bg-blue-50' 21 | case CARD_TYPES.CHART: return 'border-green-200 bg-green-50' 22 | case CARD_TYPES.TABLE: return 'border-purple-200 bg-purple-50' 23 | case CARD_TYPES.QUOTE: return 'border-yellow-200 bg-yellow-50' 24 | case CARD_TYPES.IMAGE: return 'border-pink-200 bg-pink-50' 25 | default: return 'border-gray-200 bg-gray-50' 26 | } 27 | } 28 | 29 | const formatTimestamp = (timestamp) => { 30 | return new Date(timestamp).toLocaleString() 31 | } 32 | 33 | return ( 34 |
35 |
36 |
37 | {getCardIcon(card.type)} 38 |
39 |

{card.title}

40 |

41 | {card.type.replace('_', ' ')} 42 |

43 |
44 |
45 | 51 |
52 | 53 |
54 | {/* Content Preview */} 55 |
56 | {isExpanded ? ( 57 |
{card.content}
58 | ) : ( 59 |
60 | {card.content.length > 100 61 | ? `${card.content.substring(0, 100)}...` 62 | : card.content 63 | } 64 |
65 | )} 66 |
67 | 68 | {/* Metadata */} 69 | {isExpanded && card.metadata && ( 70 |
71 | {card.metadata.source && ( 72 |
73 | Source: 74 | {card.metadata.source} 75 |
76 | )} 77 | {card.metadata.confidence && ( 78 |
79 | Confidence: 80 | 81 | {Math.round(card.metadata.confidence * 100)}% 82 | 83 |
84 | )} 85 | {card.metadata.timestamp && ( 86 |
87 | Generated: 88 | 89 | {formatTimestamp(card.metadata.timestamp)} 90 | 91 |
92 | )} 93 |
94 | )} 95 | 96 | {/* Raw Data Preview */} 97 | {isExpanded && card.rawData && ( 98 |
99 |
100 | 101 | Raw Data 102 | 103 |
104 |                 {JSON.stringify(card.rawData, null, 2)}
105 |               
106 |
107 |
108 | )} 109 | 110 | {/* Actions */} 111 |
112 |
113 | 116 | 119 |
120 |
121 | ID: {card.id} 122 |
123 |
124 |
125 |
126 | ) 127 | } 128 | 129 | export default Card -------------------------------------------------------------------------------- /ui/src/components/Card.jsx: -------------------------------------------------------------------------------- 1 | import { useState } from 'react' 2 | import { CARD_TYPES } from '../types' 3 | 4 | const Card = ({ card }) => { 5 | const [isExpanded, setIsExpanded] = useState(false) 6 | 7 | const getCardIcon = (type) => { 8 | switch (type) { 9 | case CARD_TYPES.TEXT_SUMMARY: return '📄' 10 | case CARD_TYPES.CHART: return '📊' 11 | case CARD_TYPES.TABLE: return '📋' 12 | case CARD_TYPES.QUOTE: return '💬' 13 | case CARD_TYPES.IMAGE: return '🖼️' 14 | default: return '📄' 15 | } 16 | } 17 | 18 | const getCardColor = (type) => { 19 | switch (type) { 20 | case CARD_TYPES.TEXT_SUMMARY: return 'border-blue-200 bg-blue-50' 21 | case CARD_TYPES.CHART: return 'border-green-200 bg-green-50' 22 | case CARD_TYPES.TABLE: return 'border-purple-200 bg-purple-50' 23 | case CARD_TYPES.QUOTE: return 'border-yellow-200 bg-yellow-50' 24 | case CARD_TYPES.IMAGE: return 'border-pink-200 bg-pink-50' 25 | default: return 'border-gray-200 bg-gray-50' 26 | } 27 | } 28 | 29 | const formatTimestamp = (timestamp) => { 30 | return new Date(timestamp).toLocaleString() 31 | } 32 | 33 | return ( 34 |
35 |
36 |
37 | {getCardIcon(card.type)} 38 |
39 |

{card.title}

40 |

41 | {card.type.replace('_', ' ')} 42 |

43 |
44 |
45 | 51 |
52 | 53 |
54 | {/* Content Preview */} 55 |
56 | {isExpanded ? ( 57 |
{card.content}
58 | ) : ( 59 |
60 | {card.content.length > 100 61 | ? `${card.content.substring(0, 100)}...` 62 | : card.content 63 | } 64 |
65 | )} 66 |
67 | 68 | {/* Metadata */} 69 | {isExpanded && card.metadata && ( 70 |
71 | {card.metadata.source && ( 72 |
73 | Source: 74 | {card.metadata.source} 75 |
76 | )} 77 | {card.metadata.confidence && ( 78 |
79 | Confidence: 80 | 81 | {Math.round(card.metadata.confidence * 100)}% 82 | 83 |
84 | )} 85 | {card.metadata.timestamp && ( 86 |
87 | Generated: 88 | 89 | {formatTimestamp(card.metadata.timestamp)} 90 | 91 |
92 | )} 93 |
94 | )} 95 | 96 | {/* Raw Data Preview */} 97 | {isExpanded && card.rawData && ( 98 |
99 |
100 | 101 | Raw Data 102 | 103 |
104 |                 {JSON.stringify(card.rawData, null, 2)}
105 |               
106 |
107 |
108 | )} 109 | 110 | {/* Actions */} 111 |
112 |
113 | 116 | 119 |
120 |
121 | ID: {card.id} 122 |
123 |
124 |
125 |
126 | ) 127 | } 128 | 129 | export default Card -------------------------------------------------------------------------------- /example/earnings_call/planning_arm_earnings_call_20250731.md: -------------------------------------------------------------------------------- 1 | # Planning: Deep Research on ARM's Latest Earnings Call - 2025-07-31 2 | 3 | ## Objective 4 | To conduct a comprehensive deep research on ARM's latest earnings call, extracting key financial data, strategic insights, management commentary, market reactions, and future outlook, and present it in a structured report and a bilingual webpage. 5 | 6 | ## Keyword 7 | arm_earnings_call 8 | 9 | ## Current Date 10 | 2025-07-31 11 | 12 | ## Detailed To-Do List 13 | 14 | ### Phase 1: Information Gathering & Initial Analysis 15 | 16 | 1. **Identify Latest Earnings Call:** 17 | * Search for "ARM Holdings latest earnings call date" or "ARM investor relations earnings calendar". 18 | * Confirm the exact date and reporting period (e.g., Q1 2025, FY 2024). 19 | * *Log Source URLs.* 20 | 21 | 2. **Locate Official Documents/Transcripts:** 22 | * Navigate to ARM's official Investor Relations website. 23 | * Find the earnings release, investor presentation, and webcast/transcript. 24 | * Prioritize official transcripts or reputable financial news transcripts (e.g., Seeking Alpha, Bloomberg, Reuters). 25 | * *Log Source URLs.* 26 | 27 | 3. **Extract Key Financial Highlights:** 28 | * **Revenue:** Total revenue, breakdown by segment (e.g., royalty, licensing, IoT, automotive). 29 | * **Profitability:** Gross margin, operating income, net income. 30 | * **Earnings Per Share (EPS):** Reported and adjusted EPS. 31 | * **Guidance:** Future revenue and EPS guidance for the next quarter/fiscal year. 32 | * **Key Metrics:** Any other relevant operational metrics (e.g., design wins, unit shipments). 33 | * *Log Data Points and Source URLs.* 34 | 35 | 4. **Analyze Strategic Updates & Business Segments:** 36 | * **New Products/Technologies:** Any announcements regarding new CPU architectures, GPUs, NPUs, or software platforms. 37 | * **Market Trends:** Discussion on key market trends impacting ARM (e.g., AI, data centers, automotive, IoT). 38 | * **Partnerships/Collaborations:** Any significant new or expanded partnerships. 39 | * **R&D Investments:** Focus areas for research and development. 40 | * *Log Key Information and Source URLs.* 41 | 42 | 5. **Summarize Management Commentary:** 43 | * **CEO/CFO Statements:** Key messages, strategic priorities, and performance drivers. 44 | * **Outlook:** Management's perspective on future growth, challenges, and opportunities. 45 | * **Capital Allocation:** Any discussion on share buybacks, dividends, or M&A. 46 | * *Log Key Quotes/Summaries and Source URLs.* 47 | 48 | 6. **Review Analyst Q&A Session:** 49 | * Identify recurring themes or critical questions from analysts. 50 | * Analyze management's responses for clarity, transparency, and forward-looking insights. 51 | * *Log Key Questions/Answers and Source URLs.* 52 | 53 | ### Phase 2: Contextual Analysis & Reporting 54 | 55 | 7. **Assess Market Reaction & Analyst Sentiment:** 56 | * Monitor stock price movement immediately after the earnings release. 57 | * Search for analyst reports or news articles summarizing market sentiment and ratings changes. 58 | * *Log Market Data and Source URLs.* 59 | 60 | 8. **Competitive Landscape Comparison:** 61 | * Briefly compare ARM's performance and strategic positioning against key competitors (e.g., Intel, AMD, Nvidia, Qualcomm in relevant segments) if information is readily available and relevant to the earnings call discussion. 62 | * *Log Comparative Data and Source URLs.* 63 | 64 | 9. **Synthesize Future Outlook:** 65 | * Consolidate all forward-looking statements from the earnings call, guidance, and management commentary. 66 | * Identify potential risks and opportunities. 67 | * *Log Synthesized Outlook.* 68 | 69 | ### Phase 3: Report & Visualization Generation 70 | 71 | 10. **Compose Report (report_arm_earnings_call_20250731.md):** 72 | * Structure the report with clear headings (Executive Summary, Financial Highlights, Strategic Updates, Management Commentary, Q&A Insights, Market Reaction, Future Outlook, Conclusion, Appendix). 73 | * Use tables for financial data and key metrics. 74 | * Include in-text citations for all sources and a comprehensive appendix with all source URLs. 75 | 76 | 11. **Craft Bilingual Webpage (vis_arm_earnings_call_20250731.html):** 77 | * Read `vis.md` for styling instructions. 78 | * Translate all content (text, headings, table data) into Simplified Chinese. 79 | * Design a visually appealing webpage resembling a newspaper front page. 80 | * Ensure charts/visualizations are clear and avoid extending height issues. 81 | * Include key highlights and summaries from the report. 82 | 83 | ### Phase 4: Logging 84 | 85 | 12. **Maintain Log File (log_arm_earnings_call_20250731_[hhmmss].md):** 86 | * Record every step taken, including search queries, URLs visited, decisions made, and any challenges encountered. 87 | * Update the `task_arm_earnings_call_20250731_[hhmmss].md` file by ticking off completed tasks and appending new ones if necessary. 88 | -------------------------------------------------------------------------------- /daily/reports/20250727.md: -------------------------------------------------------------------------------- 1 | 2 | # Financial Market Analysis: July 27, 2025 3 | 4 | ## 1. Market Indexes Performance 5 | 6 | The US stock market showed positive momentum on Friday, July 25, 2025. 7 | 8 | | Index | Current Value | Change | % Change | 9 | |---|---|---|---| 10 | | Dow Jones (DJIA) | 44,693.91 | +209.66 | +0.47% | 11 | | S&P 500 | 6,388.65 | +25.43 | +0.40% | 12 | | Nasdaq Composite | 21,057.96 | +37.94 | +0.61% | 13 | 14 | The Dow is up 1.26% for the week and 4.13% for the past month. The S&P 500 gained 1.18% in the past week and 4.66% in the last month, reaching a new record high. The Nasdaq Composite also rose to a new record high. 15 | 16 | ## 2. Commodities and Cryptocurrencies 17 | 18 | **Commodities:** 19 | 20 | | Commodity | Current Price | Change | % Change | 21 | |---|---|---|---| 22 | | Crude Oil | $65.07/barrel | -$0.95 | -1.45% | 23 | | Brent Crude | $68.36/barrel | -$0.82 | -1.19% | 24 | | Gold | $3,336.98/ounce| -$31.22 | -0.93% | 25 | 26 | Crude oil prices have declined recently, with projections suggesting a potential rise to $68.85 by the end of the quarter. Gold prices also dipped but have shown significant gains over the past year (up 39.83%). 27 | 28 | **Cryptocurrencies:** 29 | 30 | The overall cryptocurrency market has experienced a slight downturn this week, with the total market capitalization shrinking by 1.36% to $3.67 trillion. However, the market has seen remarkable growth over the past year, up 55.96%. 31 | 32 | * **Bitcoin (BTC):** Trading around $118,500 with a market cap of $2.35 trillion. 33 | * **Ethereum (ETH):** Trading at $3,670.00. 34 | 35 | ## 3. Factors Impacting the Market 36 | 37 | Several factors are influencing the market: 38 | 39 | * **Inflation and Central Bank Policies:** Inflation remains a key concern, with potential interest rate hikes from central banks. 40 | * **Geopolitical Events:** Tensions between the U.S. and China and the conflict in Ukraine are creating uncertainty. 41 | * **Corporate Earnings:** A mixed picture of corporate health is emerging from the current earnings season. 42 | * **International Trade:** Ongoing trade negotiations, particularly between the US and the EU, are being closely monitored. 43 | * **Economic Data:** Upcoming releases on GDP, inflation, and employment will provide further insight into the health of the economy. 44 | 45 | ## 4. Performance of Flagged Stocks 46 | 47 | **The Magnificent Seven:** 48 | 49 | This group of tech stocks has been a significant driver of market performance. 50 | 51 | * **Nvidia (NVDA):** Surging in 2025, a critical player in the AI boom. 52 | * **Meta Platforms (META):** Strong earnings growth projections. 53 | * **Microsoft (MSFT):** Strong performance and upward-trending earnings revisions. 54 | * **Amazon (AMZN) & Alphabet (GOOGL):** Positive returns. 55 | * **Tesla (TSLA):** Noted as a laggard in early 2024. 56 | * **Apple (AAPL):** Reported year-over-year earnings growth in late 2023. 57 | 58 | **Bank Stocks:** 59 | 60 | The banking sector has shown strong performance in 2025, with the Dow Jones US Banks index returning 13% in the first half of the year. Key drivers include the expectation of lower interest rates and a positive economic outlook. 61 | 62 | * **JPMorgan Chase (JPM):** Strong track record of profitability. 63 | * **Bank of America (BAC):** Impressive growth in its loan portfolio. 64 | * **U.S. Bancorp (USB):** Consistently strong profitability and efficiency metrics. 65 | 66 | **Consumer-Related Stocks:** 67 | 68 | * **Consumer Discretionary:** Up 22.6% over the last 12 months. Top performers include Amazon, O'Reilly Automotive, and Home Depot. 69 | * **Consumer Staples:** Up 6.7% over the past year. Top performers include Kroger, Kellanova, and Altria Group. 70 | 71 | ## 5. Top Movers 72 | 73 | **Top Moving Sectors:** 74 | 75 | | Sector | Daily Change (%) | 76 | |---|---| 77 | | Consumer Durables | +1.87% | 78 | | Transportation | +1.12% | 79 | | Producer Manufacturing| +0.95% | 80 | | Health Services | +0.70% | 81 | | Industrial Services | +0.58% | 82 | 83 | **Top Moving Stocks:** 84 | 85 | * **Coursera, Inc. (COUR):** +36.23% 86 | * **Comfort Systems USA, Inc. (FIX):** +22.37% 87 | * **Bel Fuse Inc. (BELFA):** +20.21% 88 | * **Jyong Biotech Ltd. (MENS):** +17.15% 89 | * **Bel Fuse Inc. (BELFB):** +16.37% 90 | 91 | ## 6. Upcoming Events 92 | 93 | * **Economic Data:** Releases of CPI, PPI, jobs reports, GDP growth, and retail sales data. 94 | * **Central Bank Announcements:** Upcoming meetings of major central banks, including the Federal Reserve. 95 | * **Corporate Earnings:** Ongoing earnings season, particularly in the technology sector. 96 | * **Geopolitical Developments:** Unforeseen events that could introduce volatility. 97 | 98 | ## 7. Short-Term Factors and Predictions 99 | 100 | Short-term market movements are difficult to predict. Analysts use technical and fundamental analysis to forecast potential trends. 101 | 102 | * **Technical Analysis:** Utilizes chart patterns and indicators like Moving Averages, RSI, and MACD. 103 | * **Fundamental Analysis:** Examines economic data, company financials, and industry trends. 104 | 105 | Many experts advise a long-term investment strategy to mitigate the risks of short-term volatility. 106 | --------------------------------------------------------------------------------