Skip to content

feat(deep-research): add image-processing reference skill - #285

Closed
zhongxuanwang-nv wants to merge 2 commits into
NVIDIA-AI-Blueprints:developfrom
zhongxuanwang-nv:feat/skills-ref-image-processing
Closed

feat(deep-research): add image-processing reference skill#285
zhongxuanwang-nv wants to merge 2 commits into
NVIDIA-AI-Blueprints:developfrom
zhongxuanwang-nv:feat/skills-ref-image-processing

Conversation

@zhongxuanwang-nv

@zhongxuanwang-nv zhongxuanwang-nv commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Overview

Adds the image-processing reference skill under the deep researcher's
research/ skill collection, completing SKILLS-REF-1's three named categories
(data analysis = data-table-analysis; chart generation = chart-generation, PR #280;
image processing = this PR).

A Pillow skill for metadata (dimensions/mode/format/size), format conversion,
resize/thumbnail, crop, rotate, grayscale, and basic color/brightness. It mirrors the
existing research/ skills: run in /workspace, then return text-survivable results
(JSON/Markdown metadata + an optional small base64 thumbnail) in the researcher's
ResearchNotes, which run_research_batch persists to /shared. Per research.py the
researcher must not call write_file, so the skill uses the return-in-ResearchNotes
pattern (consistent with the companion fix in #286).

Rebased onto develop after #284 restructured the skills layout
(research-sandbox/research/) and rewrote the runtime/test. Placed at
skills/research/image-processing/; no test change — the post-#284 test enumerates
only synthesis skills, so research skills are auto-discovered.

The sandbox has no network and no durable binary-artifact capture on develop, so outputs
are text. When #280's artifact runtime lands, the base64 thumbnail can move to
![](artifact://…).

Validation

$ uv run pytest tests/aiq_agent/agents/deep_researcher/test_deepagents_runtime.py -q
18 passed

All code examples are verified locally (Pillow 12.2.0): each of the four templates was
extracted from this SKILL.md and executed against a real test image, producing the
documented output — metadata, a 256px base64 thumbnail (aspect preserved), RGBA→JPEG
conversion, and color/brightness. The color template uses ImageStat rather than the deprecated getdata() (removed in
Pillow 14), and the metadata/preview templates apply ImageOps.exif_transpose so they
reflect displayed dimensions/orientation. Addresses the CodeRabbit review (EXIF
orientation; narrowed retry guidance so a missing library stops rather than retries).

  • I ran the relevant local checks or explained why they are not applicable.
  • I added or updated tests for behavior changes. (N/A — research skills are auto-discovered post-ux: improve clarity and use of skills and sandbox in config #284; the suite enumerates only synthesis skills. Discovery suite passes.)
  • I updated documentation for user-facing or contributor-facing changes.
  • I confirmed this PR does not include secrets, credentials, or internal-only data.
  • I certify this contribution under the DCO and signed my commits with git commit -s.

Where should reviewers start?

src/aiq_agent/agents/deep_researcher/skills/research/image-processing/SKILL.md — it mirrors
research/data-table-analysis/SKILL.md (the /workspace→return-in-ResearchNotes pattern).

Related Issues

Summary by CodeRabbit

  • Documentation
    • Added guidance for image processing workflows, including sandbox staging, a reproducible execution standard, and expected text-based outputs (optionally with a small thumbnail).
    • Documented supported image inspection and transformation operations (e.g., crop/rotate/grayscale/resize/format conversion) along with basic color/brightness analysis.
    • Included troubleshooting notes for common constraints like missing libraries, limited file access, no network fetching, and format-specific requirements (including JPEG alpha handling).

@copy-pr-bot

copy-pr-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Adds a new research skill document for image-processing that defines sandbox execution requirements, supported Pillow operations, example scripts, and troubleshooting guidance.

Changes

Image processing skill documentation

Layer / File(s) Summary
Skill metadata and execution standard
src/aiq_agent/agents/deep_researcher/skills/research/image-processing/SKILL.md
Frontmatter identifies the image-processing skill and documents the required /shared to /workspace staging flow, execute-based Pillow execution, and supported operations.
Templates and troubleshooting
src/aiq_agent/agents/deep_researcher/skills/research/image-processing/SKILL.md
Example scripts cover metadata inspection, thumbnail generation, format conversion, and brightness/color analysis; troubleshooting notes cover Pillow, network, /shared, binary outputs, and JPEG alpha handling.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commits, uses a valid lowercase type/scope, stays under 72 characters, and matches the image-processing skill addition.
Description check ✅ Passed The description includes all required sections and provides an overview, validation evidence, reviewer guidance, and related issues with only a non-critical test N/A note.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

Add the image-processing reference skill under the deep researcher's research/
skill collection (Pillow: metadata, format conversion, resize/thumbnail, crop,
rotate, grayscale, basic color/brightness), mirroring the existing research skills:
process in /workspace, then RETURN text-survivable results (JSON/Markdown metadata,
optional small base64 thumbnail) in the researcher's ResearchNotes, which
run_research_batch persists to /shared. The researcher must not call write_file
(research.py), so the skill uses the return-in-ResearchNotes pattern.

Rebased onto develop after NVIDIA-AI-Blueprints#284 restructured the skills layout (research-sandbox ->
research) and rewrote the runtime/test. Placed at skills/research/image-processing/;
no test change needed -- the post-NVIDIA-AI-Blueprints#284 test enumerates only synthesis skills, so
research skills (incl. this one) are auto-discovered.

Covers SKILLS-REF-1's image-processing category. No durable binary-artifact capture
on develop, so outputs are text.

Validation: uv run pytest
tests/aiq_agent/agents/deep_researcher/test_deepagents_runtime.py (18 passed).

Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
@zhongxuanwang-nv
zhongxuanwang-nv force-pushed the feat/skills-ref-image-processing branch from 4b40732 to a665e3c Compare June 25, 2026 02:11
@zhongxuanwang-nv
zhongxuanwang-nv marked this pull request as ready for review June 25, 2026 02:13

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/aiq_agent/agents/deep_researcher/skills/research/image-processing/SKILL.md`:
- Around line 31-32: Clarify the retry logic in the image-processing skill
around execute: when `execute` fails because Pillow is missing, treat that as a
sandbox limitation and stop instead of retrying, while only retrying `execute`
for fixable problems like an incorrect file path or unreadable/decode errors.
Update the guidance in SKILL.md near the `execute` and `ResearchNotes`
instructions so the distinction is explicit and the retry advice only applies to
recoverable file/input issues.
- Around line 45-64: The image metadata example in the Inspect Image Metadata
section should account for EXIF orientation when reporting dimensions. Update
the snippet around Image.open in the metadata example to either apply
ImageOps.exif_transpose before reading width and height, or include the EXIF
orientation value alongside the raw dimensions from im. Preserve the existing
meta structure in the Image/ImageOps example and make sure the displayed size
cannot be misreported for orientation-tagged photos.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 881e45a1-7644-4c60-abee-e9a85987a472

📥 Commits

Reviewing files that changed from the base of the PR and between 28ec6b9 and a665e3c.

📒 Files selected for processing (1)
  • src/aiq_agent/agents/deep_researcher/skills/research/image-processing/SKILL.md
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**

⚙️ CodeRabbit configuration file

**:

AI-Q Agent Guidance

Repository-global instructions for coding agents and for humans reviewing
agent-authored changes. These rules apply to every task in this repository.
Task-specific runbooks live in .agents/skills/ — load the
relevant skill before starting a workflow it covers.

Project overview

AI-Q is an NVIDIA AI Blueprint: an enterprise research agent built on the
NeMo Agent Toolkit (NAT). The deployed product is a research blueprint, not
a general skill runtime. New retrieval sources and tools are NAT functions;
agent behavior is driven by workflow YAML, Jinja2 prompts, and a data-source
registry — not by hard-coded logic.

Primary boundaries:

  • Backend Python package: src/aiq_agent/.
  • Data-source and tool packages: sources/ (each is its own package).
  • Frontends and tooling: frontends/ (web UI in frontends/ui/, eval harnesses
    in frontends/benchmarks/).
  • Configs, deployment, docs: configs/, deploy/, docs/.

Stay inside this repository. If your workspace also contains adjacent repos
(for example a sibling NeMo-Relay checkout), do not edit them as part of an AI-Q
change. Treat sources/* as independent packages: prefer the smallest change
scoped to the package you are touching.

Repository structure

Path Purpose
src/aiq_agent/ Backend agent, FastAPI extensions, auth, observability, knowledge
sources/ Data-source / tool packages (e.g. tavily_web_search, google_scholar_paper_search)
configs/ Workflow YAML configs (e.g. config_cli_default.yml)
frontends/ui/ Next.js / React / TypeScript / Tailwind / KUI web UI
frontends/benchmarks/ Eval harnesses: freshqa, deepsearch_qa, deepresearch_bench
deploy/ Docker Compose and Helm/Kubernetes assets; deploy/.env for secrets
docs/source/ ...

Files:

  • src/aiq_agent/agents/deep_researcher/skills/research/image-processing/SKILL.md
src/aiq_agent/agents/**/*

⚙️ CodeRabbit configuration file

src/aiq_agent/agents/**/*: Review agent changes for research workflow correctness, graph state transitions, prompt/tool contracts,
HITL behavior, and failure handling. Flag changes that weaken source attribution, report generation,
async cancellation, checkpointing, or data-source selection without focused tests and docs.

Files:

  • src/aiq_agent/agents/deep_researcher/skills/research/image-processing/SKILL.md

Comment thread src/aiq_agent/agents/deep_researcher/skills/research/image-processing/SKILL.md Outdated
Address CodeRabbit review on NVIDIA-AI-Blueprints#285:

- Template A (metadata) and Template B (thumbnail preview): apply
  ImageOps.exif_transpose so width/height and the preview reflect the *displayed*
  image (orientation-tagged photos store pixels rotated). Read .format before the
  transpose, since exif_transpose returns a new image with .format == None.
- Step 4 retry guidance: retry `execute` only for fixable errors (bad path,
  unreadable/decode); a missing library (e.g. Pillow) is reported as a sandbox
  limitation and stops -- matching the Troubleshooting bullet, no pointless retry.

Verified locally (Pillow 12.2.0) against an EXIF Orientation=6 image: all four
templates run, and metadata reports the displayed 200x300 (not the stored 300x200).

Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/aiq_agent/agents/deep_researcher/skills/research/image-processing/SKILL.md`:
- Around line 79-83: The PNG preview generation in
Image.open/ImageOps.exif_transpose currently converts everything to RGB, which
strips transparency from RGBA/P images. Update the image handling in this
snippet to preserve alpha when saving the inline PNG thumbnail, and only convert
to RGB in the JPEG path if needed, so the thumbnail preserves native
transparency correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 2459d8ee-84ae-4d6f-81c3-471ca348c809

📥 Commits

Reviewing files that changed from the base of the PR and between a665e3c and 907e2c2.

📒 Files selected for processing (1)
  • src/aiq_agent/agents/deep_researcher/skills/research/image-processing/SKILL.md
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**

⚙️ CodeRabbit configuration file

**:

AI-Q Agent Guidance

Repository-global instructions for coding agents and for humans reviewing
agent-authored changes. These rules apply to every task in this repository.
Task-specific runbooks live in .agents/skills/ — load the
relevant skill before starting a workflow it covers.

Project overview

AI-Q is an NVIDIA AI Blueprint: an enterprise research agent built on the
NeMo Agent Toolkit (NAT). The deployed product is a research blueprint, not
a general skill runtime. New retrieval sources and tools are NAT functions;
agent behavior is driven by workflow YAML, Jinja2 prompts, and a data-source
registry — not by hard-coded logic.

Primary boundaries:

  • Backend Python package: src/aiq_agent/.
  • Data-source and tool packages: sources/ (each is its own package).
  • Frontends and tooling: frontends/ (web UI in frontends/ui/, eval harnesses
    in frontends/benchmarks/).
  • Configs, deployment, docs: configs/, deploy/, docs/.

Stay inside this repository. If your workspace also contains adjacent repos
(for example a sibling NeMo-Relay checkout), do not edit them as part of an AI-Q
change. Treat sources/* as independent packages: prefer the smallest change
scoped to the package you are touching.

Repository structure

Path Purpose
src/aiq_agent/ Backend agent, FastAPI extensions, auth, observability, knowledge
sources/ Data-source / tool packages (e.g. tavily_web_search, google_scholar_paper_search)
configs/ Workflow YAML configs (e.g. config_cli_default.yml)
frontends/ui/ Next.js / React / TypeScript / Tailwind / KUI web UI
frontends/benchmarks/ Eval harnesses: freshqa, deepsearch_qa, deepresearch_bench
deploy/ Docker Compose and Helm/Kubernetes assets; deploy/.env for secrets
docs/source/ ...

Files:

  • src/aiq_agent/agents/deep_researcher/skills/research/image-processing/SKILL.md
src/aiq_agent/agents/**/*

⚙️ CodeRabbit configuration file

src/aiq_agent/agents/**/*: Review agent changes for research workflow correctness, graph state transitions, prompt/tool contracts,
HITL behavior, and failure handling. Flag changes that weaken source attribution, report generation,
async cancellation, checkpointing, or data-source selection without focused tests and docs.

Files:

  • src/aiq_agent/agents/deep_researcher/skills/research/image-processing/SKILL.md

cdgamarose-nv pushed a commit that referenced this pull request Jun 25, 2026
…ile (#286)

The researcher worker is instructed (research.py format_research_request): "Do not
call write_file or edit_file; run_research_batch will persist the returned
ResearchNotes under /shared/." But the research skills told the agent to persist
artifacts to /shared via write_file -- a contradicted instruction, since persistence
is automatic from the returned ResearchNotes.

Reword the persistence step in data-table-analysis, lightweight-calculation, and
forecast-analysis to: include the result in your returned ResearchNotes (e.g. a
ResearchFinding's evidence / narrative_notes); do not call write_file/edit_file. The
separate, correct rule that sandbox code uses /workspace and cannot touch /shared is
unchanged.

(image-processing carries the same fix in PR #285; chart-generation in PR #280 needs
it too -- flagged to its author.)

Validation: uv run pytest
tests/aiq_agent/agents/deep_researcher/test_deepagents_runtime.py (18 passed); grep
confirms write_file now appears only as "do not call write_file".

Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
@zhongxuanwang-nv

Copy link
Copy Markdown
Contributor Author

Closed per discussion in internal slack channel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant