Skip to content

feat: add Exa AI-powered search tool - #6

Open
tgonzalezc5 wants to merge 1 commit into
iammrduncan:mainfrom
tgonzalezc5:feat/exa-search
Open

tgonzalezc5 wants to merge 1 commit into
iammrduncan:mainfrom
tgonzalezc5:feat/exa-search

Conversation

@tgonzalezc5

Copy link
Copy Markdown

Summary

  • Adds tinyloom.plugins.exa_search, a tinyloom plugin that registers a web_search tool backed by Exa's web search API.
  • Exposes Exa's full feature surface to the agent: auto/neural/fast/deep/instant search types, text/highlights/summary content modes (combinable), domain and text filters, category filter, date ranges, and user_location.
  • Cascading content extraction (highlightssummarytext) so each result renders the most useful snippet that came back, with text truncated to 1500 chars to keep tool output compact.
  • Optional dependency: pulls exa-py>=2.0.0 only when installed via the [exa] extra. The plugin gracefully no-ops with a stderr warning if EXA_API_KEY is unset and returns a clear error if exa-py isn't installed.
  • Picks up EXA_API_KEY from the environment (loaded by tinyloom's existing dotenv handling).

Slots in alongside the existing optional plugins (mcp, mask, hook_scripts) and follows the same style and registration conventions.

Usage

uv add 'tinyloom[exa]'
export EXA_API_KEY=...
# tinyloom.yaml
plugins:
  - tinyloom.plugins.exa_search

The agent can then call:

{
  "tool": "web_search",
  "input": {
    "query": "test-time compute scaling",
    "category": "research paper",
    "start_published_date": "2024-01-01",
    "num_results": 5
  }
}

Files changed

  • tinyloom/plugins/exa_search.py — new plugin (registers web_search tool, sets x-exa-integration tracking header)
  • tests/test_plugins.py — 14 new tests covering activation, response rendering, parameter passthrough, fallback content extraction, missing-SDK / missing-key / no-results / SDK-exception paths
  • docs/exa-plugin.md — new docs page modeled on docs/mcp-plugin.md
  • pyproject.tomlexa = ["exa-py>=2.0.0"] optional extra
  • tinyloom.example.yaml — commented entry alongside existing plugins
  • .env.exampleEXA_API_KEY entry
  • uv.lock — regenerated after adding the optional extra

Test plan

  • uv run pytest tests/ -q — 233 passed (14 new)
  • uv run ruff check tinyloom/plugins/exa_search.py tests/test_plugins.py — only E701/E401 warnings, matching the style used in tinyloom/plugins/todo.py, mcp.py, mask.py (one-line ifs and grouped imports per CONTRIBUTING.md style guide)
  • Tool registration skipped (with stderr warning) when EXA_API_KEY is unset
  • Clear error message when exa-py isn't installed
  • Filters (include_domains, category, start_published_date, type, summary, …) pass through to the SDK
  • Content fallback verified: highlights → summary → text → empty
  • Manual smoke test against live Exa API (requires reviewer's EXA_API_KEY)

@shadowcodex

Copy link
Copy Markdown
Contributor

Hey @tgonzalezc5 thanks for the PR. I'll take a look at it this week between conference meetings and see how we want to handle 1st party tools like this.

@tgonzalezc5

Copy link
Copy Markdown
Author

dope sounds good, good luck with the conference!

This branch has not been deployed

No deployments
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.

2 participants