@apmantza/greedysearch-pi 1.4.0 → 1.4.1

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.
@@ -1,145 +1,145 @@
1
- ---
2
- name: greedy-search
3
- description: Multi-engine AI web search — greedy_search, deep_research, and coding_task. Use for high-quality research where training data may be stale or single-engine results are insufficient.
4
- ---
5
-
6
- # GreedySearch Tools
7
-
8
- ## Tool Overview
9
-
10
- | Tool | Speed | Use for |
11
- |------|-------|---------|
12
- | `greedy_search` | 15-90s | Quick lookups, comparisons, debugging errors |
13
- | `deep_research` | 60-120s | Architecture decisions, thorough research, source-backed answers |
14
- | `coding_task` | 60-180s | Second opinions on code, reviews, debugging tricky issues |
15
-
16
- ## When to Use Which
17
-
18
- - **`greedy_search`** — Default. Fast enough for most things. Use when you need current info.
19
- - **`deep_research`** — When the answer *matters*. Gives you a structured document with confidence scores, deduplicated sources ranked by consensus, Gemini synthesis, AND actual content from top sources.
20
- - **`coding_task`** — When you need a "second opinion" on hard problems. Best for `debug` and `plan` modes on tricky issues.
21
-
22
- ---
23
-
24
- # greedy_search
25
-
26
- Multi-engine AI web search with streaming progress.
27
-
28
- ```greedy_search({ query: "what changed in React 19", engine: "all" })```
29
-
30
- | Parameter | Type | Default | Description |
31
- |-----------|------|---------|-------------|
32
- | `query` | string | required | The search question |
33
- | `engine` | string | `"all"` | `all`, `perplexity`, `bing`, `google`, `gemini` |
34
- | `synthesize` | boolean | `false` | Synthesize via Gemini |
35
- | `fullAnswer` | boolean | `false` | Complete answer vs ~300 char summary |
36
-
37
- **When to use:** Quick lookups, error messages, comparing tools, "what's new in X".
38
-
39
- ---
40
-
41
- # deep_research
42
-
43
- Comprehensive research with source fetching and synthesis. Returns a structured document.
44
-
45
- ```deep_research({ query: "RAG vs fine-tuning for production" })```
46
-
47
- Returns:
48
- - Full answers from all 3 engines (Perplexity, Bing, Google)
49
- - Gemini synthesis combining all perspectives
50
- - Deduplicated sources ranked by consensus (3/3 > 2/3 > 1/3)
51
- - Fetched content from top 5 sources (no CDP — uses native fetch)
52
- - Confidence metadata (which engines responded, consensus score)
53
-
54
- **When to use:** Architecture decisions, "which library should I use", research for a writeup, anything where you need source-backed confidence.
55
-
56
- ---
57
-
58
- # coding_task
59
-
60
- Browser-based coding assistant using Gemini and/or Copilot.
61
-
62
- ```coding_task({ task: "debug this race condition", mode: "debug", engine: "all" })```
63
-
64
- | Parameter | Type | Default | Description |
65
- |-----------|------|---------|-------------|
66
- | `task` | string | required | The coding task/question |
67
- | `engine` | string | `"gemini"` | `gemini`, `copilot`, or `all` |
68
- | `mode` | string | `"code"` | See modes below |
69
- | `context` | string | — | Code snippet to include |
70
-
71
- **Modes:**
72
-
73
- | Mode | Use when |
74
- |------|----------|
75
- | `debug` | Stuck on a tricky bug. Fresh eyes catch different failure modes. |
76
- | `plan` | About to refactor something big. Gemini plays devil's advocate. |
77
- | `review` | Code review before merge. High-stakes code benefits from second opinion. |
78
- | `test` | Need edge cases the author missed. |
79
- | `code` | Just need the code written (but you can probably do this yourself faster). |
80
-
81
- **When to use:** Debugging tricky issues, planning major refactors, security-critical reviews. **Skip for** simple code generation — you're faster.
82
-
83
- ## Greedy Search vs Built-in Web Search
84
-
85
- | | `web_search` | `greedy_search` |
86
- |---|---|---|
87
- | Speed | Instant (~2s) | 15-60s (one engine) / 30-90s (all engines) |
88
- | Quality | Good for simple lookups | Higher — 3 AI engines cross-verify |
89
- | Synthesis | Single engine answer | Optional Gemini synthesis (cleanest answer) |
90
- | Use for | Quick facts, simple questions | Research, decisions, complex topics |
91
-
92
- **Rule of thumb:** Use `web_search` for quick facts. Use `greedy_search` when the answer matters — architecture decisions, comparing libraries, understanding new releases, debugging tricky errors.
93
-
94
- ## When to Use
95
-
96
- - **Version-specific changes** — "What changed in React 19?" / "Breaking changes in FastAPI 0.100"
97
- - **Choosing between tools** — "Prisma vs Drizzle in 2026" / "Best auth library for Next.js 15"
98
- - **Debugging** — User pastes an error message or stack trace
99
- - **Research tasks** — When you need to synthesize information from multiple sources
100
- - **Best practices** — "How to structure a monorepo" / "Auth patterns for SaaS"
101
- - **Anything where training data might be stale** — 2025+, 2026+, "latest", "current", "still maintained"
102
-
103
- ## Engine Selection
104
-
105
- ```greedy_search({ query: "what changed in React 19", engine: "all" })```
106
-
107
- | Engine | Latency | Best for |
108
- |---|---|---|
109
- | `all` (default) | 30-90s | Highest confidence — all 3 engines in parallel |
110
- | `perplexity` | 15-30s | Technical Q&A, code explanations, documentation |
111
- | `bing` | 15-30s | Recent news, Microsoft ecosystem |
112
- | `google` | 15-30s | Broad coverage, multiple perspectives |
113
- | `gemini` | 15-30s | Google's perspective, different training data |
114
-
115
- Use a single engine when speed matters and the question isn't contentious.
116
-
117
- ## Synthesis Mode
118
-
119
- For complex research questions, use `synthesize: true` with `engine: "all"`:
120
-
121
- ```greedy_search({ query: "best auth patterns for SaaS in 2026", engine: "all", synthesize: true })```
122
-
123
- This deduplicates sources across engines and feeds them to Gemini for one clean, synthesized answer. Adds ~30s but produces the highest quality output — ideal for research tasks where you'd otherwise need to parse 3 separate answers.
124
-
125
- Use synthesis when:
126
- - You need one definitive answer, not multiple perspectives
127
- - You're researching a topic to write about or make a decision
128
- - The question has a lot of noise and you want the signal
129
-
130
- Skip synthesis when:
131
- - You want to see where engines disagree (useful for controversial topics)
132
- - Speed matters
133
-
134
- ## Full vs Short Answers
135
-
136
- Default mode returns ~300 char summaries to save tokens. Use `fullAnswer: true` when you need the complete response:
137
-
138
- ```greedy_search({ query: "explain the React compiler", engine: "perplexity", fullAnswer: true })```
139
-
140
- ## Interpreting Results
141
-
142
- - **All 3 agree** → High confidence, present as fact
143
- - **2 agree, 1 differs** → Likely correct but note the dissent
144
- - **All differ** → Present the different perspectives to the user
145
- - **Sources with `[3/3]` or `[2/3]`** → Cited by multiple engines, higher confidence
1
+ ---
2
+ name: greedy-search
3
+ description: Multi-engine AI web search — greedy_search, deep_research, and coding_task. Use for high-quality research where training data may be stale or single-engine results are insufficient.
4
+ ---
5
+
6
+ # GreedySearch Tools
7
+
8
+ ## Tool Overview
9
+
10
+ | Tool | Speed | Use for |
11
+ |------|-------|---------|
12
+ | `greedy_search` | 15-90s | Quick lookups, comparisons, debugging errors |
13
+ | `deep_research` | 60-120s | Architecture decisions, thorough research, source-backed answers |
14
+ | `coding_task` | 60-180s | Second opinions on code, reviews, debugging tricky issues |
15
+
16
+ ## When to Use Which
17
+
18
+ - **`greedy_search`** — Default. Fast enough for most things. Use when you need current info.
19
+ - **`deep_research`** — When the answer *matters*. Gives you a structured document with confidence scores, deduplicated sources ranked by consensus, Gemini synthesis, AND actual content from top sources.
20
+ - **`coding_task`** — When you need a "second opinion" on hard problems. Best for `debug` and `plan` modes on tricky issues.
21
+
22
+ ---
23
+
24
+ # greedy_search
25
+
26
+ Multi-engine AI web search with streaming progress.
27
+
28
+ ```greedy_search({ query: "what changed in React 19", engine: "all" })```
29
+
30
+ | Parameter | Type | Default | Description |
31
+ |-----------|------|---------|-------------|
32
+ | `query` | string | required | The search question |
33
+ | `engine` | string | `"all"` | `all`, `perplexity`, `bing`, `google`, `gemini` |
34
+ | `synthesize` | boolean | `false` | Synthesize via Gemini |
35
+ | `fullAnswer` | boolean | `false` | Complete answer vs ~300 char summary |
36
+
37
+ **When to use:** Quick lookups, error messages, comparing tools, "what's new in X".
38
+
39
+ ---
40
+
41
+ # deep_research
42
+
43
+ Comprehensive research with source fetching and synthesis. Returns a structured document.
44
+
45
+ ```deep_research({ query: "RAG vs fine-tuning for production" })```
46
+
47
+ Returns:
48
+ - Full answers from all 3 engines (Perplexity, Bing, Google)
49
+ - Gemini synthesis combining all perspectives
50
+ - Deduplicated sources ranked by consensus (3/3 > 2/3 > 1/3)
51
+ - Fetched content from top 5 sources (no CDP — uses native fetch)
52
+ - Confidence metadata (which engines responded, consensus score)
53
+
54
+ **When to use:** Architecture decisions, "which library should I use", research for a writeup, anything where you need source-backed confidence.
55
+
56
+ ---
57
+
58
+ # coding_task
59
+
60
+ Browser-based coding assistant using Gemini and/or Copilot.
61
+
62
+ ```coding_task({ task: "debug this race condition", mode: "debug", engine: "all" })```
63
+
64
+ | Parameter | Type | Default | Description |
65
+ |-----------|------|---------|-------------|
66
+ | `task` | string | required | The coding task/question |
67
+ | `engine` | string | `"gemini"` | `gemini`, `copilot`, or `all` |
68
+ | `mode` | string | `"code"` | See modes below |
69
+ | `context` | string | — | Code snippet to include |
70
+
71
+ **Modes:**
72
+
73
+ | Mode | Use when |
74
+ |------|----------|
75
+ | `debug` | Stuck on a tricky bug. Fresh eyes catch different failure modes. |
76
+ | `plan` | About to refactor something big. Gemini plays devil's advocate. |
77
+ | `review` | Code review before merge. High-stakes code benefits from second opinion. |
78
+ | `test` | Need edge cases the author missed. |
79
+ | `code` | Just need the code written (but you can probably do this yourself faster). |
80
+
81
+ **When to use:** Debugging tricky issues, planning major refactors, security-critical reviews. **Skip for** simple code generation — you're faster.
82
+
83
+ ## Greedy Search vs Built-in Web Search
84
+
85
+ | | `web_search` | `greedy_search` |
86
+ |---|---|---|
87
+ | Speed | Instant (~2s) | 15-60s (one engine) / 30-90s (all engines) |
88
+ | Quality | Good for simple lookups | Higher — 3 AI engines cross-verify |
89
+ | Synthesis | Single engine answer | Optional Gemini synthesis (cleanest answer) |
90
+ | Use for | Quick facts, simple questions | Research, decisions, complex topics |
91
+
92
+ **Rule of thumb:** Use `web_search` for quick facts. Use `greedy_search` when the answer matters — architecture decisions, comparing libraries, understanding new releases, debugging tricky errors.
93
+
94
+ ## When to Use
95
+
96
+ - **Version-specific changes** — "What changed in React 19?" / "Breaking changes in FastAPI 0.100"
97
+ - **Choosing between tools** — "Prisma vs Drizzle in 2026" / "Best auth library for Next.js 15"
98
+ - **Debugging** — User pastes an error message or stack trace
99
+ - **Research tasks** — When you need to synthesize information from multiple sources
100
+ - **Best practices** — "How to structure a monorepo" / "Auth patterns for SaaS"
101
+ - **Anything where training data might be stale** — 2025+, 2026+, "latest", "current", "still maintained"
102
+
103
+ ## Engine Selection
104
+
105
+ ```greedy_search({ query: "what changed in React 19", engine: "all" })```
106
+
107
+ | Engine | Latency | Best for |
108
+ |---|---|---|
109
+ | `all` (default) | 30-90s | Highest confidence — all 3 engines in parallel |
110
+ | `perplexity` | 15-30s | Technical Q&A, code explanations, documentation |
111
+ | `bing` | 15-30s | Recent news, Microsoft ecosystem |
112
+ | `google` | 15-30s | Broad coverage, multiple perspectives |
113
+ | `gemini` | 15-30s | Google's perspective, different training data |
114
+
115
+ Use a single engine when speed matters and the question isn't contentious.
116
+
117
+ ## Synthesis Mode
118
+
119
+ For complex research questions, use `synthesize: true` with `engine: "all"`:
120
+
121
+ ```greedy_search({ query: "best auth patterns for SaaS in 2026", engine: "all", synthesize: true })```
122
+
123
+ This deduplicates sources across engines and feeds them to Gemini for one clean, synthesized answer. Adds ~30s but produces the highest quality output — ideal for research tasks where you'd otherwise need to parse 3 separate answers.
124
+
125
+ Use synthesis when:
126
+ - You need one definitive answer, not multiple perspectives
127
+ - You're researching a topic to write about or make a decision
128
+ - The question has a lot of noise and you want the signal
129
+
130
+ Skip synthesis when:
131
+ - You want to see where engines disagree (useful for controversial topics)
132
+ - Speed matters
133
+
134
+ ## Full vs Short Answers
135
+
136
+ Default mode returns ~300 char summaries to save tokens. Use `fullAnswer: true` when you need the complete response:
137
+
138
+ ```greedy_search({ query: "explain the React compiler", engine: "perplexity", fullAnswer: true })```
139
+
140
+ ## Interpreting Results
141
+
142
+ - **All 3 agree** → High confidence, present as fact
143
+ - **2 agree, 1 differs** → Likely correct but note the dissent
144
+ - **All differ** → Present the different perspectives to the user
145
+ - **Sources with `[3/3]` or `[2/3]`** → Cited by multiple engines, higher confidence