consciousness/src/agent
Kent Overstreet 5f06577ead tools/web: add gemini_search as an alternative search tool (#5)
Issue #5 (spqrz) flagged that web_search using DuckDuckGo
occasionally flakes out, and Google search directly is blocked
behind CAPTCHAs for non-browser clients. The Gemini free-tier API
exposes a grounded-search tool that effectively queries Google's
index and returns an LLM-summarized answer with source URLs.

Added as a SEPARATE tool rather than a transparent fallback for
web_search:

* web_search (DDG) returns raw results — title, URL, snippet per
  hit — which the agent can reason over itself.
* gemini_search returns an LLM-pre-digested summary plus grounding
  URLs. Useful for synthesis queries ("what's the consensus on X")
  or when DDG is flaky, but it's another LLM in the loop so the
  agent may want the raw variant for certain tasks.

Tool descriptions tell the agent to prefer web_search for raw
results and use gemini_search for synthesis / fallback. The agent
picks based on query shape.

Only registered when GEMINI_API_KEY is set in the environment
(gracefully absent otherwise). Uses gemini-2.0-flash which has a
generous free-tier rate limit. Parses grounding metadata for
source URLs so the agent can follow links.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-18 13:02:01 -04:00
..
api agent/api: carry readout alongside streamed tokens 2026-04-18 01:15:46 -04:00
tools tools/web: add gemini_search as an alternative search tool (#5) 2026-04-18 13:02:01 -04:00
context.rs agent: kill no_compact, add pre-send size check in assemble_prompt 2026-04-18 12:59:30 -04:00
mod.rs agent: kill no_compact, add pre-send size check in assemble_prompt 2026-04-18 12:59:30 -04:00
oneshot.rs config: move user_name/assistant_name to AppConfig (top level) 2026-04-16 16:20:17 -04:00
readout.rs amygdala: F8 screen for live concept-readout projections 2026-04-18 01:20:30 -04:00
tokenizer.rs agent: add NodeBody::Image for Qwen3-VL vision input 2026-04-16 18:00:10 -04:00