Cyber Monday: 2XCYBER doubles your top-up, up to $2,000.Double my top-up

nc://exa

v0.1.0Pinned
Backnodecode-ai
ThomSharktools: add context7, exa, notion, postgres and playwright cells (#184)719ef6f· 2 Dec1 commit
test1 filecell.lisp4.5 KBtools.lisp14.1 KBwire.lisp7.0 KB

nodecode-exa

Exa web search through its REST API: find pages by meaning, read their clean text, find pages like a given one, and get a short answer with the pages it cites. Written for Nodecode from Exa's API docs.

Get it

Tell the agent "add the exa cell", or run nodecode add nc://exa.

Set it up

Put an API key from the Exa dashboard in Nodecode's environment as EXA_API_KEY. Every call spends Exa credit; each answer shows what it cost. See config.example.jsonc:

Key Default What it does
base_url "https://api.exa.ai" Where Exa's API answers: https://, or http:// on this machine.
api_key_env "EXA_API_KEY" The environment variable holding the key.
api_key none A key written here instead; the environment variable wins.
timeout 60 One API call's ceiling, in seconds.
max_results 10 The most results one call asks for, and the default.
max_chars_per_result 3000 How many characters of one page's text, passages or summary an answer carries.
max_chars 30000 How many characters one answer carries in all.

Use it

Tool Exa API For
exa_search POST /search A query to the best pages. type (auto, fast, instant, deep), num_results, include_domains, exclude_domains, start_published_date, end_published_date, category (company, publication, news, personal site, financial report, people), and contents: highlights (default), text, summary or none.
exa_contents POST /contents The clean text of up to max_results URLs; with query, the passages and a summary for it; max_age_hours crawls live past that age.
exa_find_similar POST /findSimilar Pages like a URL; num_results, the domain filters, exclude_source_domain, contents (none by default).
exa_answer POST /answer A short answer to a question with the pages it cites; citation_text carries their text.
Exa search for "a blog post comparing Rust async runtimes": 2 results (cost $0.0075)
1. Async runtimes compared - https://a.example/post (published 2025-03-04, by Ann)
   summary: A comparison.
   highlights: Tokio leads. ... Smol is small.
2. (untitled) - https://b.example/
   text: Body text here.

A URL must be http:// or https://, a date ISO 8601 (2025-01-31), a domain free of blanks, and num_results 1 to max_results; anything else is refused before a request is made. A page Exa could not read is named with Exa's reason.

/exa checks the connection and the key with one small search.

The key

  • The key rides only the x-api-key header, never a URL or a request body, and only over https:// or to this machine.
  • Every answer and every refusal has the key scrubbed out, so an error that echoes it cannot carry it into the conversation.
  • With no key the cell refuses before any request and says where the key goes. A rejected key (401/403), spent credit (402) and a rate limit (429) each say what to do.

Test

.github/test-cell.sh tools/nodecode-exa

The tests run offline: nlk:http is stubbed to answer by URL, so each tool's request body, the key's header and its scrubbing, the refusals, and the result format and clipping are asserted with no network.

License

MIT. See LICENSE. Exa is a hosted service; none of its code is included.

Add nc://exa

  1. 1

    Install Nodecode

    Once per machine.

    $ curl -fsSL https://nodecode.ai/install.sh | sh
  2. 2

    Add the cell

    Pinned at 719ef6f.

    $ nodecode add nc://exa

    Or tell the agent add the exa cell.