realtimex-deeptutor 0.5.0.post1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- realtimex_deeptutor/__init__.py +67 -0
- realtimex_deeptutor-0.5.0.post1.dist-info/METADATA +1612 -0
- realtimex_deeptutor-0.5.0.post1.dist-info/RECORD +276 -0
- realtimex_deeptutor-0.5.0.post1.dist-info/WHEEL +5 -0
- realtimex_deeptutor-0.5.0.post1.dist-info/entry_points.txt +2 -0
- realtimex_deeptutor-0.5.0.post1.dist-info/licenses/LICENSE +661 -0
- realtimex_deeptutor-0.5.0.post1.dist-info/top_level.txt +2 -0
- src/__init__.py +40 -0
- src/agents/__init__.py +24 -0
- src/agents/base_agent.py +657 -0
- src/agents/chat/__init__.py +24 -0
- src/agents/chat/chat_agent.py +435 -0
- src/agents/chat/prompts/en/chat_agent.yaml +35 -0
- src/agents/chat/prompts/zh/chat_agent.yaml +35 -0
- src/agents/chat/session_manager.py +311 -0
- src/agents/co_writer/__init__.py +0 -0
- src/agents/co_writer/edit_agent.py +260 -0
- src/agents/co_writer/narrator_agent.py +423 -0
- src/agents/co_writer/prompts/en/edit_agent.yaml +113 -0
- src/agents/co_writer/prompts/en/narrator_agent.yaml +88 -0
- src/agents/co_writer/prompts/zh/edit_agent.yaml +113 -0
- src/agents/co_writer/prompts/zh/narrator_agent.yaml +88 -0
- src/agents/guide/__init__.py +16 -0
- src/agents/guide/agents/__init__.py +11 -0
- src/agents/guide/agents/chat_agent.py +104 -0
- src/agents/guide/agents/interactive_agent.py +223 -0
- src/agents/guide/agents/locate_agent.py +149 -0
- src/agents/guide/agents/summary_agent.py +150 -0
- src/agents/guide/guide_manager.py +500 -0
- src/agents/guide/prompts/en/chat_agent.yaml +41 -0
- src/agents/guide/prompts/en/interactive_agent.yaml +202 -0
- src/agents/guide/prompts/en/locate_agent.yaml +68 -0
- src/agents/guide/prompts/en/summary_agent.yaml +157 -0
- src/agents/guide/prompts/zh/chat_agent.yaml +41 -0
- src/agents/guide/prompts/zh/interactive_agent.yaml +626 -0
- src/agents/guide/prompts/zh/locate_agent.yaml +68 -0
- src/agents/guide/prompts/zh/summary_agent.yaml +157 -0
- src/agents/ideagen/__init__.py +12 -0
- src/agents/ideagen/idea_generation_workflow.py +426 -0
- src/agents/ideagen/material_organizer_agent.py +173 -0
- src/agents/ideagen/prompts/en/idea_generation.yaml +187 -0
- src/agents/ideagen/prompts/en/material_organizer.yaml +69 -0
- src/agents/ideagen/prompts/zh/idea_generation.yaml +187 -0
- src/agents/ideagen/prompts/zh/material_organizer.yaml +69 -0
- src/agents/question/__init__.py +24 -0
- src/agents/question/agents/__init__.py +18 -0
- src/agents/question/agents/generate_agent.py +381 -0
- src/agents/question/agents/relevance_analyzer.py +207 -0
- src/agents/question/agents/retrieve_agent.py +239 -0
- src/agents/question/coordinator.py +718 -0
- src/agents/question/example.py +109 -0
- src/agents/question/prompts/en/coordinator.yaml +75 -0
- src/agents/question/prompts/en/generate_agent.yaml +77 -0
- src/agents/question/prompts/en/relevance_analyzer.yaml +41 -0
- src/agents/question/prompts/en/retrieve_agent.yaml +32 -0
- src/agents/question/prompts/zh/coordinator.yaml +75 -0
- src/agents/question/prompts/zh/generate_agent.yaml +77 -0
- src/agents/question/prompts/zh/relevance_analyzer.yaml +39 -0
- src/agents/question/prompts/zh/retrieve_agent.yaml +30 -0
- src/agents/research/agents/__init__.py +23 -0
- src/agents/research/agents/decompose_agent.py +507 -0
- src/agents/research/agents/manager_agent.py +228 -0
- src/agents/research/agents/note_agent.py +180 -0
- src/agents/research/agents/rephrase_agent.py +263 -0
- src/agents/research/agents/reporting_agent.py +1333 -0
- src/agents/research/agents/research_agent.py +714 -0
- src/agents/research/data_structures.py +451 -0
- src/agents/research/main.py +188 -0
- src/agents/research/prompts/en/decompose_agent.yaml +89 -0
- src/agents/research/prompts/en/manager_agent.yaml +24 -0
- src/agents/research/prompts/en/note_agent.yaml +121 -0
- src/agents/research/prompts/en/rephrase_agent.yaml +58 -0
- src/agents/research/prompts/en/reporting_agent.yaml +380 -0
- src/agents/research/prompts/en/research_agent.yaml +173 -0
- src/agents/research/prompts/zh/decompose_agent.yaml +89 -0
- src/agents/research/prompts/zh/manager_agent.yaml +24 -0
- src/agents/research/prompts/zh/note_agent.yaml +121 -0
- src/agents/research/prompts/zh/rephrase_agent.yaml +58 -0
- src/agents/research/prompts/zh/reporting_agent.yaml +380 -0
- src/agents/research/prompts/zh/research_agent.yaml +173 -0
- src/agents/research/research_pipeline.py +1309 -0
- src/agents/research/utils/__init__.py +60 -0
- src/agents/research/utils/citation_manager.py +799 -0
- src/agents/research/utils/json_utils.py +98 -0
- src/agents/research/utils/token_tracker.py +297 -0
- src/agents/solve/__init__.py +80 -0
- src/agents/solve/analysis_loop/__init__.py +14 -0
- src/agents/solve/analysis_loop/investigate_agent.py +414 -0
- src/agents/solve/analysis_loop/note_agent.py +190 -0
- src/agents/solve/main_solver.py +862 -0
- src/agents/solve/memory/__init__.py +34 -0
- src/agents/solve/memory/citation_memory.py +353 -0
- src/agents/solve/memory/investigate_memory.py +226 -0
- src/agents/solve/memory/solve_memory.py +340 -0
- src/agents/solve/prompts/en/analysis_loop/investigate_agent.yaml +55 -0
- src/agents/solve/prompts/en/analysis_loop/note_agent.yaml +54 -0
- src/agents/solve/prompts/en/solve_loop/manager_agent.yaml +67 -0
- src/agents/solve/prompts/en/solve_loop/precision_answer_agent.yaml +62 -0
- src/agents/solve/prompts/en/solve_loop/response_agent.yaml +90 -0
- src/agents/solve/prompts/en/solve_loop/solve_agent.yaml +75 -0
- src/agents/solve/prompts/en/solve_loop/tool_agent.yaml +38 -0
- src/agents/solve/prompts/zh/analysis_loop/investigate_agent.yaml +53 -0
- src/agents/solve/prompts/zh/analysis_loop/note_agent.yaml +54 -0
- src/agents/solve/prompts/zh/solve_loop/manager_agent.yaml +66 -0
- src/agents/solve/prompts/zh/solve_loop/precision_answer_agent.yaml +62 -0
- src/agents/solve/prompts/zh/solve_loop/response_agent.yaml +90 -0
- src/agents/solve/prompts/zh/solve_loop/solve_agent.yaml +76 -0
- src/agents/solve/prompts/zh/solve_loop/tool_agent.yaml +41 -0
- src/agents/solve/solve_loop/__init__.py +22 -0
- src/agents/solve/solve_loop/citation_manager.py +74 -0
- src/agents/solve/solve_loop/manager_agent.py +274 -0
- src/agents/solve/solve_loop/precision_answer_agent.py +96 -0
- src/agents/solve/solve_loop/response_agent.py +301 -0
- src/agents/solve/solve_loop/solve_agent.py +325 -0
- src/agents/solve/solve_loop/tool_agent.py +470 -0
- src/agents/solve/utils/__init__.py +64 -0
- src/agents/solve/utils/config_validator.py +313 -0
- src/agents/solve/utils/display_manager.py +223 -0
- src/agents/solve/utils/error_handler.py +363 -0
- src/agents/solve/utils/json_utils.py +98 -0
- src/agents/solve/utils/performance_monitor.py +407 -0
- src/agents/solve/utils/token_tracker.py +541 -0
- src/api/__init__.py +0 -0
- src/api/main.py +240 -0
- src/api/routers/__init__.py +1 -0
- src/api/routers/agent_config.py +69 -0
- src/api/routers/chat.py +296 -0
- src/api/routers/co_writer.py +337 -0
- src/api/routers/config.py +627 -0
- src/api/routers/dashboard.py +18 -0
- src/api/routers/guide.py +337 -0
- src/api/routers/ideagen.py +436 -0
- src/api/routers/knowledge.py +821 -0
- src/api/routers/notebook.py +247 -0
- src/api/routers/question.py +537 -0
- src/api/routers/research.py +394 -0
- src/api/routers/settings.py +164 -0
- src/api/routers/solve.py +305 -0
- src/api/routers/system.py +252 -0
- src/api/run_server.py +61 -0
- src/api/utils/history.py +172 -0
- src/api/utils/log_interceptor.py +21 -0
- src/api/utils/notebook_manager.py +415 -0
- src/api/utils/progress_broadcaster.py +72 -0
- src/api/utils/task_id_manager.py +100 -0
- src/config/__init__.py +0 -0
- src/config/accessors.py +18 -0
- src/config/constants.py +34 -0
- src/config/defaults.py +18 -0
- src/config/schema.py +38 -0
- src/config/settings.py +50 -0
- src/core/errors.py +62 -0
- src/knowledge/__init__.py +23 -0
- src/knowledge/add_documents.py +606 -0
- src/knowledge/config.py +65 -0
- src/knowledge/example_add_documents.py +236 -0
- src/knowledge/extract_numbered_items.py +1039 -0
- src/knowledge/initializer.py +621 -0
- src/knowledge/kb.py +22 -0
- src/knowledge/manager.py +782 -0
- src/knowledge/progress_tracker.py +182 -0
- src/knowledge/start_kb.py +535 -0
- src/logging/__init__.py +103 -0
- src/logging/adapters/__init__.py +17 -0
- src/logging/adapters/lightrag.py +184 -0
- src/logging/adapters/llamaindex.py +141 -0
- src/logging/config.py +80 -0
- src/logging/handlers/__init__.py +20 -0
- src/logging/handlers/console.py +75 -0
- src/logging/handlers/file.py +201 -0
- src/logging/handlers/websocket.py +127 -0
- src/logging/logger.py +709 -0
- src/logging/stats/__init__.py +16 -0
- src/logging/stats/llm_stats.py +179 -0
- src/services/__init__.py +56 -0
- src/services/config/__init__.py +61 -0
- src/services/config/knowledge_base_config.py +210 -0
- src/services/config/loader.py +260 -0
- src/services/config/unified_config.py +603 -0
- src/services/embedding/__init__.py +45 -0
- src/services/embedding/adapters/__init__.py +22 -0
- src/services/embedding/adapters/base.py +106 -0
- src/services/embedding/adapters/cohere.py +127 -0
- src/services/embedding/adapters/jina.py +99 -0
- src/services/embedding/adapters/ollama.py +116 -0
- src/services/embedding/adapters/openai_compatible.py +96 -0
- src/services/embedding/client.py +159 -0
- src/services/embedding/config.py +156 -0
- src/services/embedding/provider.py +119 -0
- src/services/llm/__init__.py +152 -0
- src/services/llm/capabilities.py +313 -0
- src/services/llm/client.py +302 -0
- src/services/llm/cloud_provider.py +530 -0
- src/services/llm/config.py +200 -0
- src/services/llm/error_mapping.py +103 -0
- src/services/llm/exceptions.py +152 -0
- src/services/llm/factory.py +450 -0
- src/services/llm/local_provider.py +347 -0
- src/services/llm/providers/anthropic.py +95 -0
- src/services/llm/providers/base_provider.py +93 -0
- src/services/llm/providers/open_ai.py +83 -0
- src/services/llm/registry.py +71 -0
- src/services/llm/telemetry.py +40 -0
- src/services/llm/types.py +27 -0
- src/services/llm/utils.py +333 -0
- src/services/prompt/__init__.py +25 -0
- src/services/prompt/manager.py +206 -0
- src/services/rag/__init__.py +64 -0
- src/services/rag/components/__init__.py +29 -0
- src/services/rag/components/base.py +59 -0
- src/services/rag/components/chunkers/__init__.py +18 -0
- src/services/rag/components/chunkers/base.py +34 -0
- src/services/rag/components/chunkers/fixed.py +71 -0
- src/services/rag/components/chunkers/numbered_item.py +94 -0
- src/services/rag/components/chunkers/semantic.py +97 -0
- src/services/rag/components/embedders/__init__.py +14 -0
- src/services/rag/components/embedders/base.py +32 -0
- src/services/rag/components/embedders/openai.py +63 -0
- src/services/rag/components/indexers/__init__.py +18 -0
- src/services/rag/components/indexers/base.py +35 -0
- src/services/rag/components/indexers/graph.py +172 -0
- src/services/rag/components/indexers/lightrag.py +156 -0
- src/services/rag/components/indexers/vector.py +146 -0
- src/services/rag/components/parsers/__init__.py +18 -0
- src/services/rag/components/parsers/base.py +35 -0
- src/services/rag/components/parsers/markdown.py +52 -0
- src/services/rag/components/parsers/pdf.py +115 -0
- src/services/rag/components/parsers/text.py +86 -0
- src/services/rag/components/retrievers/__init__.py +18 -0
- src/services/rag/components/retrievers/base.py +34 -0
- src/services/rag/components/retrievers/dense.py +200 -0
- src/services/rag/components/retrievers/hybrid.py +164 -0
- src/services/rag/components/retrievers/lightrag.py +169 -0
- src/services/rag/components/routing.py +286 -0
- src/services/rag/factory.py +234 -0
- src/services/rag/pipeline.py +215 -0
- src/services/rag/pipelines/__init__.py +32 -0
- src/services/rag/pipelines/academic.py +44 -0
- src/services/rag/pipelines/lightrag.py +43 -0
- src/services/rag/pipelines/llamaindex.py +313 -0
- src/services/rag/pipelines/raganything.py +384 -0
- src/services/rag/service.py +244 -0
- src/services/rag/types.py +73 -0
- src/services/search/__init__.py +284 -0
- src/services/search/base.py +87 -0
- src/services/search/consolidation.py +398 -0
- src/services/search/providers/__init__.py +128 -0
- src/services/search/providers/baidu.py +188 -0
- src/services/search/providers/exa.py +194 -0
- src/services/search/providers/jina.py +161 -0
- src/services/search/providers/perplexity.py +153 -0
- src/services/search/providers/serper.py +209 -0
- src/services/search/providers/tavily.py +161 -0
- src/services/search/types.py +114 -0
- src/services/setup/__init__.py +34 -0
- src/services/setup/init.py +285 -0
- src/services/tts/__init__.py +16 -0
- src/services/tts/config.py +99 -0
- src/tools/__init__.py +91 -0
- src/tools/code_executor.py +536 -0
- src/tools/paper_search_tool.py +171 -0
- src/tools/query_item_tool.py +310 -0
- src/tools/question/__init__.py +15 -0
- src/tools/question/exam_mimic.py +616 -0
- src/tools/question/pdf_parser.py +211 -0
- src/tools/question/question_extractor.py +397 -0
- src/tools/rag_tool.py +173 -0
- src/tools/tex_chunker.py +339 -0
- src/tools/tex_downloader.py +253 -0
- src/tools/web_search.py +71 -0
- src/utils/config_manager.py +206 -0
- src/utils/document_validator.py +168 -0
- src/utils/error_rate_tracker.py +111 -0
- src/utils/error_utils.py +82 -0
- src/utils/json_parser.py +110 -0
- src/utils/network/circuit_breaker.py +79 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# ResearchAgent Prompt Configuration (English)
|
|
2
|
+
|
|
3
|
+
system:
|
|
4
|
+
role: |
|
|
5
|
+
You are a knowledge base-based deep research strategy expert, responsible for systematically mining content related to topics from the knowledge base and expanding to external resources as needed.
|
|
6
|
+
|
|
7
|
+
# Guidance templates for dynamic content
|
|
8
|
+
guidance:
|
|
9
|
+
# Online search instruction when both web_search and paper_search are enabled
|
|
10
|
+
online_search_both: |
|
|
11
|
+
**Online Search Evaluation Guidance (web_search and paper_search enabled)**:
|
|
12
|
+
|
|
13
|
+
When evaluating knowledge sufficiency, in addition to assessing knowledge base content coverage, you also need to consider:
|
|
14
|
+
|
|
15
|
+
1. **Content Timeliness Assessment**:
|
|
16
|
+
- Does current knowledge include the latest developments, industry trends, and application cases?
|
|
17
|
+
- Is it necessary to supplement the latest background information and current application status?
|
|
18
|
+
- Might the knowledge base content be outdated and need latest information supplements?
|
|
19
|
+
|
|
20
|
+
2. **Knowledge Extension Assessment**:
|
|
21
|
+
- Has the knowledge been extended from basic knowledge base content to include the latest developments?
|
|
22
|
+
- Has real-time background, industry cases, and latest applications been supplemented through web_search?
|
|
23
|
+
- Has cutting-edge academic research, latest theoretical advances, and specific research work been supplemented through paper_search?
|
|
24
|
+
|
|
25
|
+
3. **Research Completeness Assessment**:
|
|
26
|
+
- If the topic involves cutting-edge research or latest developments, has relevant content been supplemented through online search?
|
|
27
|
+
- Has a complete knowledge chain from knowledge base fundamentals to latest developments been formed?
|
|
28
|
+
|
|
29
|
+
Judgment Criteria:
|
|
30
|
+
- If knowledge base content has been fully explored AND necessary real-time information/cutting-edge research has been supplemented through online search, consider it sufficient
|
|
31
|
+
- If knowledge base content has been fully explored BUT lacks necessary real-time information/cutting-edge research supplements, consider it insufficient
|
|
32
|
+
- If knowledge base content has not been fully explored, prioritize continuing to explore the knowledge base, temporarily ignoring online search
|
|
33
|
+
|
|
34
|
+
# Online search instruction when only web_search is enabled
|
|
35
|
+
online_search_web_only: |
|
|
36
|
+
**Online Search Evaluation Guidance (web_search enabled)**:
|
|
37
|
+
|
|
38
|
+
When evaluating knowledge sufficiency, in addition to assessing knowledge base content coverage, you also need to consider:
|
|
39
|
+
|
|
40
|
+
1. **Content Timeliness Assessment**:
|
|
41
|
+
- Does current knowledge include the latest developments, industry trends, and application cases?
|
|
42
|
+
- Is it necessary to supplement the latest background information and current application status?
|
|
43
|
+
- Might the knowledge base content be outdated and need latest information supplements?
|
|
44
|
+
|
|
45
|
+
2. **Knowledge Extension Assessment**:
|
|
46
|
+
- Has the knowledge been extended from basic knowledge base content to include the latest developments?
|
|
47
|
+
- Has real-time background, industry cases, and latest applications been supplemented through web_search?
|
|
48
|
+
|
|
49
|
+
Judgment Criteria:
|
|
50
|
+
- If knowledge base content has been fully explored AND necessary real-time information has been supplemented through web_search, consider it sufficient
|
|
51
|
+
- If knowledge base content has been fully explored BUT lacks necessary real-time information supplements, consider it insufficient
|
|
52
|
+
- If knowledge base content has not been fully explored, prioritize continuing to explore the knowledge base, temporarily ignoring web_search
|
|
53
|
+
|
|
54
|
+
# Online search instruction when only paper_search is enabled
|
|
55
|
+
online_search_paper_only: |
|
|
56
|
+
**Online Search Evaluation Guidance (paper_search enabled)**:
|
|
57
|
+
|
|
58
|
+
When evaluating knowledge sufficiency, in addition to assessing knowledge base content coverage, you also need to consider:
|
|
59
|
+
|
|
60
|
+
1. **Cutting-edge Research Assessment**:
|
|
61
|
+
- Does current knowledge include relevant cutting-edge academic research and latest theoretical advances?
|
|
62
|
+
- Is it necessary to supplement specific research work, latest methods, and latest discoveries?
|
|
63
|
+
- Does the knowledge base content lack cutting-edge research perspectives?
|
|
64
|
+
|
|
65
|
+
2. **Knowledge Extension Assessment**:
|
|
66
|
+
- Has the knowledge been extended from basic knowledge base content to include cutting-edge research?
|
|
67
|
+
- Has cutting-edge academic research, latest theoretical advances, and specific research work been supplemented through paper_search?
|
|
68
|
+
|
|
69
|
+
Judgment Criteria:
|
|
70
|
+
- If knowledge base content has been fully explored AND necessary cutting-edge research has been supplemented through paper_search, consider it sufficient
|
|
71
|
+
- If knowledge base content has been fully explored BUT lacks necessary cutting-edge research supplements, consider it insufficient
|
|
72
|
+
- If knowledge base content has not been fully explored, prioritize continuing to explore the knowledge base, temporarily ignoring paper_search
|
|
73
|
+
|
|
74
|
+
# Iteration mode criteria for flexible mode
|
|
75
|
+
iteration_mode_flexible: |
|
|
76
|
+
- **FLEXIBLE mode (Auto)**: You have autonomy to decide sufficiency.
|
|
77
|
+
- You MAY conclude sufficiency earlier if knowledge is genuinely comprehensive
|
|
78
|
+
- Still ensure core aspects are covered before concluding
|
|
79
|
+
- Quality over quantity: focus on meaningful coverage, not iteration count
|
|
80
|
+
|
|
81
|
+
# Iteration mode criteria for fixed mode
|
|
82
|
+
iteration_mode_fixed: |
|
|
83
|
+
- **FIXED mode**: Be CONSERVATIVE about declaring sufficiency.
|
|
84
|
+
- In early iterations (1-{early_threshold}): Rarely conclude sufficiency. Continue exploring.
|
|
85
|
+
- In middle iterations: Require strong evidence of comprehensive coverage.
|
|
86
|
+
- Only in late iterations ({early_threshold}+): Consider sufficiency if truly comprehensive.
|
|
87
|
+
- The goal is thorough exploration, not quick completion.
|
|
88
|
+
|
|
89
|
+
process:
|
|
90
|
+
check_sufficiency: |
|
|
91
|
+
Determine whether the current knowledge for the following topic is sufficient. Only output JSON object:
|
|
92
|
+
|
|
93
|
+
Topic: {topic}
|
|
94
|
+
Topic Overview: {overview}
|
|
95
|
+
Current Knowledge: {current_knowledge}
|
|
96
|
+
Iteration Count: {iteration}
|
|
97
|
+
{online_search_instruction}
|
|
98
|
+
{research_depth_guidance}
|
|
99
|
+
{iteration_mode_criteria}
|
|
100
|
+
|
|
101
|
+
**Important Principle: Depth over Breadth**
|
|
102
|
+
|
|
103
|
+
You must strictly and systematically evaluate whether the current knowledge truly meets the "deep research" standard, not just "surface coverage".
|
|
104
|
+
|
|
105
|
+
**Evaluation Steps:**
|
|
106
|
+
|
|
107
|
+
1. **Identify Core Elements** (evaluate at least the following 6 dimensions):
|
|
108
|
+
- □ Concept Definition: Is there a clear, complete definition?
|
|
109
|
+
- □ Core Principles: Is the working mechanism, derivation process deeply explained?
|
|
110
|
+
- □ Key Formulas/Algorithms: Does it include specific mathematical expressions or algorithm steps?
|
|
111
|
+
- □ Application Scenarios: Are there specific application cases or instance analyses?
|
|
112
|
+
- □ Relationships: Are connections with other concepts/fields explored?
|
|
113
|
+
- □ Limitations and Development: Are limitations, challenges, or cutting-edge developments discussed?
|
|
114
|
+
|
|
115
|
+
2. **Strictly Evaluate Coverage**:
|
|
116
|
+
- Count the number of covered dimensions (at least 4 dimensions need to be covered)
|
|
117
|
+
- Evaluate the depth of each dimension (surface mention vs. in-depth analysis)
|
|
118
|
+
- Identify key omissions (which dimensions are completely unaddressed or insufficiently deep)
|
|
119
|
+
|
|
120
|
+
3. **Determine Sufficiency Criteria**:
|
|
121
|
+
- **Sufficient** (is_sufficient=true): Meets all of the following conditions
|
|
122
|
+
① At least 5 core dimensions covered
|
|
123
|
+
② Each covered dimension has substantial content (not just mentioned)
|
|
124
|
+
③ Iteration count ≥ 3 (ensuring multiple rounds of exploration)
|
|
125
|
+
- **Insufficient** (is_sufficient=false): Any condition not met
|
|
126
|
+
|
|
127
|
+
Output JSON:
|
|
128
|
+
{{
|
|
129
|
+
"is_sufficient": true/false,
|
|
130
|
+
"covered_dimensions": ["List of covered dimensions"],
|
|
131
|
+
"missing_dimensions": ["List of missing or insufficiently deep dimensions"],
|
|
132
|
+
"coverage_score": 0.0-1.0,
|
|
133
|
+
"reason": "Judgment reason (specifically explain coverage and judgment basis)"
|
|
134
|
+
}}
|
|
135
|
+
|
|
136
|
+
generate_query_plan: |
|
|
137
|
+
When knowledge is insufficient, formulate the next query plan. Only output JSON object:
|
|
138
|
+
|
|
139
|
+
Topic: {topic}
|
|
140
|
+
Topic Overview: {overview}
|
|
141
|
+
Current Knowledge: {current_knowledge}
|
|
142
|
+
Iteration Count: {iteration}
|
|
143
|
+
Existing Topics:
|
|
144
|
+
{existing_topics}
|
|
145
|
+
|
|
146
|
+
**Available Tools (ONLY use these tools)**:
|
|
147
|
+
{available_tools}
|
|
148
|
+
|
|
149
|
+
{tool_phase_guidance}
|
|
150
|
+
|
|
151
|
+
**Query Design Principles**:
|
|
152
|
+
1. **IMPORTANT**: Only select from the Available Tools listed above. Do not use tools that are not available.
|
|
153
|
+
2. Each query should target a specific knowledge gap
|
|
154
|
+
3. Avoid duplication with existing content in current knowledge
|
|
155
|
+
4. Queries should be specific and executable (avoid being too broad)
|
|
156
|
+
5. If using paper_search, must use English keywords
|
|
157
|
+
|
|
158
|
+
**New Topic Evaluation**: Only suggest adding a new topic when discovering an important branch highly related to the theme and completely different from existing topics (score ≥ 0.85)
|
|
159
|
+
|
|
160
|
+
Output JSON:
|
|
161
|
+
{{
|
|
162
|
+
"query": "Specific query statement",
|
|
163
|
+
"tool_type": "Select from Available Tools above",
|
|
164
|
+
"target_dimension": "Knowledge dimension targeted by this query",
|
|
165
|
+
"rationale": "Tool selection reason and query objective",
|
|
166
|
+
"parallel": false,
|
|
167
|
+
"fallback": ["rag_hybrid", "rag_naive"],
|
|
168
|
+
"should_add_new_topic": false,
|
|
169
|
+
"new_sub_topic": null,
|
|
170
|
+
"new_overview": null,
|
|
171
|
+
"new_topic_reason": null,
|
|
172
|
+
"new_topic_score": 0.0
|
|
173
|
+
}}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# DecomposeAgent 提示词配置
|
|
2
|
+
|
|
3
|
+
system:
|
|
4
|
+
role: |
|
|
5
|
+
你是一个研究规划专家,负责将复杂话题分解为逻辑清晰、互不重复的子话题体系。
|
|
6
|
+
|
|
7
|
+
process:
|
|
8
|
+
generate_queries: |
|
|
9
|
+
为以下话题生成 {num_queries} 个搜索查询。仅输出 JSON 对象:
|
|
10
|
+
|
|
11
|
+
话题: {topic}
|
|
12
|
+
|
|
13
|
+
要求:
|
|
14
|
+
1. 每个查询 1-3 个关键词,简洁且具代表性
|
|
15
|
+
2. 覆盖话题的不同维度,确保多样性
|
|
16
|
+
3. 查询之间避免重复
|
|
17
|
+
|
|
18
|
+
输出 JSON:
|
|
19
|
+
{{
|
|
20
|
+
"queries": ["查询1", "查询2", ...]
|
|
21
|
+
}}
|
|
22
|
+
|
|
23
|
+
decompose: |
|
|
24
|
+
基于以下信息将话题分解为子话题。仅输出 JSON 对象:
|
|
25
|
+
|
|
26
|
+
主话题: {topic}
|
|
27
|
+
|
|
28
|
+
背景知识(来自RAG检索):
|
|
29
|
+
{rag_context}
|
|
30
|
+
|
|
31
|
+
{decompose_requirement}
|
|
32
|
+
|
|
33
|
+
**分解步骤:**
|
|
34
|
+
|
|
35
|
+
1. **分析背景知识**:识别核心概念、关键理论和重要内容
|
|
36
|
+
|
|
37
|
+
2. **识别研究维度**:确定各维度的研究重点,确保维度间互补
|
|
38
|
+
|
|
39
|
+
3. **生成子话题**:
|
|
40
|
+
- 基于背景知识中的实际内容
|
|
41
|
+
- 各子话题逻辑关联但不重复
|
|
42
|
+
- 覆盖主题的主要方面
|
|
43
|
+
|
|
44
|
+
4. **完善描述**:
|
|
45
|
+
- title:简洁明确,表达子话题核心
|
|
46
|
+
- overview:2-3句话,说明内容、重要性和研究价值
|
|
47
|
+
|
|
48
|
+
输出 JSON:
|
|
49
|
+
{{
|
|
50
|
+
"sub_topics": [
|
|
51
|
+
{{
|
|
52
|
+
"title": "子话题标题",
|
|
53
|
+
"overview": "详细概览,说明内容、重点和研究价值"
|
|
54
|
+
}}
|
|
55
|
+
]
|
|
56
|
+
}}
|
|
57
|
+
|
|
58
|
+
decompose_without_rag: |
|
|
59
|
+
将以下研究话题分解为清晰、结构化的子话题。仅输出 JSON 对象:
|
|
60
|
+
|
|
61
|
+
主话题: {topic}
|
|
62
|
+
|
|
63
|
+
{decompose_requirement}
|
|
64
|
+
|
|
65
|
+
**分解步骤(无RAG上下文):**
|
|
66
|
+
|
|
67
|
+
1. **识别关键方面**:基于你的知识,识别该话题的关键方面和维度
|
|
68
|
+
|
|
69
|
+
2. **生成子话题**:
|
|
70
|
+
- 每个子话题应覆盖主话题的不同方面
|
|
71
|
+
- 子话题之间应有逻辑关系但不重叠或重复
|
|
72
|
+
- 确保子话题共同形成完整的研究框架
|
|
73
|
+
|
|
74
|
+
3. **完善描述**:
|
|
75
|
+
- title:简洁明确,表达子话题的核心重点
|
|
76
|
+
- overview:2-3句话说明:
|
|
77
|
+
- 该子话题涵盖的内容
|
|
78
|
+
- 为什么它对理解主话题很重要
|
|
79
|
+
- 需要探索的关键概念或领域
|
|
80
|
+
|
|
81
|
+
输出 JSON:
|
|
82
|
+
{{
|
|
83
|
+
"sub_topics": [
|
|
84
|
+
{{
|
|
85
|
+
"title": "子话题标题(简洁明确)",
|
|
86
|
+
"overview": "详细概览(2-3句话说明重要性、范围和关键领域)"
|
|
87
|
+
}}
|
|
88
|
+
]
|
|
89
|
+
}}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# ManagerAgent 提示词配置
|
|
2
|
+
|
|
3
|
+
system:
|
|
4
|
+
role: |
|
|
5
|
+
你是一个任务调度专家,负责管理动态话题队列的状态和任务派发。
|
|
6
|
+
|
|
7
|
+
process:
|
|
8
|
+
decide_next: |
|
|
9
|
+
根据队列状态决定下一步操作。仅输出 JSON 对象:
|
|
10
|
+
|
|
11
|
+
队列统计:
|
|
12
|
+
total={total}, pending={pending}, researching={researching}, completed={completed}, failed={failed}
|
|
13
|
+
|
|
14
|
+
**决策规则:**
|
|
15
|
+
- 有 pending → action: "dispatch",选择队头 block_id
|
|
16
|
+
- 无 pending 且 researching=0 → action: "finish"
|
|
17
|
+
- 其他情况 → action: "wait"
|
|
18
|
+
|
|
19
|
+
输出 JSON:
|
|
20
|
+
{{
|
|
21
|
+
"action": "dispatch|finish|wait",
|
|
22
|
+
"block_id": "(dispatch时必填)",
|
|
23
|
+
"reason": "简要理由"
|
|
24
|
+
}}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# NoteAgent 提示词配置 - 深度信息提取与结构化摘要
|
|
2
|
+
# 设计目标:从工具输出中提取丰富的结构化信息,为高质量报告生成提供素材
|
|
3
|
+
|
|
4
|
+
system:
|
|
5
|
+
role: |
|
|
6
|
+
你是一位信息提取与知识整理专家,负责从各类工具输出中提炼关键信息,生成结构化、可复用的高质量摘要。
|
|
7
|
+
|
|
8
|
+
**核心能力**:
|
|
9
|
+
1. **多模态信息识别**:能够识别并保留公式、表格、代码、数据等结构化元素
|
|
10
|
+
2. **层次化提取**:区分核心信息、支撑信息和背景信息
|
|
11
|
+
3. **知识关联**:识别概念间的关系和依赖
|
|
12
|
+
4. **学术规范**:保持术语准确性和引用完整性
|
|
13
|
+
|
|
14
|
+
**重要格式要求**:
|
|
15
|
+
- 所有输出必须严格遵循 JSON 格式
|
|
16
|
+
- 只输出有效的 JSON 对象,不要包含任何额外的文本、解释或代码块标记
|
|
17
|
+
- JSON 必须可以被直接解析,不能包含注释或格式错误
|
|
18
|
+
- 如果输出中包含文本内容,请将其作为 JSON 字符串值,并正确转义特殊字符
|
|
19
|
+
|
|
20
|
+
process:
|
|
21
|
+
generate_summary: |
|
|
22
|
+
从以下工具输出中提取关键信息并生成结构化摘要。
|
|
23
|
+
|
|
24
|
+
**重要:你必须只输出一个有效的 JSON 对象,不要包含任何其他文本、解释或代码块标记。**
|
|
25
|
+
|
|
26
|
+
工具类型: {tool_type}
|
|
27
|
+
查询: {query}
|
|
28
|
+
话题: {topic}
|
|
29
|
+
上下文: {context}
|
|
30
|
+
|
|
31
|
+
原始输出:
|
|
32
|
+
{raw_answer}
|
|
33
|
+
|
|
34
|
+
**深度提取框架**:
|
|
35
|
+
|
|
36
|
+
## 第一步:内容类型识别
|
|
37
|
+
|
|
38
|
+
识别原始输出中包含的信息类型:
|
|
39
|
+
- □ 概念定义(术语、定义、解释)
|
|
40
|
+
- □ 数学公式(方程、定理、推导)
|
|
41
|
+
- □ 数据表格(对比、参数、统计)
|
|
42
|
+
- □ 算法/代码(伪代码、实现、示例)
|
|
43
|
+
- □ 流程/架构(步骤、流程、系统结构)
|
|
44
|
+
- □ 案例/实例(应用场景、实验结果)
|
|
45
|
+
- □ 引用/来源(论文、作者、出处)
|
|
46
|
+
|
|
47
|
+
## 第二步:分层信息提取
|
|
48
|
+
|
|
49
|
+
1. **核心层**(必须提取):
|
|
50
|
+
- 直接回答查询的关键信息
|
|
51
|
+
- 重要定义、公式、结论
|
|
52
|
+
- 核心数据和关键发现
|
|
53
|
+
|
|
54
|
+
2. **支撑层**(选择性提取):
|
|
55
|
+
- 推导过程和论证逻辑
|
|
56
|
+
- 实验方法和验证数据
|
|
57
|
+
- 对比分析和优缺点
|
|
58
|
+
|
|
59
|
+
3. **背景层**(简要提及):
|
|
60
|
+
- 历史演进和发展脉络
|
|
61
|
+
- 相关工作和参考文献
|
|
62
|
+
- 适用条件和局限性
|
|
63
|
+
|
|
64
|
+
## 第三步:结构化信息保留
|
|
65
|
+
|
|
66
|
+
**必须保留原始格式的元素**:
|
|
67
|
+
|
|
68
|
+
1. **数学公式**:
|
|
69
|
+
- 行内公式保留为 `$...$` 格式
|
|
70
|
+
- 独立公式保留为 `$$...$$` 格式
|
|
71
|
+
- 示例:`$E = mc^2$` 或 `$$\\nabla \\cdot E = \\frac{\\rho}{\\epsilon_0}$$`
|
|
72
|
+
|
|
73
|
+
2. **表格数据**:
|
|
74
|
+
- 转换为 Markdown 表格格式
|
|
75
|
+
- 保留表头和关键数据行
|
|
76
|
+
- 示例:`| 方法 | 准确率 | 效率 |\\n|---|---|---|\\n| A | 95% | 快 |`
|
|
77
|
+
|
|
78
|
+
3. **代码片段**:
|
|
79
|
+
- 保留关键算法或示例代码
|
|
80
|
+
- 使用代码块格式并标注语言
|
|
81
|
+
- 示例:`\\`\\`\\`python\\ndef func():\\n pass\\n\\`\\`\\``
|
|
82
|
+
|
|
83
|
+
4. **列表结构**:
|
|
84
|
+
- 保留步骤、要点等列表
|
|
85
|
+
- 使用 `1. 2. 3.` 或 `- - -` 格式
|
|
86
|
+
|
|
87
|
+
## 第四步:生成结构化摘要
|
|
88
|
+
|
|
89
|
+
**摘要要求**:
|
|
90
|
+
- 长度:300-600字(视信息密度调整)
|
|
91
|
+
- 结构:按逻辑主题组织,而非按原文顺序
|
|
92
|
+
- 完整性:摘要应能独立阅读,无需参考原始输出
|
|
93
|
+
- 准确性:保持术语和数值的准确性
|
|
94
|
+
|
|
95
|
+
**输出格式要求(严格遵循):**
|
|
96
|
+
- 只输出 JSON 对象,不要使用 ```json 代码块包裹
|
|
97
|
+
- 不要添加任何解释性文字
|
|
98
|
+
- JSON 字符串中的特殊字符(如引号、换行符、反斜杠)必须正确转义
|
|
99
|
+
- 确保 JSON 格式完全有效,可以直接被 json.loads() 解析
|
|
100
|
+
|
|
101
|
+
输出示例(仅作为格式参考,不要复制内容):
|
|
102
|
+
{{
|
|
103
|
+
"summary": "结构化摘要内容(包含保留的公式、表格等元素)",
|
|
104
|
+
"key_elements": {{
|
|
105
|
+
"definitions": ["定义1", "定义2"],
|
|
106
|
+
"formulas": ["$公式1$", "$$公式2$$"],
|
|
107
|
+
"data_points": ["数据1", "数据2"],
|
|
108
|
+
"methods": ["方法1", "方法2"]
|
|
109
|
+
}},
|
|
110
|
+
"content_type": ["concept", "formula", "data"],
|
|
111
|
+
"confidence": 0.85,
|
|
112
|
+
"source_quality": "high/medium/low"
|
|
113
|
+
}}
|
|
114
|
+
|
|
115
|
+
**关键原则**:
|
|
116
|
+
1. 优先保留可量化、可验证的信息
|
|
117
|
+
2. 公式和代码必须完整保留,不要简化
|
|
118
|
+
3. 表格数据转换为 Markdown 格式
|
|
119
|
+
4. 标注信息来源的可信度
|
|
120
|
+
|
|
121
|
+
**现在请直接输出 JSON 对象,不要包含任何其他内容。**
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# RephraseAgent 提示词配置
|
|
2
|
+
|
|
3
|
+
system:
|
|
4
|
+
role: |
|
|
5
|
+
你是一个研究话题优化专家,负责将用户的研究需求转化为清晰、具体、可执行的研究主题。
|
|
6
|
+
|
|
7
|
+
process:
|
|
8
|
+
rephrase: |
|
|
9
|
+
对以下用户输入进行分析和优化。仅输出 JSON 对象:
|
|
10
|
+
|
|
11
|
+
用户输入: {user_input}
|
|
12
|
+
迭代次数: {iteration}
|
|
13
|
+
{previous_result}
|
|
14
|
+
|
|
15
|
+
**优化维度:**
|
|
16
|
+
|
|
17
|
+
1. **研究主题**:转化为清晰、具体、可研究的话题
|
|
18
|
+
2. **研究重点**:识别核心问题和关键要素
|
|
19
|
+
3. **研究范围**:明确边界,界定深度和广度
|
|
20
|
+
4. **优化理由**:说明优化依据和逻辑
|
|
21
|
+
|
|
22
|
+
基于以上思考,生成一段主题突出、重点明确、范围清晰的研究目标,长度不超过用户输入的两倍。
|
|
23
|
+
|
|
24
|
+
输出 JSON:
|
|
25
|
+
{{
|
|
26
|
+
"topic": "一段清晰、完整的研究主题描述"
|
|
27
|
+
}}
|
|
28
|
+
|
|
29
|
+
要求:
|
|
30
|
+
1. topic 必须是连贯的文字,能独立表达完整信息
|
|
31
|
+
2. iteration = 0 时,给出合理的聚焦和优化
|
|
32
|
+
3. iteration > 0 时,根据用户反馈调整
|
|
33
|
+
|
|
34
|
+
check_satisfaction: |
|
|
35
|
+
分析用户对重写结果的反馈。仅输出 JSON 对象:
|
|
36
|
+
|
|
37
|
+
当前结果:
|
|
38
|
+
- 话题: {topic}
|
|
39
|
+
|
|
40
|
+
用户反馈: {user_feedback}
|
|
41
|
+
|
|
42
|
+
**判断维度:**
|
|
43
|
+
1. 用户是否明确表达满意/不满意
|
|
44
|
+
2. 是否提出具体修改要求
|
|
45
|
+
3. 反馈是肯定性还是否定性
|
|
46
|
+
|
|
47
|
+
输出 JSON:
|
|
48
|
+
{{
|
|
49
|
+
"user_satisfied": true/false,
|
|
50
|
+
"should_continue": true/false,
|
|
51
|
+
"interpretation": "对用户意图的解读",
|
|
52
|
+
"suggested_action": "建议的下一步行动"
|
|
53
|
+
}}
|
|
54
|
+
|
|
55
|
+
判断标准:
|
|
56
|
+
- 满意、同意、可以、好的 → user_satisfied = true, should_continue = false
|
|
57
|
+
- 要求修改或提出意见 → user_satisfied = false, should_continue = true
|
|
58
|
+
- 反馈模糊 → 倾向继续优化
|