feat(search): add opt-in Parallel Search MCP fallback - #418
Open
georgeatparallel wants to merge 1 commit into
Open
georgeatparallel wants to merge 1 commit into
georgeatparallel wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
Problem
PentAGI users can already search without a key through DuckDuckGo. This adds another free option for public-web research: explicitly enabled Parallel Search MCP, with source excerpts and citations, through the existing search interface.
As of September 14, Artificial Analysis reports Parallel Fast at 80 DeepSearchQA F1, compared with 74 for Tavily basic and Firecrawl (research results). DeepSearchQA tests whether an agent can gather a complete, precise answer across many searches. Its time per task chart shows 18.8s for Fast, versus 45.0s for Tavily basic and 62.2s for Firecrawl, about 58% and 70% less time. That metric combines derived model time with measured search time. These are provider benchmark settings, not measurements of this PentAGI integration; PentAGI currently uses Tavily advanced. The free anonymous MCP path uses Fast.
Solution
Adds a
Searcheradapter using the official MCP Go SDK and PentAGI's HTTP client settings. SetPARALLEL_SEARCH_ENABLED=truein.envor enable it in the installer's Search Engines form. It defaults tofalseand runs after existing engines in links, answer, and research modes. Existing priorities, DuckDuckGo's enabled default, exploit routing, and browser fetching remain in place.The adapter discovers and calls only
web_search, preserves source URLs, excerpts, dates and warnings, and enforcesmax_resultslocally. It handles HTTP, RPC and tool errors through the existing retry/fallback interface. The installer supports save, reset, status, configured count, and restart handling. A migration and regenerated database enum let search logs attribute the winning engine toparallel.Related issue: none. This is a provider addition through the existing interface.
Type of Change
Areas Affected
Testing and Verification
Test Configuration
Test Steps
From
backend/:CGO_ENABLED=0 go test -timeout=4m ./pkg/tools/searchers ./pkg/tools ./pkg/config ./cmd/installer/wizard/models ./pkg/server/models github.com/golang-jwt/jwt/v5CGO_ENABLED=0 go vet ./pkg/tools/searchers ./pkg/tools ./pkg/config ./cmd/installer/wizard/controller ./cmd/installer/wizard/models ./pkg/server/models ./pkg/server/auth ./pkg/server/servicesCGO_ENABLED=0 go build ./cmd/pentagi ./cmd/installerDATABASE_URL=<disposable connection> sqlc generate -f sqlc/sqlc.yml.tools.NewWebSearchToolwith a public documentation query.Test Results
Affected suites, vet, and both binary builds pass. Fixtures exercise the actual provider and SDK through the fixed endpoint using the existing proxy/CA path. They cover paginated discovery, repeated project attribution, no auth, structured and text results, errors, bounds, cancellation, redirects, and an SSE response held open until the call returns. Installer and orchestration tests cover persistence, reset, disabled defaults, preserved routing, and audit attribution.
A live call through
tools.NewWebSearchTool, with no Parallel key and the other engines disabled, returned useful official documentation URLs and captured exactly oneparallelsearch-log attribution. PostgreSQL checks verified upgrade and rollback behavior, including refusal to relabel historical Parallel logs. SQLC regenerated only the intended enum addition.Lint was compared with the unmodified baseline using the CI version, 2.12.2, over the affected scopes with diagnostic limits removed. Both report the same 491 existing issues; this change introduces none. The full test suite was not run. Full auth/service tests cannot run locally with CGO disabled because their SQLite fixtures require it; enabling CGO reproduces the same pre-test Apple CPU initialization crash on the baseline. The auth key tests pass without CGO, and the upgraded JWT library's tests pass.
Security Considerations
Once enabled, agents may send their search query to
https://search.parallel.ai/mcpas the objective and query. No Parallel authentication or other provider keys are forwarded. Requests carrypentagi/<binary-version>in the User-Agent so Parallel can measure aggregate free MCP usage. Optional conversation and model metadata are omitted because the host search interface does not expose them. Outbound project attribution is tested; warehouse analytics were not checked.The adapter keeps PentAGI's proxy, CA, TLS and timeout settings. Redirects are rejected. Responses are capped at 2 MiB and formatted output at 32 KiB, with a truncation notice. Unsupported exploit controls are rejected before dispatch. Free access is rate limited and subject to Parallel's published terms and privacy policy.
Adds
github.com/modelcontextprotocol/go-sdkv1.8.0 and its required dependencies. Its minimum versions raise JWT to v5.3.1 andgolang.org/x/timeto v0.15.0. The repository's license inventory script ran and the added modules' license files were inspected; the optional detailed license scanner was unavailable.Performance Impact
There is no Parallel network traffic while disabled or when an earlier engine succeeds. A Parallel attempt establishes an MCP session, discovers the search tool, and invokes it. A positive
HTTP_CLIENT_TIMEOUTbounds the whole operation; zero preserves unlimited timeout and caller cancellation. Cleanup is best effort. No end-to-end PentAGI latency benchmark was run.Documentation Updates
.env.example, installer help, and installation/configuration guideDeployment Notes
Upgrade the backend so the search-engine migration runs before enabling the provider.
PARALLEL_SEARCH_ENABLED=falseis passed through Compose by default. Enabling or disabling it through the installer requires applying the restart change. Downgrade is refused while historical Parallel search logs exist, preserving their attribution.Checklist
Code Quality
go fmtandgo vetpnpm run lint: no TypeScript/JavaScript changesSecurity
Compatibility
Documentation
Additional Notes
I work at Parallel, which operates this service. This gives PentAGI a reviewable, opt-in research fallback while preserving existing operator choices.