Skip to content

Commit 71a9a1a

Browse files
committed
update deep research template
1 parent 782b8cc commit 71a9a1a

File tree

3 files changed

+6
-92
lines changed

3 files changed

+6
-92
lines changed

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hatchet-dev/pickaxe-cli",
3-
"version": "0.1.18",
3+
"version": "0.1.19",
44
"main": "dist/index.js",
55
"bin": {
66
"pickaxe": "./dist/index.js"

cli/templates/deep-research/README.md.hbs

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -72,85 +72,6 @@ pnpm start
7272
- `src/pickaxe-client.ts` - Pickaxe client configuration
7373
- `results/` - Generated research reports from trigger sessions
7474

75-
## How Deep Research Works
76-
77-
The deep research agent performs sophisticated multi-iteration research:
78-
79-
1. **Query Planning**: Analyzes your question and plans targeted search queries
80-
2. **Web Search**: Searches the web using OpenAI's search preview tool
81-
3. **Content Extraction**: Converts web pages to clean markdown format
82-
4. **Fact Extraction**: Identifies and extracts key facts from each source
83-
5. **Gap Analysis**: Evaluates what information is still missing
84-
6. **Iterative Refinement**: Repeats the process focusing on missing aspects
85-
7. **Synthesis**: Creates a comprehensive summary with full source attribution
86-
87-
## Available Tools
88-
89-
### Search Tool
90-
Performs web searches using OpenAI's advanced search preview.
91-
- Provides high-quality, recent web results
92-
- Includes source URLs and titles
93-
- Optimized for research queries
94-
95-
### Plan Search Tool
96-
Intelligently plans search queries based on existing knowledge and gaps.
97-
- Analyzes what information we already have
98-
- Identifies missing aspects that need investigation
99-
- Generates targeted search queries for maximum information gain
100-
101-
### Website to Markdown Tool
102-
Converts web pages to clean, readable markdown format.
103-
- Removes ads, navigation, and clutter
104-
- Preserves important content structure
105-
- Maintains links and formatting for citations
106-
107-
### Extract Facts Tool
108-
Identifies and extracts key facts from source material.
109-
- Focuses on information relevant to the research query
110-
- Attributes facts to specific sources
111-
- Filters out opinions and maintains objectivity
112-
113-
### Judge Facts Tool
114-
Evaluates whether we have sufficient information to answer the query.
115-
- Assesses completeness of gathered facts
116-
- Identifies specific missing aspects
117-
- Determines if additional research iterations are needed
118-
119-
### Judge Results Tool
120-
Assesses the quality and completeness of the final research.
121-
- Evaluates if the research adequately addresses the original query
122-
- Provides reasoning for completeness assessment
123-
- Ensures research meets quality standards
124-
125-
### Summarize Tool
126-
Synthesizes all gathered information into a coherent, comprehensive summary.
127-
- Combines facts from multiple sources
128-
- Maintains source attribution
129-
- Creates readable, well-structured reports
130-
131-
## Environment Variables
132-
133-
| Variable | Required | Description |
134-
|----------|----------|-------------|
135-
| `OPENAI_API_KEY` | Yes | Your OpenAI API key for language model and search |
136-
| `HATCHET_CLIENT_TOKEN` | Yes | Your Hatchet API token for orchestration |
137-
138-
## Example Research Queries
139-
140-
- "What are the latest developments in quantum computing and their potential applications?"
141-
- "How has climate change affected Arctic ice coverage over the past decade?"
142-
- "What are the key differences between various machine learning frameworks?"
143-
- "What are the economic impacts of remote work on urban centers?"
144-
- "How do different countries approach renewable energy policy?"
145-
146-
## Research Features
147-
148-
- **Multi-Source Analysis**: Gathers information from multiple web sources
149-
- **Iterative Refinement**: Performs multiple research rounds to fill knowledge gaps
150-
- **Source Attribution**: Maintains detailed citations for all facts
151-
- **Quality Assessment**: Evaluates research completeness and reliability
152-
- **Comprehensive Reporting**: Generates detailed reports with summaries and sources
153-
15475
## Scripts
15576

15677
- `pnpm run trigger` - Run the interactive deep research CLI

cli/templates/deep-research/src/trigger.ts.hbs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ ${result.result.facts ? result.result.facts.map((fact: any, index: number) =>
105105
}
106106
}
107107
108-
async function runAgent(query: string) {
108+
async function runAgent(query: string, rl: readline.Interface) {
109109
const startTime = Date.now();
110110
console.log(`\n🔬 Starting deep research on: "${query}"`);
111111
console.log('⏳ This may take several minutes as we perform comprehensive research...\n');
@@ -141,19 +141,12 @@ async function runAgent(query: string) {
141141
142142
console.log('='.repeat(80));
143143
144-
// Ask if user wants to save results
145-
const rl = readline.createInterface({
146-
input: process.stdin,
147-
output: process.stdout
148-
});
149-
144+
// Ask if user wants to save results using the existing readline interface
150145
const saveChoice = await prompt(rl, '\n💾 Save detailed results to file? (y/N): ');
151146
if (saveChoice.toLowerCase() === 'y' || saveChoice.toLowerCase() === 'yes') {
152147
await saveResultToFile(query, result);
153148
}
154149
155-
rl.close();
156-
157150
} catch (error) {
158151
const duration = Math.round((Date.now() - startTime) / 1000);
159152
console.log(`❌ Research failed after ${duration}s`);
@@ -186,7 +179,7 @@ async function main() {
186179
case 'q':
187180
console.log('\n👋 Goodbye!');
188181
rl.close();
189-
return;
182+
process.exit(0);
190183
191184
case 'h':
192185
showMenu();
@@ -195,15 +188,15 @@ async function main() {
195188
case 'c':
196189
const customQuery = await prompt(rl, '\n💭 Enter your research question: ');
197190
if (customQuery) {
198-
await runAgent(customQuery);
191+
await runAgent(customQuery, rl);
199192
} else {
200193
console.log('❌ No research question provided.');
201194
}
202195
break;
203196
204197
default:
205198
if (presetQueries[choice as keyof typeof presetQueries]) {
206-
await runAgent(presetQueries[choice as keyof typeof presetQueries]);
199+
await runAgent(presetQueries[choice as keyof typeof presetQueries], rl);
207200
} else {
208201
console.log('❌ Invalid option. Please try again.');
209202
}

0 commit comments

Comments
 (0)