feat: add DocsGPT semantic search with backwards-compatible fallback#18
Open
critesjosh wants to merge 1 commit intomainfrom
Open
feat: add DocsGPT semantic search with backwards-compatible fallback#18critesjosh wants to merge 1 commit intomainfrom
critesjosh wants to merge 1 commit intomainfrom
Conversation
Integrate DocsGPT as an optional semantic search backend for documentation queries and error lookup fallback, activated when API_KEY is set. Preserves the existing ripgrep-based search as a fallback when DocsGPT is unavailable or unconfigured, ensuring no public-contract regression for existing callers. - Add DocsGPT HTTP client (src/backends/docsgpt-client.ts) - aztec_search_docs uses semantic search when API_KEY is configured, falls back to ripgrep on DocsGPT errors if local docs are cloned - aztec_lookup_error falls back to semantic doc search when static catalog produces no matches - Schema always advertises section/maxResults for backwards compat; descriptions clarify semantic-mode behavior - maxResults maps to chunks in semantic mode (chunks ?? maxResults ?? 5) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
aztec_search_docsandaztec_lookup_error, activated whenAPI_KEYis setsection/maxResults, and DocsGPT errors gracefully fall back to ripgrep over local docsaztec_lookup_errorgains a semantic fallback that searches documentation when the static error catalog has no matchesReview feedback addressed
sectionandmaxResultsare always present in the advertised schema regardless of DocsGPT config.maxResultsmaps tochunksin semantic mode (chunks ?? maxResults ?? 5). Schema descriptions clarify thatsectionapplies to local fallback only.Test plan
tsc --noEmitpassesvitest run tests/tools/search.test.ts— 19 tests pass, including:chunksparameter respectedmaxResultsused as fallback forchunksin semantic modechunkstakes precedence overmaxResultswhen both providedvitest run tests/utils/error-lookup.test.ts— 15 tests pass🤖 Generated with Claude Code