Skip to main content
Answer questions about things that happened after your model’s training cutoff. Your code searches only pages published in the last 30 days, turns the top results into a numbered source block, and asks your model to answer from those sources and cite them as [n].

Recipe prompt

Paste this into your coding agent to have it build the recipe in your project:
Recipe prompt

What you build

When it runs

Once per question, on demand. Use it when the answer depends on something recent, such as a release, a price or an announcement. For a question about stable facts, drop published_after so older reference pages can rank.

Code

This sample searches for pages published in the last 30 days, builds the prompt and prints it with the source list. It runs with no API key:
Send the printed prompt to your model. to_context() and cited() take the same options, so [2] in the answer always maps to the second URL in the source list. The curl tab numbers the raw results with jq, because HTTP returns JSON with no rendered block.

Example output

You see the prompt, then one line per source with its publish date:
Example output · results vary

Production notes

published_after takes a date, an ISO 8601 timestamp or a relative offset such as 7d. Don’t use query_time for recency: it sets an upper bound and leaves newer pages out. See Search parameters.

Next steps