Add Markdown AI Mode search with downstream extraction - #1188
Merged
Merged
Conversation
21 tasks
6 of 9 tasks
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.
Linked issue
Closes #1073. Supersedes #1138 with the Markdown retrieval design.
What changes
Google AI Mode answers vary between headings, paragraphs, nested lists and tables. This implementation retrieves the answer as Markdown and moves product-specific interpretation into a subsequent
extract.aistep.search.ai_moderequests SerpAPIoutput=md. One output contains the original Markdown body; an optional second output contains parsed frontmatter and request/status metadata. Blank queries skip the provider, and failed or empty answers are reported explicitly.standardize.cleanadds opt-in Unicode-escape and simple LaTeX cleanup. The trial then removes the exact Google viewer-dialog instruction from Markdown link labels before extraction, preserving product wording, destinations and raw evidence. Shared content/source helpers validate extracted source associations. The known-glitch notes document recurrence checks.merge.to_dict, and usesextract.aifor Product Description, Match Confidence, Specifications, references and Pricing. Offers carry price, currency, unit of measure, source and reference IDs.tests/fixtures/search_ai_mode/. Generated captures and workbooks stay in ignored.data/.See the design findings and usage guide and fixture instructions. The separate AI Overview research note preserves the two-request probe, source limitations and proposed follow-up. AI Overview implementation remains deferred.
How it was verified
tests/test_search-ai_mode.py,tests/test_search_ai_extraction.pyandtests/test_standardize_clean_markup.py. Coverage includes the reported Renold link-label artifact, preserved URLs/code/prices/raw evidence, cleaned model input, stable replay, transport and source validation.reconstructed_markdownafter excluding frontmatter and surrounding whitespace.gpt-5.6-lunawith low reasoning exercised all three samples; the Belden mismatch was classified Uncertain.git diff --checkpassed. The viewer-label repair was verified offline without new live provider/model calls. Full CI and deployment validation are not claimed.Compatibility and risk
This replaces the experimental compact/complete/Markdown AI Mode contract. Recipes must use Markdown plus optional metadata and perform semantic extraction downstream; the guide documents removed AI Mode arguments. Review the shared search exports, formatting, URL-cleaning and nullable-definition changes alongside the new wrangle.
Markdown simplifies the pipeline; it does not improve source coverage or guarantee browser-equivalent answers. Semantic extraction remains model-dependent. Live trials require existing SerpAPI and OpenAI credentials and incur provider usage; no credentials or raw trial exports are committed. Rollback is to revert the feature merge and use the prior recipe/API contract.
Ready-for-review checklist
mainand has no merge conflictsSee the pull request workflow.