Skip to content

[Content] Add research assistant cookbook with Web + X search - #32

Open
dominicva wants to merge 12 commits into
xai-org:mainfrom
dominicva:add-research-assistant-cookbook
Open

[Content] Add research assistant cookbook with Web + X search#32
dominicva wants to merge 12 commits into
xai-org:mainfrom
dominicva:add-research-assistant-cookbook

Conversation

@dominicva

Copy link
Copy Markdown

Description

Adds a cookbook that cross-references news sources with X discourse to produce a structured divergence briefing.

Why this change matters:

  • Demonstrates web search with domain filtering, X search, inline citations, and structured output, which aren't covered by existing cookbooks

Type(s) of Change

  • New Content

Checklist

  • Read "How to Contribute" in CONTRIBUTING.md
  • Code follows style guidelines in "How to Contribute"
  • Included relevant dependencies
  • API key is not in committed files
  • Notebook runs end-to-end with cell outputs shown and no errors
  • Added new notebook entry to registry.yaml

dominicva added 12 commits April 4, 2026 20:28
Introduce a new cookbook notebook demonstrating Grok's built-in
web search with domain filtering via the native xai-sdk. Covers
setup, curated domain lists, and inline citations from vetted
news outlets.
Add an interlude comparing filtered and unfiltered web search
results, then introduce X search for public discourse on the
same topic. Shows how domain filtering affects source quality
and contrasts press reporting with social sentiment.
Add the three-pass reconciliation that cross-references web and
X search findings, clustering claims into five categories using
Pydantic structured output via response_format.
Wrap the three-pass flow into a reusable research() function
and demonstrate it on additional topics: semiconductor supply
chains and AI coding tools. Add conclusion with extension ideas.
Add API key validation, fix registry trailing newline,
and rewrite conclusion to focus on design decisions.
- Generate sci-fi cover image with Grok and add to registry
- Validate allowed_domains max-5 limit in research() helper
- Soften hard-coded pricing to avoid stale dollar estimates
- Re-execute all cells for up-to-date search outputs
- Add url field to Claim model so every claim in the divergence
  briefing links back to its original source
- Pass citation URLs into the reconciliation prompt via
  _format_findings() helper
- Restore python-dotenv as an explicit dependency
- Soften result-dependent commentary and reword caveats
- Clear noisy pip install output
- Re-execute notebook with fresh outputs
- Use typing.Literal for category fields on Claim and ClaimCluster
  so invalid labels are rejected by the schema
- Fix falsey check on web_domains so passing [] allows unfiltered search
- Re-execute notebook with fresh outputs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant