@curie-agent/core 0.2.4 → 0.3.0
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.
- package/LICENSE +179 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/src/channel-router.js +1 -1
- package/dist/src/channel-router.js.map +1 -1
- package/dist/src/context.d.ts +11 -0
- package/dist/src/context.d.ts.map +1 -0
- package/dist/src/context.js +80 -0
- package/dist/src/context.js.map +1 -0
- package/dist/src/cron-manager.d.ts +27 -8
- package/dist/src/cron-manager.d.ts.map +1 -1
- package/dist/src/cron-manager.js +121 -33
- package/dist/src/cron-manager.js.map +1 -1
- package/dist/src/event-bus.d.ts +71 -0
- package/dist/src/event-bus.d.ts.map +1 -1
- package/dist/src/event-bus.js.map +1 -1
- package/dist/src/heartbeat-delivery.d.ts +2 -0
- package/dist/src/heartbeat-delivery.d.ts.map +1 -1
- package/dist/src/heartbeat-delivery.js +20 -3
- package/dist/src/heartbeat-delivery.js.map +1 -1
- package/dist/src/heartbeat-executor.d.ts +36 -2
- package/dist/src/heartbeat-executor.d.ts.map +1 -1
- package/dist/src/heartbeat-executor.js +32 -40
- package/dist/src/heartbeat-executor.js.map +1 -1
- package/dist/src/identity-files.d.ts +29 -0
- package/dist/src/identity-files.d.ts.map +1 -0
- package/dist/src/identity-files.js +59 -0
- package/dist/src/identity-files.js.map +1 -0
- package/dist/src/index.d.ts +19 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +13 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/pricing.d.ts +29 -0
- package/dist/src/pricing.d.ts.map +1 -0
- package/dist/src/pricing.js +85 -0
- package/dist/src/pricing.js.map +1 -0
- package/dist/src/safety/command-guard.d.ts.map +1 -1
- package/dist/src/safety/command-guard.js +35 -1
- package/dist/src/safety/command-guard.js.map +1 -1
- package/dist/src/safety/path-guard.d.ts +7 -3
- package/dist/src/safety/path-guard.d.ts.map +1 -1
- package/dist/src/safety/path-guard.js +14 -5
- package/dist/src/safety/path-guard.js.map +1 -1
- package/dist/src/safety/snapshot.js +1 -1
- package/dist/src/safety/snapshot.js.map +1 -1
- package/dist/src/session-store.d.ts +3 -1
- package/dist/src/session-store.d.ts.map +1 -1
- package/dist/src/session-store.js +24 -1
- package/dist/src/session-store.js.map +1 -1
- package/dist/src/settings.d.ts +98 -1
- package/dist/src/settings.d.ts.map +1 -1
- package/dist/src/settings.js +363 -83
- package/dist/src/settings.js.map +1 -1
- package/dist/src/shell-detect.d.ts +12 -0
- package/dist/src/shell-detect.d.ts.map +1 -0
- package/dist/src/shell-detect.js +31 -0
- package/dist/src/shell-detect.js.map +1 -0
- package/dist/src/subagent-executor.d.ts +68 -0
- package/dist/src/subagent-executor.d.ts.map +1 -0
- package/dist/src/subagent-executor.js +289 -0
- package/dist/src/subagent-executor.js.map +1 -0
- package/dist/src/task-executor.d.ts +31 -0
- package/dist/src/task-executor.d.ts.map +1 -0
- package/dist/src/task-executor.js +91 -0
- package/dist/src/task-executor.js.map +1 -0
- package/dist/src/task-manager.d.ts +83 -0
- package/dist/src/task-manager.d.ts.map +1 -0
- package/dist/src/task-manager.js +308 -0
- package/dist/src/task-manager.js.map +1 -0
- package/dist/src/task-migration.d.ts +10 -0
- package/dist/src/task-migration.d.ts.map +1 -0
- package/dist/src/task-migration.js +144 -0
- package/dist/src/task-migration.js.map +1 -0
- package/dist/src/task-summary.d.ts +7 -0
- package/dist/src/task-summary.d.ts.map +1 -0
- package/dist/src/task-summary.js +34 -0
- package/dist/src/task-summary.js.map +1 -0
- package/dist/src/template-utils.d.ts +16 -0
- package/dist/src/template-utils.d.ts.map +1 -0
- package/dist/src/template-utils.js +72 -0
- package/dist/src/template-utils.js.map +1 -0
- package/dist/src/token-monitor.d.ts +50 -0
- package/dist/src/token-monitor.d.ts.map +1 -0
- package/dist/src/token-monitor.js +119 -0
- package/dist/src/token-monitor.js.map +1 -0
- package/dist/src/turn-loop.d.ts +10 -1
- package/dist/src/turn-loop.d.ts.map +1 -1
- package/dist/src/turn-loop.js +152 -23
- package/dist/src/turn-loop.js.map +1 -1
- package/dist/src/unified-task.d.ts +76 -0
- package/dist/src/unified-task.d.ts.map +1 -0
- package/dist/src/unified-task.js +196 -0
- package/dist/src/unified-task.js.map +1 -0
- package/package.json +16 -11
- package/templates/AGENTS.md +53 -0
- package/templates/HEARTBEAT.md +37 -0
- package/templates/MEMORY.md +29 -0
- package/templates/SOUL.md +28 -0
- package/templates/TOOLS.md +29 -0
- package/templates/USER.md +35 -0
- package/templates/WIKI.md +146 -0
- package/templates/settings.json +90 -0
- package/templates/skills/deep-research/SKILL.md +273 -0
- package/templates/skills/deep-research/references/report-structure.md +149 -0
- package/templates/skills/deep-research/references/topic-guides.md +151 -0
- package/templates/skills/planning/SKILL.md +222 -0
- package/templates/skills/planning/references/business.md +82 -0
- package/templates/skills/planning/references/creative.md +111 -0
- package/templates/skills/planning/references/events.md +109 -0
- package/templates/skills/planning/references/personal.md +107 -0
- package/templates/skills/planning/references/templates.md +279 -0
- package/templates/skills/wiki/SKILL.md +70 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# USER.md - The Human Context
|
|
2
|
+
|
|
3
|
+
*AI INSTRUCTION: This file contains the living context of your human. Use this data to tailor your responses, anticipate needs, and adapt your technical depth. Update this file organically as you learn new implicit or explicit facts.*
|
|
4
|
+
|
|
5
|
+
### 🛑 SECURITY CONSTRAINT: PII SAFEGUARD
|
|
6
|
+
*The data in this file is highly sensitive. NEVER transmit these details to external APIs, public web searches, or third-party platforms without explicit, case-by-case user consent.*
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 1. Core Profile
|
|
11
|
+
- **Name / Moniker:** {{USER_NAME}}
|
|
12
|
+
- **Pronouns:** he/him
|
|
13
|
+
- **Location & Timezone:** {{USER_TIMEZONE}}
|
|
14
|
+
- **Primary Language:** English
|
|
15
|
+
|
|
16
|
+
## 2. Operating Context
|
|
17
|
+
*AI Note: Use this to calibrate the complexity and focus of your answers.*
|
|
18
|
+
- **Current Role/Day Job:** *(Pending)*
|
|
19
|
+
- **Core Expertise:** {{USER_LANGUAGES}}
|
|
20
|
+
- **Current Ambitions/Goals:** *(Pending)*
|
|
21
|
+
|
|
22
|
+
## 3. Personal Ecosystem
|
|
23
|
+
*AI Note: Log important entities, relationships, and preferences here as they are naturally mentioned (e.g., family members, pets, specific dietary needs, recurring hobbies).*
|
|
24
|
+
- *(Pending)*
|
|
25
|
+
|
|
26
|
+
## 4. Interaction Preferences
|
|
27
|
+
*AI Note: Track how the user prefers to work. Do they want deep technical explanations or high-level summaries? Do they prefer certain coding languages or frameworks? Are they a morning person or a night owl?*
|
|
28
|
+
- *(Pending)*
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
### 🔄 Update Protocol
|
|
33
|
+
1. **Listen implicitly:** Do not interrogate the user to fill these fields. Pick up clues naturally from conversation.
|
|
34
|
+
2. **Commit safely:** When you learn a concrete, persistent fact about the user, update this file during a background Heartbeat cycle.
|
|
35
|
+
3. **Keep it relevant:** This is a dynamic profile, not a stalker's dossier. Only keep information that helps you be a better, more frictionless assistant.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# WIKI.md — Knowledge Base Schema
|
|
2
|
+
|
|
3
|
+
This file describes the structure and workflows for your curie-agent knowledge wiki.
|
|
4
|
+
The agent reads it when performing wiki operations. Edit this file to customize conventions.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Directory Layout
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
wiki/
|
|
12
|
+
├── WIKI.md # this schema
|
|
13
|
+
├── index.md # content catalog (category-organized)
|
|
14
|
+
├── log.md # append-only chronological record
|
|
15
|
+
├── raw/ # immutable sources (agent reads, never edits)
|
|
16
|
+
│ └── assets/ # downloaded images / attachments
|
|
17
|
+
└── pages/ # LLM-generated markdown pages
|
|
18
|
+
├── entities/ # one page per entity (person, org, product, tool…)
|
|
19
|
+
├── concepts/ # one page per concept, topic, or pattern
|
|
20
|
+
└── summaries/ # one summary page per ingested source
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Page Conventions
|
|
26
|
+
|
|
27
|
+
Every page begins with Obsidian-compatible YAML frontmatter:
|
|
28
|
+
|
|
29
|
+
```yaml
|
|
30
|
+
---
|
|
31
|
+
title: Page Title
|
|
32
|
+
tags: [tag1, tag2]
|
|
33
|
+
sources: [summaries/yyyy-mm-dd-source-slug]
|
|
34
|
+
updated: YYYY-MM-DD
|
|
35
|
+
---
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Use `[[wikilinks]]` to cross-reference other pages:
|
|
39
|
+
- `[[concepts/topic]]` — basic link
|
|
40
|
+
- `[[entities/name|Display Name]]` — with display text
|
|
41
|
+
|
|
42
|
+
One page per entity or concept. One summary page per ingested source.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## index.md Format
|
|
47
|
+
|
|
48
|
+
Category-organized catalog. The agent updates this on every ingest.
|
|
49
|
+
|
|
50
|
+
```markdown
|
|
51
|
+
## Concepts
|
|
52
|
+
- [[concepts/compounding-knowledge]] — Wiki-as-artifact; cross-references precomputed. (3 sources)
|
|
53
|
+
|
|
54
|
+
## Entities
|
|
55
|
+
- [[entities/anthropic]] — AI lab; maker of Claude. (5 sources)
|
|
56
|
+
|
|
57
|
+
## Summaries
|
|
58
|
+
- [[summaries/2026-05-30-llm-wiki-gist]] — Karpathy's compounding-wiki pattern. (1 source)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Parse categories: `grep "^## " index.md`
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## log.md Format
|
|
66
|
+
|
|
67
|
+
Append-only chronological record with machine-parseable prefixes.
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
## [2026-05-30] ingest | Source Title
|
|
71
|
+
INGEST: summaries/2026-05-30-slug; touched concepts/foo, entities/bar
|
|
72
|
+
|
|
73
|
+
## [2026-05-30] query | "how does the wiki differ from RAG?"
|
|
74
|
+
QUERY: read concepts/compounding-knowledge; filed concepts/rag-vs-wiki
|
|
75
|
+
|
|
76
|
+
## [2026-05-30] lint | health check
|
|
77
|
+
LINT: 2 orphans (entities/x, concepts/y); 1 broken link fixed
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Parse recent entries: `grep "^## \[" log.md | tail -5`
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Wiki Tool (op reference)
|
|
85
|
+
|
|
86
|
+
| op | Required params | Action |
|
|
87
|
+
|----|----------------|--------|
|
|
88
|
+
| `init` | — | scaffold wiki structure + copy WIKI.md |
|
|
89
|
+
| `list_sources` | — | list files in `raw/` |
|
|
90
|
+
| `list_pages` | — | list all pages with slug/title/category |
|
|
91
|
+
| `page_get` | `slug` | read a page |
|
|
92
|
+
| `page_put` | `slug`, `content` | write a page (auto-updates index + log) |
|
|
93
|
+
| `index_get` | — | read index.md as structured entries |
|
|
94
|
+
| `index_upsert` | `slug`, `title`, `summary`, `category` | update one index entry |
|
|
95
|
+
| `log_append` | `prefix`, `title`, `line?` | append a log entry |
|
|
96
|
+
| `search` | `query` | grep over pages + index.md |
|
|
97
|
+
| `graph` | — | extract `[[wikilinks]]` → nodes + edges |
|
|
98
|
+
| `lint_report` | — | deterministic checks (orphans, broken links, missing-from-index, stale) |
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## INGEST Workflow
|
|
103
|
+
|
|
104
|
+
When the user adds a new source:
|
|
105
|
+
|
|
106
|
+
1. **Read** the source — `WebFetch` for URLs, `Read` for local files (PDF, image, text).
|
|
107
|
+
2. **Identify** key entities, concepts, claims, and relationships.
|
|
108
|
+
3. **Search** for existing related pages: `Wiki(op=search, query=<key terms>)`.
|
|
109
|
+
4. **Write summary** page:
|
|
110
|
+
`Wiki(op=page_put, slug=summaries/YYYY-MM-DD-<slug>, content=<markdown with frontmatter>)`
|
|
111
|
+
5. **Update related pages** (5–15 pages):
|
|
112
|
+
- `Wiki(op=page_get, slug=<slug>)` → update content → `Wiki(op=page_put, …)`
|
|
113
|
+
- Create new entity/concept pages as needed.
|
|
114
|
+
6. **Update index** for each touched page:
|
|
115
|
+
`Wiki(op=index_upsert, slug=<slug>, title=…, summary=…, category=…)`
|
|
116
|
+
7. **Append log**:
|
|
117
|
+
`Wiki(op=log_append, prefix=INGEST, title=<source title>, line=<pages touched>)`
|
|
118
|
+
8. Report a summary to the user.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## QUERY Workflow
|
|
123
|
+
|
|
124
|
+
When the user asks a question:
|
|
125
|
+
|
|
126
|
+
1. **Read catalog**: `Wiki(op=index_get)` — identify relevant categories.
|
|
127
|
+
2. **Search**: `Wiki(op=search, query=<key terms>)`.
|
|
128
|
+
3. **Read pages**: `Wiki(op=page_get, slug=<slug>)` for each relevant result.
|
|
129
|
+
4. **Synthesize** an answer with citations: `[[slug]]` or `(see [[slug]])`.
|
|
130
|
+
5. **File novel insights**: if the synthesis reveals a non-trivial connection or new concept:
|
|
131
|
+
- `Wiki(op=page_put, slug=concepts/<slug>, content=…)`
|
|
132
|
+
- `Wiki(op=log_append, prefix=QUERY, title=<question>, line=<pages filed>)`
|
|
133
|
+
6. Report the cited answer.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## LINT Workflow
|
|
138
|
+
|
|
139
|
+
When health-checking the wiki:
|
|
140
|
+
|
|
141
|
+
1. **Graph**: `Wiki(op=graph)` — identify orphan pages and review link density.
|
|
142
|
+
2. **Lint report**: `Wiki(op=lint_report)` — get deterministic issues (orphans, broken links, missing-from-index, stale frontmatter).
|
|
143
|
+
3. **Semantic checks** (agent-driven): read relevant pages and check for contradictions, stale claims.
|
|
144
|
+
4. **Fix** broken links and missing index entries; flag unresolvable issues.
|
|
145
|
+
5. **Log**: `Wiki(op=log_append, prefix=LINT, title=health check, line=<summary>)`.
|
|
146
|
+
6. Suggest new sources to investigate based on data gaps.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"model": "qwen3.6-27B-MTP",
|
|
3
|
+
"effort": "high",
|
|
4
|
+
"mode": "auto",
|
|
5
|
+
"theme": "gruvbox",
|
|
6
|
+
"statusline": true,
|
|
7
|
+
"debug": false,
|
|
8
|
+
"current_provider": "local",
|
|
9
|
+
"providers": {
|
|
10
|
+
"anthropic": {
|
|
11
|
+
"api_key": "sk-12345",
|
|
12
|
+
"url": "https://api.anthropic.com",
|
|
13
|
+
"model": "claude-sonnet-4-6",
|
|
14
|
+
"model_cost": "3;15",
|
|
15
|
+
"model_context_window": 1000000
|
|
16
|
+
},
|
|
17
|
+
"openai": {
|
|
18
|
+
"api_key": "sk-12345",
|
|
19
|
+
"url": "https://api.openai.com/v1",
|
|
20
|
+
"model": "gpt-5.4",
|
|
21
|
+
"model_cost": "2.5;15|272000<5;22.5",
|
|
22
|
+
"model_context_window": 1000000
|
|
23
|
+
},
|
|
24
|
+
"openrouter": {
|
|
25
|
+
"api_key": "sk-12345",
|
|
26
|
+
"url": "https://openrouter.ai/api/v1",
|
|
27
|
+
"model": "qwen/qwen3.6-plus",
|
|
28
|
+
"model_cost": "0.325;1.95|256000<1.3;3.9",
|
|
29
|
+
"model_context_window": 1000000
|
|
30
|
+
},
|
|
31
|
+
"google": {
|
|
32
|
+
"api_key": "sk-12345",
|
|
33
|
+
"url": " https://generativelanguage.googleapis.com",
|
|
34
|
+
"model": "gemini-3-flash-preview",
|
|
35
|
+
"model_cost": "0.5;3",
|
|
36
|
+
"model_context_window": 1000000
|
|
37
|
+
},
|
|
38
|
+
"ollama": {
|
|
39
|
+
"api_key": "sk-12345",
|
|
40
|
+
"url": "http://192.168.255.235:11434/api",
|
|
41
|
+
"model": "gemma4-31B",
|
|
42
|
+
"model_cost": "0;0",
|
|
43
|
+
"model_context_window": 262144
|
|
44
|
+
},
|
|
45
|
+
"local": {
|
|
46
|
+
"api_key": "sk-12345",
|
|
47
|
+
"url": "http://172.26.217.161:8080",
|
|
48
|
+
"model": "qwen3.6-27B-MTP",
|
|
49
|
+
"model_cost": "0;0",
|
|
50
|
+
"model_context_window": 262144
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"channels": {
|
|
54
|
+
"bot_token": "012345",
|
|
55
|
+
"user_id": "012345",
|
|
56
|
+
"chat_id": "012345",
|
|
57
|
+
"allow_groups": false,
|
|
58
|
+
"tab_active": "telegram:012345"
|
|
59
|
+
},
|
|
60
|
+
"tools_per_call": 20,
|
|
61
|
+
"websearch_per_call": 10,
|
|
62
|
+
"brave_search_api_key": "BSAP012345",
|
|
63
|
+
"heartbeat": {
|
|
64
|
+
"schedule": "on",
|
|
65
|
+
"mode": "auto",
|
|
66
|
+
"intraday": "7:55,9:55,11:55,13:55,15:55,17:55",
|
|
67
|
+
"daily": "7:15",
|
|
68
|
+
"weekly": "friday@21:00",
|
|
69
|
+
"monthly": "1@6:50",
|
|
70
|
+
"dreaming": "23:01"
|
|
71
|
+
},
|
|
72
|
+
"mcp_servers": {
|
|
73
|
+
|
|
74
|
+
},
|
|
75
|
+
"safety": {
|
|
76
|
+
"path_guard": "on",
|
|
77
|
+
"path_allowlist": [],
|
|
78
|
+
"command_guard": "on",
|
|
79
|
+
"snapshots": "on"
|
|
80
|
+
},
|
|
81
|
+
"auto_compact": {
|
|
82
|
+
"enabled": "on",
|
|
83
|
+
"threshold": 75,
|
|
84
|
+
"warn_threshold": 60,
|
|
85
|
+
"forced_threshold": 85
|
|
86
|
+
},
|
|
87
|
+
"pricing_tier_warn": "on",
|
|
88
|
+
"web_ip": "0.0.0.0",
|
|
89
|
+
"daemon_token": "012345"
|
|
90
|
+
}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deep-research
|
|
3
|
+
description: >
|
|
4
|
+
Use this skill for any task that requires thorough, multi-source research going beyond a single
|
|
5
|
+
web search. Triggers include: "research X for me", "I need a deep dive on", "write a report
|
|
6
|
+
about", "compare X and Y in depth", "fact-check this", "help me understand [complex topic]",
|
|
7
|
+
"I'm writing a paper/article/presentation on", "what does the evidence say about", "give me a
|
|
8
|
+
comprehensive overview of", "I want to know everything about". Also trigger for investigative
|
|
9
|
+
tasks, literature reviews, market research, competitor analysis, background checks on companies
|
|
10
|
+
or topics, policy research, scientific topic explanations, historical investigations, and anything
|
|
11
|
+
where the user clearly wants more than a quick answer. If the user seems to be preparing for an
|
|
12
|
+
important decision, interview, debate, or creative project requiring facts — trigger this skill.
|
|
13
|
+
Works for all audiences: students, journalists, business professionals, academics, curious people.
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Deep Research Skill
|
|
17
|
+
|
|
18
|
+
A structured approach to thorough, reliable, multi-source research — for anyone, any topic.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 1. Understand the Research Goal First
|
|
23
|
+
|
|
24
|
+
Before searching, ask yourself (or the user if unclear):
|
|
25
|
+
|
|
26
|
+
- **Purpose**: Why do they need this? (personal curiosity, decision-making, writing a report, fact-checking, academic work, professional use?)
|
|
27
|
+
- **Depth**: A quick overview or a comprehensive deep dive?
|
|
28
|
+
- **Audience**: Who will read or use this? (themselves, a boss, a professor, a general audience?)
|
|
29
|
+
- **Constraints**: Any time period, geography, language, or source type preferences?
|
|
30
|
+
- **Format**: Do they want a report, a summary, bullet points, a comparison table, raw notes?
|
|
31
|
+
|
|
32
|
+
> If the request is clearly stated (e.g., "write me a deep report on the history of solar energy"), proceed directly. Only ask for clarification if genuinely ambiguous.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 2. Research Planning
|
|
37
|
+
|
|
38
|
+
Before running searches, map out the terrain:
|
|
39
|
+
|
|
40
|
+
### Decompose the Topic
|
|
41
|
+
Break the main question into sub-questions. Example:
|
|
42
|
+
- Main question: "Is intermittent fasting effective?"
|
|
43
|
+
- Sub-questions: What does clinical evidence say? What are the mechanisms? Who does it work for? What are the risks? What do critics say? What's the consensus?
|
|
44
|
+
|
|
45
|
+
### Identify Source Types Needed
|
|
46
|
+
Choose the right source types for the topic:
|
|
47
|
+
|
|
48
|
+
| Topic Type | Best Source Types |
|
|
49
|
+
|---|---|
|
|
50
|
+
| Scientific / Medical | Research papers, systematic reviews, health institutions (WHO, NIH, CDC) |
|
|
51
|
+
| Historical | Academic books, archives, encyclopedias, primary sources |
|
|
52
|
+
| Business / Market | Industry reports, company filings, financial news, analyst reports |
|
|
53
|
+
| Current Events | News outlets, government sources, NGOs |
|
|
54
|
+
| Legal / Policy | Official legislation, court records, policy think tanks |
|
|
55
|
+
| Technology | Official documentation, reputable tech publications, academic papers |
|
|
56
|
+
| Personal Finance | Government financial agencies, established financial institutions |
|
|
57
|
+
|
|
58
|
+
### Estimate Search Volume
|
|
59
|
+
- **Simple topic**: 3–5 searches
|
|
60
|
+
- **Moderate complexity**: 6–12 searches
|
|
61
|
+
- **Full deep dive / report**: 12–25+ searches across multiple angles
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 3. The Research Process
|
|
66
|
+
|
|
67
|
+
### Phase 1: Orientation Searches (2–4 searches)
|
|
68
|
+
Get the lay of the land. Search broad terms to understand:
|
|
69
|
+
- What the core concepts are
|
|
70
|
+
- What the major debates or angles are
|
|
71
|
+
- Which institutions or experts are authoritative on this topic
|
|
72
|
+
|
|
73
|
+
### Phase 2: Targeted Deep Searches (5–15 searches)
|
|
74
|
+
Go narrow. For each sub-question:
|
|
75
|
+
- Search for the specific claim or angle
|
|
76
|
+
- Fetch full articles when a snippet isn't enough (`web_fetch` key sources)
|
|
77
|
+
- Look for primary sources (studies, official data, original documents) not just commentary
|
|
78
|
+
|
|
79
|
+
### Phase 3: Verification & Counter-research (2–5 searches)
|
|
80
|
+
Actively look for:
|
|
81
|
+
- Contradicting evidence or alternative views
|
|
82
|
+
- Criticism of dominant claims
|
|
83
|
+
- Recent updates that might change the picture
|
|
84
|
+
- Fact-checks of specific claims
|
|
85
|
+
|
|
86
|
+
> **Critical rule**: Never stop at one source for an important claim. Cross-reference it.
|
|
87
|
+
|
|
88
|
+
### Phase 4: Gap-filling (as needed)
|
|
89
|
+
After drafting, identify what's still unclear or missing, and search specifically for those gaps.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 4. Source Evaluation
|
|
94
|
+
|
|
95
|
+
For every source, assess:
|
|
96
|
+
|
|
97
|
+
### Credibility Checklist
|
|
98
|
+
- **Who wrote it?** Named expert, institution, or anonymous?
|
|
99
|
+
- **Where was it published?** Peer-reviewed journal, established newspaper, government site, or unknown blog?
|
|
100
|
+
- **When?** Is it current enough for the topic?
|
|
101
|
+
- **Why?** Does the source have an agenda, funding conflict, or bias?
|
|
102
|
+
- **Is it primary or secondary?** Primary (original study, official data) is stronger than secondary (reporting on another report).
|
|
103
|
+
|
|
104
|
+
### Red Flags
|
|
105
|
+
- No author or institution named
|
|
106
|
+
- Extraordinary claims without cited evidence
|
|
107
|
+
- Selling something related to the claims
|
|
108
|
+
- Only one source making the claim
|
|
109
|
+
- Very old data for fast-changing topics
|
|
110
|
+
|
|
111
|
+
### Green Flags
|
|
112
|
+
- Peer-reviewed or published in established outlets
|
|
113
|
+
- Cites its own primary sources
|
|
114
|
+
- Author has relevant credentials
|
|
115
|
+
- Multiple independent sources agree
|
|
116
|
+
- Includes limitations or caveats (honest research acknowledges uncertainty)
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 5. Synthesis: Turning Information into Insight
|
|
121
|
+
|
|
122
|
+
Raw facts aren't enough. Good research synthesizes:
|
|
123
|
+
|
|
124
|
+
### Patterns to Look For
|
|
125
|
+
- **Consensus**: What do most credible sources agree on?
|
|
126
|
+
- **Contested areas**: Where do experts disagree, and why?
|
|
127
|
+
- **Emerging evidence**: What's new or shifting?
|
|
128
|
+
- **Gaps**: What isn't well-studied yet?
|
|
129
|
+
|
|
130
|
+
### Avoid These Synthesis Errors
|
|
131
|
+
- **Cherry-picking**: Using only sources that support one view
|
|
132
|
+
- **False balance**: Treating fringe and mainstream views as equally valid
|
|
133
|
+
- **Recency bias**: Assuming newer = better without checking quality
|
|
134
|
+
- **Authority bias**: Trusting a famous source without verifying the claim
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## 6. Output Formats
|
|
139
|
+
|
|
140
|
+
Choose the format that best serves the user's need:
|
|
141
|
+
|
|
142
|
+
### A) Research Summary (default for most requests)
|
|
143
|
+
```
|
|
144
|
+
## [Topic]
|
|
145
|
+
|
|
146
|
+
**Key Finding**: [One-sentence answer to the main question]
|
|
147
|
+
|
|
148
|
+
### What We Know
|
|
149
|
+
[2–4 paragraphs of synthesized findings, citing sources]
|
|
150
|
+
|
|
151
|
+
### Key Debates / Uncertainties
|
|
152
|
+
[What experts disagree on or what isn't settled]
|
|
153
|
+
|
|
154
|
+
### Practical Implications
|
|
155
|
+
[What this means for the user's situation]
|
|
156
|
+
|
|
157
|
+
### Sources
|
|
158
|
+
[List of key sources with brief annotations]
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### B) Comparison / Analysis Table
|
|
162
|
+
Use when comparing options, products, approaches, or positions.
|
|
163
|
+
Columns: criteria that matter | rows: the things being compared.
|
|
164
|
+
|
|
165
|
+
### C) Deep Report (for lengthy research)
|
|
166
|
+
See `references/report-structure.md` for full template.
|
|
167
|
+
|
|
168
|
+
### D) Annotated Source List
|
|
169
|
+
When the user wants to explore themselves — provide curated sources with a brief note on what each one offers and why it's valuable.
|
|
170
|
+
|
|
171
|
+
### E) Fact-Check Format
|
|
172
|
+
```
|
|
173
|
+
**Claim**: [Exact claim being checked]
|
|
174
|
+
**Verdict**: True / Mostly True / Misleading / False / Unverifiable
|
|
175
|
+
**Evidence**: [What sources say]
|
|
176
|
+
**Nuance**: [Important context or caveats]
|
|
177
|
+
**Sources**: [Citations]
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 7. Citation and Transparency Standards
|
|
183
|
+
|
|
184
|
+
- Always cite sources for specific claims, data points, and statistics
|
|
185
|
+
- Distinguish between: established fact, expert consensus, one study's finding, and opinion
|
|
186
|
+
- Use hedging language honestly: "evidence suggests", "according to X", "studies show" vs "it is proven that"
|
|
187
|
+
- If a claim can't be verified, say so clearly
|
|
188
|
+
- Mention when information may be outdated or when the topic is fast-moving
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## 8. Research Ethics and Limitations
|
|
193
|
+
|
|
194
|
+
Always be transparent with the user about:
|
|
195
|
+
|
|
196
|
+
- **Knowledge cutoff**: Remind them if the topic is very recent and may have changed
|
|
197
|
+
- **Source access**: Some primary sources (paywalled journals, internal documents) may not be accessible
|
|
198
|
+
- **Uncertainty**: Don't project more confidence than the evidence warrants
|
|
199
|
+
- **Bias awareness**: Note when a topic is politically or commercially contested and sources may be biased
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## 9. Topic-Specific Guidance
|
|
204
|
+
|
|
205
|
+
Read `references/topic-guides.md` for specific guidance on:
|
|
206
|
+
- Medical and health research
|
|
207
|
+
- Legal and regulatory research
|
|
208
|
+
- Financial and market research
|
|
209
|
+
- Scientific and academic research
|
|
210
|
+
- Historical research
|
|
211
|
+
- Investigative / journalistic research
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## 10. Delivering the Report
|
|
216
|
+
|
|
217
|
+
> This section is critical for long reports. Skipping it is the most common cause of incomplete output.
|
|
218
|
+
|
|
219
|
+
### When to write to a file
|
|
220
|
+
|
|
221
|
+
Write the report to a `.md` file whenever the output is expected to exceed ~300 words. Do **not** print long reports inline — the model output window is limited, and a large inline response will be cut off.
|
|
222
|
+
|
|
223
|
+
### Filename convention
|
|
224
|
+
|
|
225
|
+
Use a descriptive, lowercase, hyphenated filename in the current working directory:
|
|
226
|
+
- `research-<topic>-<date>.md` — e.g. `research-transformer-history-2025-05-31.md`
|
|
227
|
+
- Or use the exact filename the user requested
|
|
228
|
+
|
|
229
|
+
### Section-by-section writing pattern (use for any report with multiple sections)
|
|
230
|
+
|
|
231
|
+
Writing everything in a single `Write` call requires generating the entire file as one tool parameter. Even reports shorter than 500 lines can exceed the model's output limit if the content is dense prose — the result is a silently truncated file or an empty tool call. Always use the section-by-section approach for any substantial report:
|
|
232
|
+
|
|
233
|
+
**Step 1 — Write a skeleton** using the `Write` tool with placeholder text for each section:
|
|
234
|
+
```
|
|
235
|
+
## Introduction
|
|
236
|
+
[PLACEHOLDER]
|
|
237
|
+
|
|
238
|
+
## Background
|
|
239
|
+
[PLACEHOLDER]
|
|
240
|
+
|
|
241
|
+
## Key Findings
|
|
242
|
+
[PLACEHOLDER]
|
|
243
|
+
...
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
**Step 2 — Fill each section** using the `Edit` tool (one Edit call per section):
|
|
247
|
+
- `old_string`: the placeholder line for that section (e.g. `[PLACEHOLDER]` under `## Introduction`)
|
|
248
|
+
- `new_string`: the full written content for that section
|
|
249
|
+
|
|
250
|
+
Each Edit call generates only one section at a time (~200–600 tokens), well within any output limit regardless of how long the full report is.
|
|
251
|
+
|
|
252
|
+
### After writing
|
|
253
|
+
|
|
254
|
+
Always tell the user:
|
|
255
|
+
- The filename where the report was saved
|
|
256
|
+
- A 2–3 sentence summary of the key findings
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## 11. Quality Self-Check Before Delivering
|
|
261
|
+
|
|
262
|
+
Before presenting findings, verify:
|
|
263
|
+
|
|
264
|
+
- [ ] Did I search enough sources (not just 1–2)?
|
|
265
|
+
- [ ] Did I actively look for counter-evidence?
|
|
266
|
+
- [ ] Are my sources credible and appropriate for this topic?
|
|
267
|
+
- [ ] Did I distinguish facts from opinions and contested claims?
|
|
268
|
+
- [ ] Is the output format right for this user and their purpose?
|
|
269
|
+
- [ ] Have I been transparent about uncertainty and limitations?
|
|
270
|
+
- [ ] Did I avoid reproducing copyrighted text (paraphrase and cite instead)?
|
|
271
|
+
- [ ] Is the output actually useful — not just long?
|
|
272
|
+
- [ ] For reports longer than ~300 words: saved to a file, not printed inline?
|
|
273
|
+
- [ ] If the report is long: used section-by-section Edit pattern rather than one massive Write call?
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Deep Report Structure Template
|
|
2
|
+
|
|
3
|
+
Use this template when the user asks for a comprehensive report, white paper, literature review,
|
|
4
|
+
or any long-form research output. Adapt sections as needed — not every section applies to every topic.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Report Template
|
|
9
|
+
|
|
10
|
+
```markdown
|
|
11
|
+
# [Title: Clear, Specific, Descriptive]
|
|
12
|
+
|
|
13
|
+
**Prepared for**: [Audience / purpose]
|
|
14
|
+
**Date**: [Month Year]
|
|
15
|
+
**Research scope**: [Time period covered, geographic scope, source types used]
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Executive Summary
|
|
20
|
+
|
|
21
|
+
[3–5 sentences maximum. Answer: What was researched, what are the key findings, and what are
|
|
22
|
+
the main implications. This is the only section many readers will read — make it count.]
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Introduction
|
|
27
|
+
|
|
28
|
+
**Background**: [Why this topic matters / context]
|
|
29
|
+
**Research questions**: [The specific questions this report addresses]
|
|
30
|
+
**Scope and limitations**: [What is and isn't covered, and why]
|
|
31
|
+
**Methodology**: [How research was conducted: source types, search strategy, evaluation criteria]
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Section 1: [Core Topic / Foundational Context]
|
|
36
|
+
|
|
37
|
+
[Establish what is known, agreed upon, and well-documented. This section grounds the reader.]
|
|
38
|
+
|
|
39
|
+
### Key findings
|
|
40
|
+
- ...
|
|
41
|
+
|
|
42
|
+
### Sources basis
|
|
43
|
+
[Note what types of sources underpin this section and their quality]
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Section 2: [Main Analysis / Findings]
|
|
48
|
+
|
|
49
|
+
[The substantive core of the research. Use sub-sections as needed.]
|
|
50
|
+
|
|
51
|
+
### 2.1 [Sub-topic]
|
|
52
|
+
...
|
|
53
|
+
|
|
54
|
+
### 2.2 [Sub-topic]
|
|
55
|
+
...
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Section 3: [Debates, Disagreements, Uncertainty]
|
|
60
|
+
|
|
61
|
+
[Where experts or sources disagree. Be fair to all serious positions.]
|
|
62
|
+
|
|
63
|
+
### Area of disagreement 1
|
|
64
|
+
**Position A**: [What some argue, with evidence]
|
|
65
|
+
**Position B**: [What others argue, with evidence]
|
|
66
|
+
**Assessment**: [What the weight of evidence suggests, or note if genuinely unresolved]
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Section 4: [Implications / So What?]
|
|
71
|
+
|
|
72
|
+
[What do these findings mean in practice? Connect back to why the user needed this research.]
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Section 5: [Gaps & Future Directions] *(optional)*
|
|
77
|
+
|
|
78
|
+
[What isn't well-studied? What questions remain open? What should the reader watch for?]
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Conclusions
|
|
83
|
+
|
|
84
|
+
[Synthesize: What does the body of evidence say? What is the answer to the main question,
|
|
85
|
+
with appropriate confidence? What are the most important caveats?]
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Recommendations *(if applicable)*
|
|
90
|
+
|
|
91
|
+
[Only include if the user asked for actionable guidance. Base firmly on the evidence above.
|
|
92
|
+
Use hedged language: "The evidence suggests...", "Consider...", "If X is true, then..."]
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Sources
|
|
97
|
+
|
|
98
|
+
[Annotated bibliography — not just URLs. For each key source, include:]
|
|
99
|
+
- Full citation (author, title, publication, date, url)
|
|
100
|
+
- Brief note: what it contributes and any relevant caveats (e.g., industry-funded, older study)
|
|
101
|
+
|
|
102
|
+
Group by: Primary sources | Secondary analysis | Background context
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Appendix *(optional)*
|
|
107
|
+
|
|
108
|
+
[Data tables, detailed methodology notes, extended quotes, glossary of technical terms]
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Length Guidelines
|
|
114
|
+
|
|
115
|
+
| Report Type | Approximate Length |
|
|
116
|
+
|---|---|
|
|
117
|
+
| Quick brief | 300–600 words |
|
|
118
|
+
| Standard summary | 600–1,200 words |
|
|
119
|
+
| Research report | 1,200–3,000 words |
|
|
120
|
+
| Comprehensive deep dive | 3,000–6,000 words |
|
|
121
|
+
| Literature review / white paper | 5,000+ words |
|
|
122
|
+
|
|
123
|
+
Always ask the user their preference if not specified — defaulting to the shortest format that fully answers the question is usually best.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Tone and Style Calibration
|
|
128
|
+
|
|
129
|
+
Adjust writing to the user's context:
|
|
130
|
+
|
|
131
|
+
| Audience | Tone | Jargon level | Citation style |
|
|
132
|
+
|---|---|---|---|
|
|
133
|
+
| Personal / curious | Conversational, engaging | Low — explain terms | Informal ("According to a 2023 Harvard study...") |
|
|
134
|
+
| Business professional | Clear, direct, executive | Medium | Inline with source name |
|
|
135
|
+
| Academic | Formal, precise | High (field-appropriate) | APA / MLA / Chicago |
|
|
136
|
+
| Journalist | Accessible, vivid | Low-medium | Clear attribution |
|
|
137
|
+
| Student | Thorough, explanatory | Medium | As required by assignment |
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Common Report Mistakes to Avoid
|
|
142
|
+
|
|
143
|
+
- **Padding**: length without substance — every paragraph should add something
|
|
144
|
+
- **Missing the forest for the trees**: lots of facts, no synthesis or conclusion
|
|
145
|
+
- **False certainty**: presenting contested findings as settled
|
|
146
|
+
- **Burying the lede**: the most important finding should not be on page 4
|
|
147
|
+
- **Source monoculture**: citing only one type of source (e.g., only news, only studies)
|
|
148
|
+
- **Recency bias**: assuming recent = better without checking quality
|
|
149
|
+
- **No practical bridge**: research without connecting to why the user needs it
|