nwhitehouse bolts web search onto Mike with a one-click toggle

A globe icon next to the send button lets users pull in live web results alongside legal sources, message by message.

searchchat-ui

The fork already lets users pick which legal databases to query per question. This change adds the open web as a separate option, wired through Brave Search (a commercial search API positioned as a Google alternative). Because legal sources and the web behave differently - you usually want several legal databases at once, but the web is either on or off - nwhitehouse gave them different controls: checkboxes for the legal side, a single globe icon for the web. Turn it blue when you want current news or commentary mixed into the answer; leave it gray to stay strictly inside the legal corpus.

The toggle resets after every message, so a user can't accidentally leave the web on for a sensitive matter. Brave is the only paid piece, and if no API key is configured the feature simply hides itself rather than breaking the app.

So what For teams who want their legal AI to occasionally reach for current events without blurring the line between authority and commentary, this is a clean pattern to copy.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

1 commit from nwhitehouse/mike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
00e1dd66 [feat-003] Brave web search with globe-icon toggle Nick Whitehouse 2026-05-04 ↗ GitHub
commit body
Adds a `web_search` tool backed by the Brave Search API, gated by a
globe-icon toggle on the right side of the chat input (Ruli pattern).
Hard-gated: globe off → tool not in the model's schema. Same shape as
the legal-sources picker, distinct UI surface because web search is a
binary toggle vs the legal sources' per-source multi-select.

Backend
- backend/src/lib/webSearch.ts (new): Brave Search client with 12s
  AbortController timeout. Returns the same shape as legalSearch
  results so feat-004 references-inline can render either source with
  one card component. Graceful degradation when BRAVE_SEARCH_API_KEY
  is missing.
- chatTools.ts: WEB_TOOLS array (kept separate from always-on TOOLS
  so it can be conditionally appended). Dispatch case for web_search
  in runToolCalls. runLLMStream accepts sources.web boolean; when
  true → append WEB_TOOLS + system-prompt line steering the model
  toward web for current/news/commentary.
- routes/chat.ts: extends sources type to { legal?, web? }.
- .env.example: documents BRAVE_SEARCH_API_KEY.

Frontend
- ChatInput.tsx: globe icon button between ModelToggle and send.
  Filled blue when on, gray when off. Per-message state (resets
  after submit, matches legal-sources behaviour). Click toggles.
- MikeMessage.sources extended to include web?: boolean.
- mikeApi.streamChat passes sources through unchanged.

Also writes detailed feat-004 (references inline) and feat-005
(multi-pass research orchestrator) plans into backlog.md so the
direction is documented before implementation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-111.md from inside the repo you want the changes in.

⬇ Download capture-thread-111.md