Skip to content

Add Parallel research subagent to Pi - #41

Open
georgeatparallel wants to merge 3 commits into
mainfrom
agent/add-parallel-research-subagent
Open

Add Parallel research subagent to Pi#41
georgeatparallel wants to merge 3 commits into
mainfrom
agent/add-parallel-research-subagent

Conversation

@georgeatparallel

@georgeatparallel georgeatparallel commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Why this exists

Parallel is building the Responses API to give AI agents a simple way to hand off web research. You send it a question, Parallel does the research, and you get back a finished answer with sources.

That maps naturally to a subagent. Instead of giving a model a search tool and asking it to assemble the answer itself, Pi can hand the whole research task to Parallel and use the cited result like any other child agent output.

What you get

This PR adds a parallel-research agent to the existing @parallel-web/pi-extension package.

You can run it directly with pi-subagents:

/run parallel-research Compare Node and Bun's current JavaScript runtime compatibility. Cite primary sources.

You can also call it from pi-subagents' JavaScript code mode. The research answer comes back in result.output, so your workflow can read it, branch on it, or pass it to another step.

After this version is published, install it with:

pi install npm:pi-subagents
pi install npm:@parallel-web/pi-extension

Then run /login parallel inside Pi and start a parallel-research child.

How it works

  1. pi-subagents starts a normal child agent.
  2. The child uses the new parallel/research model.
  3. The extension sends the task to POST /v1/responses.
  4. Parallel returns the finished research answer and citations as the child's normal text output.

It makes one Responses API call. There is no second model call, search loop, background job, or automatic retry. Pi still owns child orchestration, concurrency, waiting, artifacts, cancellation, and JavaScript branching.

By default, the request contains only the packaged research instructions and the latest text task. It does not send parent history, local files, environment variables, tools, session state, or worktree data.

Why this shape

The Responses API already returns the final cited research answer. Treating it as the subagent itself keeps the integration small, makes cost predictable, and avoids wrapping it in another model.

This is different from the DeepSeek integration in this repo. That package gives DeepSeek raw search results. This one gives Pi a finished research result that behaves like a native child agent.

What we tested

We tested this the way you would actually use it:

  1. Started a fresh, isolated Pi 0.84.2 install.
  2. Installed pi-subagents 0.50.0 through Pi.
  3. Packed this PR's @parallel-web/pi-extension 1.2.0 artifact and installed that exact package.
  4. Completed a fresh Parallel OAuth login with /login parallel.
  5. Ran one real query with /run parallel-research.
  6. Ran a second real query through a pi-subagents prompt workflow.

Both research calls succeeded. Each used one child turn, zero tools, no worktree, no retry, and no second synthesis model. Both returned cited answers whose source URLs resolved successfully. The two medium Responses calls cost $0.05 each, for $0.10 total.

The live run used the packed Responses implementation at commit 52619e5. The only later commit changes auth guidance and its tests, not research execution.

We also confirmed the correct Pi auth behavior while running it:

  • Use /parallel-login to check Parallel auth inside Pi.
  • Use /logout and select Parallel to remove a stored credential.
  • Standalone pi auth check does not discover extension-provided providers.
  • Pi logout does not remove PARALLEL_API_KEY from your environment.

The README and status messages now reflect those behaviors.

Validation

  • 41 pi-extension tests pass, including 14 Responses contract tests
  • package typecheck, formatting, lint, build, and artifact checks pass
  • clean-room package and agent discovery through pi-subagents 0.50.0 passes
  • all GitHub CI checks pass

What remains

  • A public npm install can only be tested after this version is published. The pre-release test installed the exact packed artifact instead.
  • We did not spend a third live call solely to exercise a JavaScript if branch. Both live paths returned the ordinary child output used by code mode, and credential-free tests cover that mapping.

Release

This PR keeps @parallel-web/pi-extension at version 1.2.0. After it merges, the normal release PR will publish the updated package.

@georgeatparallel
georgeatparallel marked this pull request as ready for review August 18, 2026 16:53
@georgeatparallel
georgeatparallel requested a review from a team August 18, 2026 16:53
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