hdsp-jupyter-extension 2.0.10__py3-none-any.whl → 2.0.13__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.
- agent_server/core/notebook_generator.py +4 -4
- agent_server/langchain/MULTI_AGENT_ARCHITECTURE.md +1114 -0
- agent_server/langchain/__init__.py +2 -2
- agent_server/langchain/agent.py +72 -33
- agent_server/langchain/agent_factory.py +400 -0
- agent_server/langchain/agent_prompts/__init__.py +25 -0
- agent_server/langchain/agent_prompts/athena_query_prompt.py +71 -0
- agent_server/langchain/agent_prompts/planner_prompt.py +85 -0
- agent_server/langchain/agent_prompts/python_developer_prompt.py +123 -0
- agent_server/langchain/agent_prompts/researcher_prompt.py +38 -0
- agent_server/langchain/custom_middleware.py +656 -113
- agent_server/langchain/hitl_config.py +38 -9
- agent_server/langchain/llm_factory.py +1 -85
- agent_server/langchain/middleware/__init__.py +24 -0
- agent_server/langchain/middleware/code_history_middleware.py +412 -0
- agent_server/langchain/middleware/description_injector.py +150 -0
- agent_server/langchain/middleware/skill_middleware.py +298 -0
- agent_server/langchain/middleware/subagent_events.py +171 -0
- agent_server/langchain/middleware/subagent_middleware.py +329 -0
- agent_server/langchain/prompts.py +107 -135
- agent_server/langchain/skills/data_analysis.md +236 -0
- agent_server/langchain/skills/data_loading.md +158 -0
- agent_server/langchain/skills/inference.md +392 -0
- agent_server/langchain/skills/model_training.md +318 -0
- agent_server/langchain/skills/pyspark.md +352 -0
- agent_server/langchain/subagents/__init__.py +20 -0
- agent_server/langchain/subagents/base.py +173 -0
- agent_server/langchain/tools/__init__.py +3 -0
- agent_server/langchain/tools/jupyter_tools.py +58 -20
- agent_server/langchain/tools/lsp_tools.py +1 -1
- agent_server/langchain/tools/shared/__init__.py +26 -0
- agent_server/langchain/tools/shared/qdrant_search.py +175 -0
- agent_server/langchain/tools/tool_registry.py +219 -0
- agent_server/langchain/tools/workspace_tools.py +197 -0
- agent_server/prompts/file_action_prompts.py +8 -8
- agent_server/routers/config.py +40 -1
- agent_server/routers/langchain_agent.py +868 -321
- hdsp_agent_core/__init__.py +46 -47
- hdsp_agent_core/factory.py +6 -10
- hdsp_agent_core/interfaces.py +4 -2
- hdsp_agent_core/knowledge/__init__.py +5 -5
- hdsp_agent_core/knowledge/chunking.py +87 -61
- hdsp_agent_core/knowledge/loader.py +103 -101
- hdsp_agent_core/llm/service.py +192 -107
- hdsp_agent_core/managers/config_manager.py +16 -22
- hdsp_agent_core/managers/session_manager.py +5 -4
- hdsp_agent_core/models/__init__.py +12 -12
- hdsp_agent_core/models/agent.py +15 -8
- hdsp_agent_core/models/common.py +1 -2
- hdsp_agent_core/models/rag.py +48 -111
- hdsp_agent_core/prompts/__init__.py +12 -12
- hdsp_agent_core/prompts/cell_action_prompts.py +9 -7
- hdsp_agent_core/services/agent_service.py +10 -8
- hdsp_agent_core/services/chat_service.py +10 -6
- hdsp_agent_core/services/rag_service.py +3 -6
- hdsp_agent_core/tests/conftest.py +4 -1
- hdsp_agent_core/tests/test_factory.py +2 -2
- hdsp_agent_core/tests/test_services.py +12 -19
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/build_log.json +1 -1
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/package.json +7 -2
- hdsp_jupyter_extension-2.0.10.data/data/share/jupyter/labextensions/hdsp-agent/static/frontend_styles_index_js.2d9fb488c82498c45c2d.js → hdsp_jupyter_extension-2.0.13.data/data/share/jupyter/labextensions/hdsp-agent/static/frontend_styles_index_js.037b3c8e5d6a92b63b16.js +1108 -179
- hdsp_jupyter_extension-2.0.13.data/data/share/jupyter/labextensions/hdsp-agent/static/frontend_styles_index_js.037b3c8e5d6a92b63b16.js.map +1 -0
- jupyter_ext/labextension/static/lib_index_js.dc6434bee96ab03a0539.js → hdsp_jupyter_extension-2.0.13.data/data/share/jupyter/labextensions/hdsp-agent/static/lib_index_js.5449ba3c7e25177d2987.js +3936 -8144
- hdsp_jupyter_extension-2.0.13.data/data/share/jupyter/labextensions/hdsp-agent/static/lib_index_js.5449ba3c7e25177d2987.js.map +1 -0
- hdsp_jupyter_extension-2.0.10.data/data/share/jupyter/labextensions/hdsp-agent/static/remoteEntry.4a252df3ade74efee8d6.js → hdsp_jupyter_extension-2.0.13.data/data/share/jupyter/labextensions/hdsp-agent/static/remoteEntry.a8e0b064eb9b1c1ff463.js +17 -17
- hdsp_jupyter_extension-2.0.13.data/data/share/jupyter/labextensions/hdsp-agent/static/remoteEntry.a8e0b064eb9b1c1ff463.js.map +1 -0
- {hdsp_jupyter_extension-2.0.10.dist-info → hdsp_jupyter_extension-2.0.13.dist-info}/METADATA +1 -1
- {hdsp_jupyter_extension-2.0.10.dist-info → hdsp_jupyter_extension-2.0.13.dist-info}/RECORD +100 -76
- jupyter_ext/__init__.py +21 -11
- jupyter_ext/_version.py +1 -1
- jupyter_ext/handlers.py +128 -58
- jupyter_ext/labextension/build_log.json +1 -1
- jupyter_ext/labextension/package.json +7 -2
- jupyter_ext/labextension/static/{frontend_styles_index_js.2d9fb488c82498c45c2d.js → frontend_styles_index_js.037b3c8e5d6a92b63b16.js} +1108 -179
- jupyter_ext/labextension/static/frontend_styles_index_js.037b3c8e5d6a92b63b16.js.map +1 -0
- hdsp_jupyter_extension-2.0.10.data/data/share/jupyter/labextensions/hdsp-agent/static/lib_index_js.dc6434bee96ab03a0539.js → jupyter_ext/labextension/static/lib_index_js.5449ba3c7e25177d2987.js +3936 -8144
- jupyter_ext/labextension/static/lib_index_js.5449ba3c7e25177d2987.js.map +1 -0
- jupyter_ext/labextension/static/{remoteEntry.4a252df3ade74efee8d6.js → remoteEntry.a8e0b064eb9b1c1ff463.js} +17 -17
- jupyter_ext/labextension/static/remoteEntry.a8e0b064eb9b1c1ff463.js.map +1 -0
- hdsp_jupyter_extension-2.0.10.data/data/share/jupyter/labextensions/hdsp-agent/static/frontend_styles_index_js.2d9fb488c82498c45c2d.js.map +0 -1
- hdsp_jupyter_extension-2.0.10.data/data/share/jupyter/labextensions/hdsp-agent/static/lib_index_js.dc6434bee96ab03a0539.js.map +0 -1
- hdsp_jupyter_extension-2.0.10.data/data/share/jupyter/labextensions/hdsp-agent/static/remoteEntry.4a252df3ade74efee8d6.js.map +0 -1
- jupyter_ext/labextension/static/frontend_styles_index_js.2d9fb488c82498c45c2d.js.map +0 -1
- jupyter_ext/labextension/static/lib_index_js.dc6434bee96ab03a0539.js.map +0 -1
- jupyter_ext/labextension/static/remoteEntry.4a252df3ade74efee8d6.js.map +0 -1
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/etc/jupyter/jupyter_server_config.d/hdsp_jupyter_extension.json +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/install.json +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/static/node_modules_emotion_use-insertion-effect-with-fallbacks_dist_emotion-use-insertion-effect-wi-3ba6b80.c095373419d05e6f141a.js +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/static/node_modules_emotion_use-insertion-effect-with-fallbacks_dist_emotion-use-insertion-effect-wi-3ba6b80.c095373419d05e6f141a.js.map +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/static/node_modules_emotion_use-insertion-effect-with-fallbacks_dist_emotion-use-insertion-effect-wi-3ba6b81.61e75fb98ecff46cf836.js +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/static/node_modules_emotion_use-insertion-effect-with-fallbacks_dist_emotion-use-insertion-effect-wi-3ba6b81.61e75fb98ecff46cf836.js.map +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/static/style.js +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_babel_runtime_helpers_esm_extends_js-node_modules_emotion_serialize_dist-051195.e2553aab0c3963b83dd7.js +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_babel_runtime_helpers_esm_extends_js-node_modules_emotion_serialize_dist-051195.e2553aab0c3963b83dd7.js.map +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_emotion_cache_dist_emotion-cache_browser_development_esm_js.24edcc52a1c014a8a5f0.js +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_emotion_cache_dist_emotion-cache_browser_development_esm_js.24edcc52a1c014a8a5f0.js.map +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_emotion_react_dist_emotion-react_browser_development_esm_js.19ecf6babe00caff6b8a.js +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_emotion_react_dist_emotion-react_browser_development_esm_js.19ecf6babe00caff6b8a.js.map +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_emotion_styled_dist_emotion-styled_browser_development_esm_js.661fb5836f4978a7c6e1.js +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_emotion_styled_dist_emotion-styled_browser_development_esm_js.661fb5836f4978a7c6e1.js.map +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_mui_material_index_js.985697e0162d8d088ca2.js +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_mui_material_index_js.985697e0162d8d088ca2.js.map +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_mui_material_utils_createSvgIcon_js.1f5038488cdfd8b3a85d.js +0 -0
- {hdsp_jupyter_extension-2.0.10.data → hdsp_jupyter_extension-2.0.13.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_mui_material_utils_createSvgIcon_js.1f5038488cdfd8b3a85d.js.map +0 -0
- {hdsp_jupyter_extension-2.0.10.dist-info → hdsp_jupyter_extension-2.0.13.dist-info}/WHEEL +0 -0
- {hdsp_jupyter_extension-2.0.10.dist-info → hdsp_jupyter_extension-2.0.13.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Main Agent (Supervisor) System Prompt for Multi-Agent Mode
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
PLANNER_SYSTEM_PROMPT = """당신은 작업을 조율하는 Main Agent입니다. 한국어로 응답하세요.
|
|
6
|
+
|
|
7
|
+
# 핵심 원칙
|
|
8
|
+
2. 3단계 이상의 복잡한 작업을 요청받은 경우에만 write_todos 로 작업 목록 관리
|
|
9
|
+
3. **직접 코드, 쿼리 작성 금지** - 모든 코드/쿼리 생성은 task_tool로 서브에이전트에게 위임
|
|
10
|
+
3. 서브에이전트가 반환한 코드를 적절한 도구로 실행
|
|
11
|
+
|
|
12
|
+
# 작업 흐름
|
|
13
|
+
|
|
14
|
+
## Step 1: 계획 수립
|
|
15
|
+
3단계 이상의 복잡한 작업을 요청받은 경우에만 write_todos로 작업 목록 생성 (마지막 항목은 반드시 "작업 요약 및 다음 단계 제시")
|
|
16
|
+
|
|
17
|
+
## Step 2: 코드/쿼리 생성 요청
|
|
18
|
+
필요한 경우, task_tool을 호출하여 서브에이전트에게 위임:
|
|
19
|
+
|
|
20
|
+
| 서브에이전트 | 용도 | 호출 예시 |
|
|
21
|
+
|-------------|------|----------|
|
|
22
|
+
| python_developer | Python 코드 생성 | task_tool(agent_name="python_developer", description="데이터 분석 코드 작성") |
|
|
23
|
+
| athena_query | SQL 쿼리 생성 | task_tool(agent_name="athena_query", description="매출 테이블 조회 쿼리") |
|
|
24
|
+
| researcher | 정보 검색 | task_tool(agent_name="researcher", description="관련 문서 검색") |
|
|
25
|
+
|
|
26
|
+
## Step 3: 결과 실행/표시 (필수!)
|
|
27
|
+
**task_tool을 호출 했다면, 호출 후 반드시 결과를 처리해야 함:**
|
|
28
|
+
|
|
29
|
+
| 서브에이전트 | 처리 방법 | 예시 |
|
|
30
|
+
|-------------|----------|------|
|
|
31
|
+
| python_developer | jupyter_cell_tool로 실행 또는 write/edit/multiedit file tool로 적용 | jupyter_cell_tool(code=반환된_코드) |
|
|
32
|
+
| athena_query | **markdown_tool로 SQL 표시** (필수) | markdown_tool(content="```sql\n반환된_쿼리\n```") |
|
|
33
|
+
| researcher | 텍스트로 요약 | 직접 응답 |
|
|
34
|
+
|
|
35
|
+
**중요**: task_tool 결과를 받은 후 바로 write_todos로 완료 처리하지 말고, 반드시 위 도구로 결과를 먼저 표시!
|
|
36
|
+
|
|
37
|
+
# write_todos 규칙 [필수]
|
|
38
|
+
- 한국어로 작성
|
|
39
|
+
- **🔴 기존 todo 절대 삭제 금지**: 전체 리스트를 항상 포함하고 status만 변경
|
|
40
|
+
- 잘못된 예: [{"content": "작업 요약", "status": "completed"}] ← 기존 todo 삭제됨!
|
|
41
|
+
- 올바른 예: [{"content": "기존 작업1", "status": "completed"}, {"content": "작업 요약", "status": "completed"}]
|
|
42
|
+
- **일괄 업데이트**: 연속 완료된 todo는 한 번의 write_todos 호출로 처리
|
|
43
|
+
- in_progress **1개만** 유지
|
|
44
|
+
- content에 도구(tool)명 언급 금지
|
|
45
|
+
- **[필수] 마지막 todo는 반드시 "작업 요약 및 다음 단계 제시"**
|
|
46
|
+
|
|
47
|
+
# "작업 요약 및 다음 단계 제시" todo 작업 순서 [필수]
|
|
48
|
+
1. "작업 요약 및 다음 단계 제시"를 **in_progress**로 변경 (write_todos 호출)
|
|
49
|
+
2. **같은 응답에서** 아래 JSON을 텍스트로 출력:
|
|
50
|
+
{
|
|
51
|
+
"summary": "완료된 작업 요약",
|
|
52
|
+
"next_items": [
|
|
53
|
+
{
|
|
54
|
+
"subject": "제목",
|
|
55
|
+
"description": "설명"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
3. JSON 출력과 함께 "작업 요약 및 다음 단계 제시"를 **completed**로 변경
|
|
60
|
+
**중요**: JSON은 반드시 in_progress 상태일 때 출력! completed 먼저 표시 금지!
|
|
61
|
+
- next_items 3개 이상 필수
|
|
62
|
+
- **summary JSON 없이 종료 금지**
|
|
63
|
+
- **주의**: JSON은 todo 항목이 아닌 일반 텍스트 응답으로 출력
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
# 도구 사용시 주의할 점
|
|
67
|
+
|
|
68
|
+
## 서브에이전트 호출 (코드/쿼리 생성 시 필수)
|
|
69
|
+
- task_tool: 서브에이전트에게 작업 위임
|
|
70
|
+
|
|
71
|
+
## 탐색 (⚠️ 파일 위치 모를 때: search_files_tool → list_workspace_tool → 재검색 → ask_user_tool 순서로!)
|
|
72
|
+
- list_workspace_tool: 파일/디렉토리 목록
|
|
73
|
+
- search_files_tool: 파일 내용 검색 (regex 지원, 예: "titanic|error|*.csv")
|
|
74
|
+
|
|
75
|
+
# 금지 사항
|
|
76
|
+
- 직접 코드/SQL 작성 (반드시 task_tool 사용)
|
|
77
|
+
- task_tool 없이 jupyter_cell_tool 호출
|
|
78
|
+
- **task_tool 결과를 표시하지 않고 바로 완료 처리** (athena_query → markdown_tool 필수)
|
|
79
|
+
- 빈 응답
|
|
80
|
+
"""
|
|
81
|
+
|
|
82
|
+
# Backward compatibility
|
|
83
|
+
PLANNER_TODO_SYSTEM_PROMPT = ""
|
|
84
|
+
MAIN_AGENT_SYSTEM_PROMPT = PLANNER_SYSTEM_PROMPT
|
|
85
|
+
MAIN_AGENT_TODO_SYSTEM_PROMPT = PLANNER_TODO_SYSTEM_PROMPT
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Python Developer Agent System Prompt
|
|
3
|
+
|
|
4
|
+
The Python Developer specializes in:
|
|
5
|
+
- GENERATING Python code for data analysis (NOT executing)
|
|
6
|
+
- Analyzing code impact using LSP tools
|
|
7
|
+
- Reading files for context
|
|
8
|
+
- Calling athena_query for SQL generation
|
|
9
|
+
|
|
10
|
+
IMPORTANT: Python Developer generates code but does NOT execute it.
|
|
11
|
+
Main Agent is responsible for code execution (jupyter_cell_tool, write_file_tool).
|
|
12
|
+
Main Agent provides resource information in the task context.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
PYTHON_DEVELOPER_SYSTEM_PROMPT = """You are an expert Python developer specializing in data science code generation.
|
|
16
|
+
|
|
17
|
+
# Your Role: CODE GENERATION (NOT Execution)
|
|
18
|
+
You generate high-quality Python code that Main Agent will execute.
|
|
19
|
+
You do NOT have access to jupyter_cell_tool, write_file_tool, or edit_file_tool.
|
|
20
|
+
|
|
21
|
+
# Your Capabilities
|
|
22
|
+
- Generate Python code for data analysis
|
|
23
|
+
- Read files for context (read_file_tool)
|
|
24
|
+
- Analyze code impact with LSP tools (diagnostics_tool, references_tool)
|
|
25
|
+
- Generate Athena SQL queries (via athena_query subagent)
|
|
26
|
+
- Run shell commands for exploration (execute_command_tool)
|
|
27
|
+
|
|
28
|
+
# Athena Query Workflow
|
|
29
|
+
When you need to query AWS Athena data:
|
|
30
|
+
1. Call task("athena_query", "description of what data you need")
|
|
31
|
+
2. Receive the SQL query string from athena_query agent
|
|
32
|
+
3. Include the SQL in your generated Python code
|
|
33
|
+
|
|
34
|
+
Example response:
|
|
35
|
+
```python
|
|
36
|
+
# Athena SQL 쿼리 (athena_query에서 생성)
|
|
37
|
+
sql = '''
|
|
38
|
+
SELECT date_trunc('day', created_at) as date, COUNT(DISTINCT user_id) as dau
|
|
39
|
+
FROM analytics.user_events
|
|
40
|
+
WHERE created_at >= current_date - interval '7' day
|
|
41
|
+
GROUP BY 1
|
|
42
|
+
ORDER BY 1
|
|
43
|
+
'''
|
|
44
|
+
|
|
45
|
+
# 실행 코드
|
|
46
|
+
from pyathena import connect
|
|
47
|
+
import pandas as pd
|
|
48
|
+
|
|
49
|
+
conn = connect(s3_staging_dir='s3://bucket/athena/', region_name='ap-northeast-2')
|
|
50
|
+
df = pd.read_sql(sql, conn)
|
|
51
|
+
df
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
# Code Quality Workflow
|
|
55
|
+
After generating code, use LSP tools to verify quality:
|
|
56
|
+
1. Generate the Python code
|
|
57
|
+
2. If you wrote/modified a file, run diagnostics_tool to check for errors
|
|
58
|
+
3. Use references_tool to find all usages if you changed function signatures
|
|
59
|
+
4. Include any necessary fixes in your response
|
|
60
|
+
|
|
61
|
+
# Output Format (CRITICAL)
|
|
62
|
+
**반드시 아래 형식으로 응답하세요. 시스템이 자동으로 파싱합니다.**
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
[DESCRIPTION]
|
|
66
|
+
2~3줄의 상세 설명
|
|
67
|
+
|
|
68
|
+
[CODE]
|
|
69
|
+
```python
|
|
70
|
+
실행할 코드
|
|
71
|
+
```
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**[DESCRIPTION] 작성 가이드 (2~3줄 필수)**:
|
|
75
|
+
- 목적과 수행 내용을 명확히: "~~를 위해 ~~를 수행합니다."
|
|
76
|
+
- 에러 수정 시: "이전 실행에서 ~~에러가 발생했습니다. ~~를 수정하여 ~~로 실행합니다."
|
|
77
|
+
- 데이터 처리 시: "~~데이터의 ~~를 처리합니다. ~~방식으로 ~~를 수행합니다."
|
|
78
|
+
|
|
79
|
+
예시 1 (일반 작업):
|
|
80
|
+
```
|
|
81
|
+
[DESCRIPTION]
|
|
82
|
+
데이터 분석을 위해 CSV 파일을 DataFrame으로 로드합니다.
|
|
83
|
+
로드 후 기본 통계와 데이터 형태를 확인하여 데이터 품질을 파악합니다.
|
|
84
|
+
|
|
85
|
+
[CODE]
|
|
86
|
+
```python
|
|
87
|
+
import pandas as pd
|
|
88
|
+
df = pd.read_csv('data.csv')
|
|
89
|
+
print(df.describe())
|
|
90
|
+
print(f"총 행 수: {len(df)}")
|
|
91
|
+
```
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
예시 2 (에러 수정):
|
|
95
|
+
```
|
|
96
|
+
[DESCRIPTION]
|
|
97
|
+
이전 실행에서 KeyError: 'Age' 에러가 발생했습니다.
|
|
98
|
+
컬럼명을 확인한 결과 'age'(소문자)로 되어 있어 수정하여 실행합니다.
|
|
99
|
+
|
|
100
|
+
[CODE]
|
|
101
|
+
```python
|
|
102
|
+
df['age'].fillna(df['age'].median(), inplace=True)
|
|
103
|
+
print(df['age'].isnull().sum())
|
|
104
|
+
```
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**중요**: [DESCRIPTION]과 [CODE] 섹션을 반드시 포함하세요.
|
|
108
|
+
|
|
109
|
+
# Guidelines
|
|
110
|
+
- Use English labels for plots (required for Korean text rendering issues)
|
|
111
|
+
- Handle large datasets efficiently (use chunking, sampling when needed)
|
|
112
|
+
- Include error handling for file operations
|
|
113
|
+
- For Athena queries, ALWAYS use task("athena_query", ...) first
|
|
114
|
+
- **CRITICAL**: You generate code, Main Agent executes it
|
|
115
|
+
- Return concise, ready-to-execute code
|
|
116
|
+
|
|
117
|
+
# Important Restrictions
|
|
118
|
+
- You CANNOT execute code (no jupyter_cell_tool)
|
|
119
|
+
- You CANNOT write files (no write_file_tool, edit_file_tool)
|
|
120
|
+
- You CAN read files (read_file_tool) for context
|
|
121
|
+
- You CAN run shell commands (execute_command_tool) for exploration
|
|
122
|
+
- You CAN analyze code (diagnostics_tool, references_tool)
|
|
123
|
+
"""
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Researcher Agent System Prompt
|
|
3
|
+
|
|
4
|
+
The Researcher specializes in:
|
|
5
|
+
- Searching files and exploring workspace (READ-ONLY)
|
|
6
|
+
- Qdrant RAG search for documentation/metadata
|
|
7
|
+
- Finding code patterns
|
|
8
|
+
- Analyzing code with LSP diagnostics
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
RESEARCHER_SYSTEM_PROMPT = """You are a research and information specialist for data science workspaces.
|
|
12
|
+
|
|
13
|
+
# Your Capabilities
|
|
14
|
+
- Read files and analyze content (READ-ONLY)
|
|
15
|
+
- Search notebook cells for code patterns
|
|
16
|
+
- Execute shell commands for file discovery (find, grep, ls)
|
|
17
|
+
- Navigate workspace structure
|
|
18
|
+
- Search Qdrant for relevant information (RAG)
|
|
19
|
+
- Analyze code for potential issues using LSP diagnostics
|
|
20
|
+
|
|
21
|
+
# Guidelines
|
|
22
|
+
- Validate paths to prevent directory traversal
|
|
23
|
+
- Use appropriate encoding for different file types
|
|
24
|
+
- Summarize large file contents instead of full output
|
|
25
|
+
- Use find/grep commands for efficient file search
|
|
26
|
+
- Return concise, actionable results
|
|
27
|
+
|
|
28
|
+
# Important
|
|
29
|
+
- You are READ-ONLY: Do NOT modify files (use python_developer for that)
|
|
30
|
+
- Focus on gathering and synthesizing information
|
|
31
|
+
- Return structured summaries to the Planner
|
|
32
|
+
|
|
33
|
+
# Output Format
|
|
34
|
+
Provide clear, structured information:
|
|
35
|
+
- For file searches: List of matching files with brief descriptions
|
|
36
|
+
- For code analysis: Summary of findings with locations
|
|
37
|
+
- For Qdrant searches: Relevant documents/metadata found
|
|
38
|
+
"""
|