Searches the web for your question, reads the top results, and writes a Google Doc brief citing every source it used.

UsesGoogle DocsOpenAITavily

Research a question into a sourced brief

Type in a question and run it. The web is searched for it, the top results are read one at a time, and the AI writes a short brief from that text alone, with every claim followed by the number of its source. The brief is saved as a new Google Doc.

The document holds your question, what the sources say with numbered markers in the prose, a numbered list of every source with its link, and a closing line saying how many of the results found were actually used. Nothing enters the brief without a page behind it: the search engine's own answer is never requested, and the AI is told to say plainly when the sources do not answer the question rather than filling the gap from memory. If the search finds nothing, or none of the pages can be read, the run stops and says so instead of producing a confident write-up. A page that will not load is skipped and reported, the number of pages read per run is capped, and a new document is created each run, so nothing you already have is overwritten.

ValuesSet researchQuestion to blank.Set researchQuestion to blank.
ValuesSet maxSearchResults to 8.Set maxSearchResults to 8.
ValuesSet maxSourcesToRead to 4.Set maxSourcesToRead to 4.
ValuesSet charactersPerSource to 6000.Set charactersPerSource to 6000.
TavilyTavilySearch the web for researchQuestion. Save it as searchResponse.Search the web for researchQuestion. Save it as searchResponse. Number of results: maxSearchResults
ValuesSet searchResults to searchResponse.results.Set searchResults to searchResponse.results.
ListsCount the items in searchResults and save it as resultsFound.Count the items in searchResults and save it as resultsFound.
Decisions & LoopsIf resultsFound is 0If resultsFound is 0
Yes
Decisions & LoopsStop and report a problem: The web search found no pages for '@researchQuestion'. Nothing has been written up, because a brief with no sources behind it is not research. Reword the question in the 'researchQuestion' step and run it again.Stop and report a problem: The web search found no pages for '@researchQuestion'. Nothing has been written up, because a brief with no sources behind it is not research. Reword the question in the 'researchQuestion' step and run it again.
No
No steps
ValuesSet sourceExtracts to an empty list.Set sourceExtracts to an empty list.
ValuesSet sourceList to an empty list.Set sourceList to an empty list.
ValuesSet sourcesRead to 0.Set sourcesRead to 0.
ValuesSet resultsSkipped to 0.Set resultsSkipped to 0.
Decisions & LoopsFor each result in searchResults:For each result in searchResults:
Decisions & LoopsIf sourcesRead is greater than or equal to maxSourcesToReadIf sourcesRead is greater than or equal to maxSourcesToRead
Yes
Decisions & LoopsStop repeating.Stop repeating.
No
No steps
ValuesSet pageUrl to blank.Set pageUrl to blank.
ValuesSet pageTitle to blank.Set pageTitle to blank.
Decisions & LoopsIf a step below fails, save the error as resultFieldErrorIf a step below fails, save the error as resultFieldError
Try
TextTrim result.url and save it as pageUrl.Trim result.url and save it as pageUrl.
TextTrim result.title and save it as pageTitle.Trim result.title and save it as pageTitle.
On error
ValuesShow in the output: A search result arrived without a link or a title. Checking what of it can still be used..Show in the output: A search result arrived without a link or a title. Checking what of it can still be used..
Decisions & LoopsIf pageUrl is empty or pageUrl doesn't contain httpIf pageUrl is empty or pageUrl doesn't contain http
Yes
ValuesAdd 1 to resultsSkipped.Add 1 to resultsSkipped.
ValuesShow in the output: Skipping a search result with no usable web link - it is not being used as a source..Show in the output: Skipping a search result with no usable web link - it is not being used as a source..
Decisions & LoopsSkip to the next item.Skip to the next item.
No
No steps
ValuesSet pageText to blank.Set pageText to blank.
Decisions & LoopsIf a step below fails, save the error as pageReadErrorIf a step below fails, save the error as pageReadError
Try
TavilyTavilyRead the contents of pageUrl. Save it as readResponse.Read the contents of pageUrl. Save it as readResponse.
TextTrim the first item of readResponse.results.raw_content and save it as pageText.Trim the first item of readResponse.results.raw_content and save it as pageText.
On error
ValuesShow in the output: Could not read pageUrl - it is not being used as a source.Show in the output: Could not read pageUrl - it is not being used as a source.
Decisions & LoopsIf pageText is emptyIf pageText is empty
Yes
ValuesAdd 1 to resultsSkipped.Add 1 to resultsSkipped.
ValuesShow in the output: No readable text at pageUrl - it is not being used as a source.Show in the output: No readable text at pageUrl - it is not being used as a source.
Decisions & LoopsSkip to the next item.Skip to the next item.
No
No steps
Decisions & LoopsIf pageTitle is emptyIf pageTitle is empty
Yes
ValuesChange pageTitle to pageUrl.Change pageTitle to pageUrl.
No
No steps
ValuesAdd 1 to sourcesRead.Add 1 to sourcesRead.
ValuesSet sourceLabel to [sourcesRead].Set sourceLabel to [sourcesRead].
ListsAdd sourceLabel pageTitleAdd sourceLabel pageTitle Link: pageUrl Page text: pageText truncated to charactersPerSource characters to the end of sourceExtracts and save it as sourceExtracts.
ListsAdd sourceLabel pageTitle - pageUrl to the end of sourceList and save it as sourceList.Add sourceLabel pageTitle - pageUrl to the end of sourceList and save it as sourceList.
Decisions & LoopsIf sourcesRead is 0If sourcesRead is 0
Yes
Decisions & LoopsStop and report a problem: None of the resultsFound search results could be read, so there is nothing to write up and no document has been created. The sources are the point here - a brief written without them would only be the model's own recollection.Stop and report a problem: None of the resultsFound search results could be read, so there is nothing to write up and no document has been created. The sources are the point here - a brief written without them would only be the model's own recollection.
No
No steps
TextJoin sourceExtracts with "Join sourceExtracts with ----- and save it as sourcesText.
ValuesSet coverageNote to Sources used: sourcesRead of the resultsFound search results found (resultsSkipped could not be read).Set coverageNote to Sources used: sourcesRead of the resultsFound search results found (resultsSkipped could not be read).
ValuesSet promptRules to:Set promptRules to:You are writing a short research brief from a numbered set of sources that were fetched for you. Follow these rules exactly. 1. Use ONLY the source text below. Do not add anything from your own knowledge, even where you are confident it is correct. 2. End every sentence that makes a claim with the number of the source it came from, like [1], or [2][3] where several sources support it. 3. If the sources do not answer the question, say so plainly in your first sentence and then write only what they do cover. Do not fill the gap. 4. Where two sources disagree, say that they disagree and cite bo...
ValuesSet prompt to promptRulesSet prompt to promptRules Question: researchQuestion Sources: sourcesText.
OpenAIOpenAIAsk OpenAI: prompt. Save it as modelResponse.Ask OpenAI: prompt. Save it as modelResponse.
TextTrim modelResponse.response_text and save it as writeUp.Trim modelResponse.response_text and save it as writeUp.
Decisions & LoopsIf writeUp is emptyIf writeUp is empty
Yes
Decisions & LoopsStop and report a problem: The model returned an empty write-up, so no document has been created. Run it again, or narrow the question in the 'researchQuestion' step.Stop and report a problem: The model returned an empty write-up, so no document has been created. Run it again, or narrow the question in the 'researchQuestion' step.
No
No steps
ValuesSet documentTitle to Research brief: researchQuestion truncated to 120 characters.Set documentTitle to Research brief: researchQuestion truncated to 120 characters.
ValuesSet documentBody to QuestionSet documentBody to Question researchQuestion What the sources say writeUp Sources sourceList joined by a new line coverageNote.
Google DocsGoogle DocsCreate the document documentTitle. Save it as newDocument.Create the document documentTitle. Save it as newDocument.
TextTrim newDocument.document_id and save it as documentId.Trim newDocument.document_id and save it as documentId.
Decisions & LoopsIf documentId is emptyIf documentId is empty
Yes
Decisions & LoopsStop and report a problem: Google Docs did not return a document to write into, so the brief could not be saved.Stop and report a problem: Google Docs did not return a document to write into, so the brief could not be saved.
No
No steps
Google DocsGoogle DocsAdd text to documentId.Add text to documentId.documentBody
ValuesShow in the output: Research brief saved: https://docs.google.com/document/d/@documentId/edit.Show in the output: Research brief saved: https://docs.google.com/document/d/@documentId/edit.