@lazyingart/agintiflow 0.20.200 → 0.20.201

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/.env.example CHANGED
@@ -22,6 +22,8 @@ DEEPSEEK_API_KEY=
22
22
  OPENAI_API_KEY=
23
23
  AGINTI_ALLOW_HOSTED_IMAGE_PERCEPTION=false
24
24
  AGINTI_ALLOW_HOSTED_WEB_RESEARCH=false
25
+ AGINTI_WEB_SEARCH_PROVIDER=auto
26
+ # BRAVE_SEARCH_API_KEY=only_when_AGINTI_WEB_SEARCH_PROVIDER_is_brave
25
27
  AGINTI_ALLOW_HOSTED_JSON_SPECIALIST=false
26
28
  # A cross-provider writer needs both an explicit target and the permission below.
27
29
  AGINTI_WRITING_PROVIDER=
package/README.md CHANGED
@@ -54,7 +54,7 @@ Most agent tools are either a chat box with hidden state or an expensive one-mod
54
54
  | Disciplined by default | `AGINTI.md` starts with a behavior contract: surface ambiguity, keep edits surgical, avoid speculative complexity, verify outcomes, and respect permission blockers. |
55
55
  | Role-based models | Route, main, spare, wrapper, and auxiliary image roles are separate. LocalLLM supplies the default fast/deep lanes; DeepSeek, OpenAI, OpenRouter, Qwen, and Venice are optional explicit routes. |
56
56
  | Writing without agent noise | `writing_specialist` drafts novels, books, scripts, essays, and paper prose in an isolated writing-only context on the active provider. Cross-provider writing requires explicit permission; ambient keys and model arguments cannot silently switch a LocalLLM session to a hosted model. The main agent then handles files, formatting, citations, checks, and artifacts. |
57
- | Visual and web evidence | `read_image` uses the loopback LocalLLM vision model in local sessions and never falls through to a hosted provider. `web_research` saves sourced snippet artifacts for local synthesis. OpenAI perception/research and wrapper second opinions require explicit provider/tool permission. |
57
+ | Visual and web evidence | `read_image` keeps local pixels local. Fast search has provider fallback; exact page reads preserve hashes and metadata; `deep_research` adds resumable planning, parallel retrieval, exact-quote evidence, gap filling, synthesis, and citation auditing on the active provider. |
58
58
  | Scouts before big work | Parallel scouts can cheaply map architecture, tests, risks, symbols, and integration points before the main executor edits anything. |
59
59
  | SCS by default | Student-Committee-Supervisor mode adds a typed gate: committee drafts, student approves/monitors, supervisor executes. Use `/scs off` or `--no-scs` only when speed matters more than validation. |
60
60
  | AAPS for large workflows | AAPS describes top-down agentic pipeline scripts; AgInTiFlow can act as the interactive backend that validates, compiles, and executes those workflows. |
@@ -174,6 +174,7 @@ aginti --language de
174
174
  | Generate images | `/auxiliary image`, then ask for an image |
175
175
  | Read screenshots/images | `/image-read path/to/screenshot.png "what changed?"` |
176
176
  | Research with sources | `/web-research latest Android Gradle plugin official docs` |
177
+ | Run deep research | `/deep-research standard compare current research-agent citation methods` |
177
178
  | Enable research wrapper | `/research-wrapper gpt-5.4-mini medium` |
178
179
  | Resume current project | `aginti resume` (`1` is newest/latest; Space shows more) |
179
180
  | Browse all sessions | `aginti resume --all-sessions` |
@@ -256,7 +257,7 @@ The website keeps the visual walkthrough in a carousel so this README can stay f
256
257
  | Writing specialist | A dedicated writing-only LLM call for prose, chapters, scripts, books, essays, research-paper sections, and revisions, with formatter handoff notes for Markdown/LaTeX/Final Draft. |
257
258
  | Patch workflow | Codex-style patch envelopes, unified diffs, exact replacements, hashes, compact diffs, and path guardrails. |
258
259
  | Parallel scouts | Optional scout calls for architecture, implementation, review, tests, git flow, research, symbol tracing, and dependency risk. |
259
- | Image reading and web research | LocalLLM sessions send pixels only to the loopback vision endpoint. `web_research` preserves source lists for the active model to synthesize. Hosted OpenAI and wrapper paths are explicit opt-ins, never credential-driven fallbacks. |
260
+ | Image reading and web research | LocalLLM sessions keep pixels on the loopback vision endpoint. `web_search`, `read_web_page`, and `deep_research` provide fast discovery, exact source extraction, resumable evidence gathering, and claim-level citation audits. Hosted paths remain explicit opt-ins. |
260
261
  | SCS mode | Default Student-Committee-Supervisor quality gate with independent planning, execution, and validation roles. |
261
262
  | AAPS adapter | Optional `@lazyingart/aaps` integration for `.aaps` workflow init, validate, parse, compile, dry-run, and run commands. |
262
263
  | AgentLink | Local-first collaboration between AgInTi sessions through boards, typed messages, action contracts, safe summaries, and evidence bundles. |
@@ -404,6 +405,7 @@ More detail:
404
405
  - [docs/model-selection.md](docs/model-selection.md)
405
406
  - [docs/auxiliary-image-generation.md](docs/auxiliary-image-generation.md)
406
407
  - [docs/perception-and-web-research.md](docs/perception-and-web-research.md)
408
+ - [docs/deep-research-engine.md](docs/deep-research-engine.md)
407
409
  - [docs/cli-i18n.md](docs/cli-i18n.md)
408
410
  - [docs/skillmesh.md](docs/skillmesh.md)
409
411
 
@@ -420,6 +422,7 @@ More detail:
420
422
  | Runtime modes and autonomy | [docs/runtime-modes-and-autonomy.md](docs/runtime-modes-and-autonomy.md) |
421
423
  | Skills and tools | [docs/skills-and-tools.md](docs/skills-and-tools.md) |
422
424
  | Image reading and web research | [docs/perception-and-web-research.md](docs/perception-and-web-research.md) |
425
+ | Deep research engine | [docs/deep-research-engine.md](docs/deep-research-engine.md) |
423
426
  | Server-owned text-only fallback | [docs/safe-chat.md](docs/safe-chat.md) |
424
427
  | Skill Mesh | [docs/skillmesh.md](docs/skillmesh.md) |
425
428
  | Housekeeping logs | [docs/housekeeping.md](docs/housekeeping.md) |
@@ -0,0 +1,172 @@
1
+ # Deep Research Engine
2
+
3
+ AgInTiFlow has two deliberately different research paths:
4
+
5
+ - `web_search` is a fast lookup tool.
6
+ - `deep_research` is a bounded, resumable evidence workflow for questions that
7
+ need multiple sources, disagreement analysis, or a durable report.
8
+
9
+ Simple questions should stay on the fast path. A deep-research run spends more
10
+ queries and model calls only when breadth, verification, and traceability add
11
+ real value.
12
+
13
+ ## Architecture
14
+
15
+ The implementation follows the strongest production patterns without making
16
+ every query an unbounded agent swarm:
17
+
18
+ 1. **Plan**: the active provider decomposes the question into non-overlapping
19
+ subquestions, search queries, preferred source types, and exclusions.
20
+ 2. **Search**: queries run with bounded concurrency. The no-key default falls
21
+ back from DuckDuckGo HTML to Bing RSS. An explicitly configured Brave Search
22
+ route is optional. Multi-domain corpora receive separate bounded `site:`
23
+ queries matched to entity-specific subquestions instead of one fragile OR
24
+ expression.
25
+ 3. **Rank, diversify, and deduplicate**: canonical URLs remove tracking state;
26
+ primary, official, scholarly, and high-relevance results rank ahead of
27
+ summaries, while a bounded diversity penalty prevents one domain from
28
+ crowding every selected source.
29
+ 4. **Read exact sources**: `read_web_page` validates every redirect before the
30
+ next request, rejects private DNS resolutions, streams bounded bytes, strips
31
+ scripts/navigation, extracts article/main text and metadata, records hashes,
32
+ and marks all retrieved text as untrusted evidence.
33
+ 5. **Extract evidence**: isolated structured-output calls identify relevant
34
+ subquestions, claims, exact quotations, confidence, and limitations.
35
+ 6. **Verify**: deterministic code checks that quoted passages occur in the
36
+ exact retrieved source. Unverified quotations do not enter synthesis.
37
+ 7. **Fill gaps**: standard/deep runs may issue one bounded follow-up pass for
38
+ uncovered subquestions when query and source budgets remain.
39
+ 8. **Synthesize**: the active provider receives verified evidence rather than
40
+ arbitrary page text. Every substantive paragraph and finding carries source
41
+ IDs.
42
+ 9. **Audit**: deterministic code removes invented source IDs and unsupported
43
+ synthesis statements whose cited sources produced no verified evidence,
44
+ then reports claim, quotation, citation, question, domain, and
45
+ primary-source coverage.
46
+ 10. **Persist**: every stage checkpoints one JSON state file. The final cited
47
+ Markdown report is saved beside it and sent to the canvas.
48
+
49
+ This combines the orchestrator/worker and separate citation-pass lessons
50
+ described by [Anthropic's production research
51
+ system](https://www.anthropic.com/engineering/multi-agent-research-system)
52
+ with the iterative plan/search/read/gap/synthesize and background-resume model
53
+ documented for [Gemini Deep
54
+ Research](https://ai.google.dev/gemini-api/docs/deep-research). AgInTiFlow keeps
55
+ the fan-out explicitly bounded and stays on the active DeepSeek, LocalLLM, or
56
+ other selected provider.
57
+
58
+ ## Research Budgets
59
+
60
+ | Depth | Queries | Sources | Gap passes | Intended use |
61
+ | --- | ---: | ---: | ---: | --- |
62
+ | `quick` | 3 | 6 | 0 | Small comparison or source check |
63
+ | `standard` | 6 | 12 | 1 | Normal multi-source research |
64
+ | `deep` | 10 | 20 | 1 | Broad review, contested topic, or decision report |
65
+
66
+ The caller may reduce these budgets, but hard caps remain 12 queries and 24
67
+ sources. Search/page concurrency is bounded to six and defaults to three or
68
+ four.
69
+
70
+ ## Usage
71
+
72
+ Interactive:
73
+
74
+ ```text
75
+ /deep-research standard Compare current primary-source approaches to citation verification in research agents
76
+ /deep-research deep Review recent optical biosensing methods, emphasizing original papers and unresolved limitations
77
+ ```
78
+
79
+ An agent can call:
80
+
81
+ ```json
82
+ {
83
+ "query": "What evidence supports the current design choices?",
84
+ "depth": "standard",
85
+ "sourcePolicy": "primary",
86
+ "domains": ["docs.example.org", "arxiv.org"]
87
+ }
88
+ ```
89
+
90
+ To resume a partial or completed same-query run, pass the returned
91
+ `researchId`. A completed same-day run is returned from its checkpoint unless
92
+ `refresh=true` is explicit. A transient run that retrieved zero allowed sources
93
+ is marked failed, preserves its attempts, and retries retrieval on resume
94
+ instead of caching an empty report as success. Checkpoint schema changes
95
+ invalidate old cached runs automatically.
96
+
97
+ ## Artifacts
98
+
99
+ Each session stores:
100
+
101
+ ```text
102
+ artifacts/deep-research-RESEARCH_ID.json
103
+ artifacts/deep-research-RESEARCH_ID.md
104
+ ```
105
+
106
+ The JSON includes:
107
+
108
+ - objective, plan, query/source budgets, and source policy;
109
+ - every search attempt and provider failure/fallback;
110
+ - canonical source URLs, metadata, retrieval timestamps, and SHA-256 hashes;
111
+ - readable source text and ranked passages;
112
+ - extracted claims, exact quotations, limitations, and question mappings;
113
+ - missing questions, source diversity, and quote-verification rates;
114
+ - final synthesis and citation audit;
115
+ - stage/status fields used for crash-safe resume.
116
+
117
+ ## Search Providers
118
+
119
+ The default `auto` policy uses public no-key providers:
120
+
121
+ ```text
122
+ DuckDuckGo HTML -> Bing RSS
123
+ ```
124
+
125
+ For an explicitly configured Brave Search account:
126
+
127
+ ```bash
128
+ export AGINTI_WEB_SEARCH_PROVIDER=brave
129
+ export BRAVE_SEARCH_API_KEY=...
130
+ ```
131
+
132
+ An ambient key does not select Brave. The provider must be selected explicitly
133
+ through configuration or a tool argument.
134
+
135
+ ## Safety And Evidence Rules
136
+
137
+ - Only public HTTP/HTTPS URLs are accepted. Embedded credentials, single-label
138
+ internal hosts, loopback, RFC1918, link-local, multicast, `.local`, private
139
+ DNS resolutions, and redirected private targets are rejected before fetch.
140
+ - Domain allowlists and blocklists apply to search results, direct reads, and
141
+ redirect targets.
142
+ - Tracking parameters and fragments are removed before deduplication.
143
+ - Page bytes are bounded while streaming; extracted characters are bounded too.
144
+ - HTML scripts, forms, navigation, footers, and similar noise are removed.
145
+ - Retrieved text is always labeled untrusted and never treated as tool or agent
146
+ instructions.
147
+ - PDFs are hash-verified but not misrepresented as parsed by the dependency-free
148
+ page reader. A document/PDF tool remains responsible for full PDF extraction.
149
+ - Synthesis sees only verified evidence records. Unknown citation IDs and
150
+ citations to sources without verified evidence are removed and reported.
151
+ - Provider selection remains explicit. Deep research uses the active provider;
152
+ it does not silently escape LocalLLM or DeepSeek because another API key is
153
+ present.
154
+
155
+ ## Quality Signals
156
+
157
+ The report audit exposes evidence quality rather than hiding it behind fluent
158
+ prose:
159
+
160
+ - question coverage;
161
+ - readable source count;
162
+ - primary/scholarly source count;
163
+ - independent-domain count;
164
+ - exact-quote verification rate;
165
+ - statement-level citation coverage;
166
+ - unknown/invented citation IDs;
167
+ - unsupported synthesis statements removed before report rendering;
168
+ - contradictions, uncertainties, and unresolved questions.
169
+
170
+ These metrics are diagnostic gates, not a guarantee that a source is correct.
171
+ High-stakes work still requires domain review and, where appropriate, direct
172
+ inspection of the underlying paper, standard, dataset, or official record.
@@ -8,7 +8,9 @@ AgInTiFlow separates visual understanding, web search, and wrapper advice so eac
8
8
  | --- | --- | --- |
9
9
  | `read_image` | Read workspace screenshots, plots, scanned text, diagrams, or allowed remote image URLs. | Saves JSON and Markdown reports under `artifacts/perception/`, records image hashes, and sends the Markdown report to the canvas when used by an agent run. |
10
10
  | `web_search` | Cheap raw search snippets. | Returns compact titles, URLs, snippets, and fallback search URL. |
11
+ | `read_web_page` | Read one exact public source instead of relying on a snippet. | Returns bounded article text, metadata, canonical URL, relevant passages, retrieval time, and content hash. |
11
12
  | `web_research` | Sourced research unit for current or external information. | Saves `artifacts/research/*-web-research.json` with query, mode, source list, and answer. |
13
+ | `deep_research` | Plan, retrieve, verify, synthesize, and audit a genuinely multi-source question. | Saves resumable JSON state and a cited Markdown report with coverage metrics. |
12
14
  | `research_wrapper` | Read-only strict-JSON second opinion from the selected wrapper. | Saves `artifacts/wrappers/*-research-wrapper.json` with wrapper, model, reasoning, metadata, result, and raw fallback output. |
13
15
 
14
16
  ## Defaults
@@ -18,6 +20,8 @@ AgInTiFlow separates visual understanding, web search, and wrapper advice so eac
18
20
  - Codex image reading requires both `provider=codex` and explicitly enabled wrapper tools. It is not an automatic fallback.
19
21
  - OpenAI image reading defaults to `AGINTI_PERCEPTION_MODEL=gpt-5.4-mini` and `AGINTI_PERCEPTION_REASONING=medium`, with fallback models remaining inside the same explicitly selected OpenAI provider.
20
22
  - `web_research` defaults to lightweight snippet mode. The active LocalLLM can synthesize those returned snippets and sources during the next agent step without a second provider call.
23
+ - `web_search` automatically falls back from DuckDuckGo HTML to Bing RSS. Brave Search is available only when explicitly selected and configured.
24
+ - `deep_research` uses the active provider for planning, evidence extraction, and synthesis. It never treats another provider's ambient credentials as permission.
21
25
  - `web_research mode=openai` is accepted only for an active OpenAI session or when `allowHostedWebResearch=true`. A denied or failed hosted synthesis is returned with `ok=false`; any preserved snippets are labeled fallback evidence rather than hosted success.
22
26
  - `json_specialist` stays on the active provider. A different provider requires `allowHostedJsonSpecialist=true`; ambient hosted keys and model-generated provider arguments cannot escalate a LocalLLM session.
23
27
  - `research_wrapper` defaults to `AGINTI_RESEARCH_WRAPPER_MODEL=gpt-5.4-mini` and `AGINTI_RESEARCH_WRAPPER_REASONING=medium`.
@@ -30,6 +34,7 @@ AgInTiFlow separates visual understanding, web search, and wrapper advice so eac
30
34
  /image-read artifacts/screenshots/app.png what looks wrong?
31
35
  /image-read --codex artifacts/screenshots/app.png what looks wrong?
32
36
  /web-research latest Android Gradle plugin official docs
37
+ /deep-research standard compare current citation-verification methods using primary sources
33
38
  /research-wrapper gpt-5.4-mini medium
34
39
  /research-wrapper off
35
40
  ```
@@ -40,6 +45,8 @@ Use `read_image` when pixels matter. Do not guess from filenames or surrounding
40
45
 
41
46
  Use `web_research` when freshness, sources, package docs, standards, or current external information matter. Use `domains` to restrict research to official or primary sources.
42
47
 
48
+ Use `deep_research` when one lookup is insufficient: literature reviews, disputed claims, broad comparisons, technical decisions, or reports that require explicit coverage and citation auditing. See [Deep Research Engine](deep-research-engine.md).
49
+
43
50
  Use `research_wrapper` when a second model should cross-check image/web/research conclusions. The wrapper receives a strict JSON contract and should preserve uncertainty when it cannot directly inspect a source.
44
51
 
45
52
  ## Safety
@@ -47,6 +54,7 @@ Use `research_wrapper` when a second model should cross-check image/web/research
47
54
  - Local image paths must stay inside the workspace unless the run is explicitly trusted host mode.
48
55
  - `.env`, credential files, private keys, and secret-looking paths are blocked.
49
56
  - Remote images require web access and respect domain allowlists.
57
+ - Web page reads reject private/local network targets and private redirect destinations.
50
58
  - Images are capped at 10 MB and four inputs per call.
51
59
  - Artifacts preserve hashes and metadata but never store API keys.
52
60
  - Provider selection is credential-neutral: an ambient key authenticates only a backend that the run already selected and permitted.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazyingart/agintiflow",
3
- "version": "0.20.200",
3
+ "version": "0.20.201",
4
4
  "type": "module",
5
5
  "description": "AgInTiFlow is a project-aware agent workspace for hybrid wet-dry R&D, hardware-aware intelligence, software automation, and industrial workflows.",
6
6
  "license": "Apache-2.0",
@@ -92,6 +92,7 @@
92
92
  "scripts/smoke-model-roles.js",
93
93
  "scripts/smoke-platform.js",
94
94
  "scripts/smoke-perception-research.js",
95
+ "scripts/smoke-deep-research.js",
95
96
  "scripts/smoke-permission-modes.js",
96
97
  "scripts/smoke-public-research-wrapper.js",
97
98
  "scripts/smoke-safe-chat.js",
@@ -154,6 +155,7 @@
154
155
  "smoke:model-roles": "node scripts/smoke-model-roles.js",
155
156
  "smoke:platform": "node scripts/smoke-platform.js",
156
157
  "smoke:perception-research": "node scripts/smoke-perception-research.js",
158
+ "smoke:deep-research": "node scripts/smoke-deep-research.js",
157
159
  "smoke:permission-modes": "node scripts/smoke-permission-modes.js",
158
160
  "smoke:public-research": "node scripts/smoke-public-research-wrapper.js",
159
161
  "smoke:safe-chat": "node scripts/smoke-safe-chat.js",
@@ -175,7 +177,7 @@
175
177
  "storage:migrate": "node bin/aginti-cli.js storage migrate",
176
178
  "publish:env": "node scripts/npm-publish-from-env.js publish --access public",
177
179
  "publish:env:whoami": "node scripts/npm-publish-from-env.js whoami",
178
- "test": "npm run check && npm run smoke:localllm-provider && npm run smoke:localllm-model-tiers && npm run smoke:localllm-auto-max && npm run smoke:local-resource-policy && npm run smoke:context-budget-recovery && npm run smoke:session-runtime && npm run smoke:runtime-core && npm run smoke:progressive-tools && npm run smoke:truthful-completion && npm run smoke:writing-specialist-routing && npm run eval:local-first-agent && npm run eval:provider-attribution && npm run smoke:runtime-compat && npm run smoke:autoupdate && npm run smoke:web-api && npm run smoke:math-rendering && npm run smoke:web-ui && npm run smoke:web-autostart && npm run smoke:webapp-command && npm run smoke:web-port-fallback && npm run smoke:docker-command && npm run smoke:coding-tools && npm run smoke:dynamic-step-budget && npm run smoke:execution-policy && npm run smoke:aaps-adapter && npm run smoke:auxiliary-tools && npm run smoke:perception-research && npm run smoke:public-research && npm run smoke:safe-chat && npm run smoke:auth && npm run smoke:agentlink && npm run smoke:canvas-artifacts && npm run smoke:capabilities && npm run smoke:mcp && npm run smoke:model-roles && npm run smoke:platform && npm run smoke:permission-modes && npm run smoke:skills && npm run smoke:skillmesh && npm run smoke:tmux-tools && npm run smoke:long-jobs && npm run smoke:run-stdin && npm run smoke:cli-chat && npm run smoke:inbox",
180
+ "test": "npm run check && npm run smoke:localllm-provider && npm run smoke:localllm-model-tiers && npm run smoke:localllm-auto-max && npm run smoke:local-resource-policy && npm run smoke:context-budget-recovery && npm run smoke:session-runtime && npm run smoke:runtime-core && npm run smoke:progressive-tools && npm run smoke:truthful-completion && npm run smoke:writing-specialist-routing && npm run eval:local-first-agent && npm run eval:provider-attribution && npm run smoke:runtime-compat && npm run smoke:autoupdate && npm run smoke:web-api && npm run smoke:math-rendering && npm run smoke:web-ui && npm run smoke:web-autostart && npm run smoke:webapp-command && npm run smoke:web-port-fallback && npm run smoke:docker-command && npm run smoke:coding-tools && npm run smoke:dynamic-step-budget && npm run smoke:execution-policy && npm run smoke:aaps-adapter && npm run smoke:auxiliary-tools && npm run smoke:perception-research && npm run smoke:deep-research && npm run smoke:public-research && npm run smoke:safe-chat && npm run smoke:auth && npm run smoke:agentlink && npm run smoke:canvas-artifacts && npm run smoke:capabilities && npm run smoke:mcp && npm run smoke:model-roles && npm run smoke:platform && npm run smoke:permission-modes && npm run smoke:skills && npm run smoke:skillmesh && npm run smoke:tmux-tools && npm run smoke:long-jobs && npm run smoke:run-stdin && npm run smoke:cli-chat && npm run smoke:inbox",
179
181
  "pack:dry-run": "npm pack --dry-run",
180
182
  "smoke:capabilities": "node scripts/smoke-capabilities.js"
181
183
  },