consciousness/src
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
..
agent tools/web: add gemini_search as an alternative search tool (#5) 2026-04-18 13:02:01 -04:00
bin context: tighten timestamp schema; every AstNode has one 2026-04-16 12:35:16 -04:00
cli config: move user_name/assistant_name to AppConfig (top level) 2026-04-16 16:20:17 -04:00
hippocampus scoring: drop dead Elo/agent_budget block in consolidation_plan 2026-04-16 16:08:20 -04:00
learn rust edition 2024 2026-04-05 06:20:16 -04:00
mind cleanup: drop dead ApiClient::stream_completion wrapper, silence dmn_tick 2026-04-17 16:23:59 -04:00
subconscious agent/api: carry readout alongside streamed tokens 2026-04-18 01:15:46 -04:00
thalamus hours_since_last_dream: return 0 if dream in progress 2026-04-15 21:58:03 -04:00
user amygdala: default to index 0 for v2 deep manifest (layers 62, 63) 2026-04-18 02:32:51 -04:00
config.rs user: F7 compare screen 2026-04-17 16:12:26 -04:00
config_writer.rs config_writer: emit pretty multi-line sections, drop json5 crate 2026-04-16 13:08:19 -04:00
lib.rs config_writer: json5 round-trip editing via json-five 2026-04-16 11:48:47 -04:00
locks.rs locks: add process-wide lock hold time tracking 2026-04-12 20:27:42 -04:00
main.rs poc-memory: load AppConfig at startup 2026-04-16 18:19:01 -04:00
mcp_server.rs memory.rs: clean up store access and tool dispatch 2026-04-13 14:27:38 -04:00
session.rs delete claude code integration 2026-04-09 19:58:07 -04:00
util.rs delete 20 dead public functions across 12 files 2026-04-02 16:21:01 -04:00