Skip to content

feat: add Tavily as optional Phase 1 backend in literature-review-agent - #13

Open
manisrinivasan2k1 wants to merge 1 commit into
Ar9av:mainfrom
Tavily-FDE:feat/tavily-migration/literature-review-agent-tavily-backend
Open

feat: add Tavily as optional Phase 1 backend in literature-review-agent#13
manisrinivasan2k1 wants to merge 1 commit into
Ar9av:mainfrom
Tavily-FDE:feat/tavily-migration/literature-review-agent-tavily-backend

Conversation

@manisrinivasan2k1

Copy link
Copy Markdown

Summary

Adds Tavily as a configurable, opt-in Phase 1 candidate discovery backend alongside the existing Exa backend in the literature-review-agent. This is an additive change — no existing Exa code is modified or removed.

What changed

  • New scripts/tavily_search.py — mirrors exa_search.py conventions (stdlib urllib only, same CLI flags pattern, same normalized candidate JSON output format). Supports --query, --num-results, --topic (general/news), --academic (restricts to arxiv.org, scholar.google.com, etc.), --discovered-for, and --raw flags. Reads TAVILY_API_KEY from env, uses search_depth: "advanced" for best relevance.

  • New references/tavily-search-cookbook.md — mirrors exa-search-cookbook.md structure. Documents key provisioning, CLI usage, curl recipes, response mapping, query patterns, cost/rate-limit notes (1,000 free credits/month), security guidance, troubleshooting, and when to prefer Tavily vs Exa vs host-native search.

  • Updated SKILL.md — added "Optional: Tavily as a Phase 1 backend" subsection under Step 1 (alongside existing Exa subsection), added tavily_search.py and tavily-search-cookbook.md to the Resources list.

  • Updated setup.sh — added set_env_var call for TAVILY_API_KEY so the interactive setup flow prompts for it alongside EXA_API_KEY; writes it to ~/.paperorchestra/config; listed in the summary output.

Files changed

  • skills/literature-review-agent/scripts/tavily_search.py (new)
  • skills/literature-review-agent/references/tavily-search-cookbook.md (new)
  • skills/literature-review-agent/SKILL.md (modified)
  • setup.sh (modified)

Dependency changes

  • tavily-python is documented as an optional install in the cookbook (consistent with how exa dependencies are handled — not added to requirements.txt)

Environment variable changes

  • Added TAVILY_API_KEY — read by tavily_search.py at runtime; prompted in setup.sh; written to .env and ~/.paperorchestra/config
  • Existing EXA_API_KEY is unchanged

Notes for reviewers

  • Phase 2 verification (Semantic Scholar, Levenshtein, cutoff, dedup) is backend-agnostic and requires no changes
  • The Tavily helper uses stdlib urllib only (no mandatory new dependencies), matching the exa_search.py pattern
  • Both tavily_search.py and setup.sh parse correctly (verified with py_compile and bash -n)

Automated Review

  • Passed after 1 attempt(s)
  • Final review: The Tavily migration for the literature-review-agent is clean, correct, and well-scoped. The new tavily_search.py closely mirrors the existing exa_search.py pattern (stdlib urllib, env-var key, normalized output, same exit-code contract). The cookbook doc is thorough and accurate. SKILL.md and setup.sh are updated consistently. All four files reported in scope are present and there are no regressions or unintended changes. One minor style inconsistency worth noting but not blocking.

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