Skip to content

Update Exa integration examples to use search()#2963

Open
10ishq wants to merge 2 commits into
langfuse:mainfrom
10ishq:exa-api-modernize
Open

Update Exa integration examples to use search()#2963
10ishq wants to merge 2 commits into
langfuse:mainfrom
10ishq:exa-api-modernize

Conversation

@10ishq
Copy link
Copy Markdown

@10ishq 10ishq commented May 18, 2026

Updates the Exa integration examples:

  • Switched from search_and_contents() to search() in both examples
  • Example 1 now shows basic search with title/URL display
  • Example 2 builds OpenAI summarization context from search result titles and URLs
  • Removed references to text and highlights content options

Greptile Summary

This PR updates both the MDX integration page and the companion Jupyter notebook to use Exa's search() method instead of search_and_contents(), removing page-text retrieval from the examples.

  • Example 1 is updated correctly: exa.search() returns title and URL per result, and the display loop now prints those two fields with a blank separator line.
  • Example 2 retains the "summarize search results" narrative but now passes only titles and URLs as the OpenAI context, leaving the model with no actual page content to summarize — the RAG pipeline is effectively hollow and will produce misleading or fabricated outputs for anyone who runs this example.
  • The notebook was also significantly reformatted (indentation, removal of execution_count/outputs fields), which is cosmetic but makes diffs harder to read in future PRs.

Confidence Score: 3/5

Example 2 demonstrates a broken RAG pattern — the LLM receives only link titles, not page content — so merging as-is would publish misleading documentation to users.

The summarization example now feeds the OpenAI model a list of page titles and URLs while still asking it to summarize search results. Any user who follows this example will get a low-quality or fabricated summary because there is no actual text content in the context. This is the core intent of the integration guide and it is demonstrably undermined by the change.

Both content/integrations/other/exa.mdx and cookbook/integration_exa.ipynb share the same broken summarization context in Example 2 and need to be addressed together.

Sequence Diagram

sequenceDiagram
    participant User
    participant search_and_summarize
    participant search_with_exa
    participant Exa
    participant OpenAI

    User->>search_and_summarize: query
    search_and_summarize->>search_with_exa: "query, num_results=5"
    search_with_exa->>Exa: exa.search(query, num_results)
    Note over Exa: Returns title + URL only<br/>(no page text)
    Exa-->>search_with_exa: SearchResponse (title, url, id)
    search_with_exa-->>search_and_summarize: results
    search_and_summarize->>search_and_summarize: "build context = title + URL only"
    search_and_summarize->>OpenAI: Summarize... + context (titles/URLs)
    Note over OpenAI: No actual page content to summarize
    OpenAI-->>search_and_summarize: low-value summary
    search_and_summarize-->>User: print summary
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
content/integrations/other/exa.mdx:111-122
**Summarization context is titles/URLs only — no content to summarize**

After switching to `exa.search()`, the context built for OpenAI contains only `r.title` and `r.url` — no page text. The system prompt then instructs GPT to "Summarize the following search results clearly and concisely," but there is no substantive content to summarize; the model only sees a list of link titles. The output will be low-quality or hallucinatory, which misrepresents what a real Exa+LLM RAG pipeline would look like. To get actual page content you need `exa.search_and_contents()` with `text=True` or `highlights=True`, or the prompt/description should be updated to frame this as link recommendation rather than content summarization.

Reviews (1): Last reviewed commit: "use search instead of search_and_content..." | Re-trigger Greptile

@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

@10ishq is attempting to deploy a commit to the langfuse Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. documentation Improvements or additions to documentation labels May 18, 2026
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 18, 2026

CLA assistant check
All committers have signed the CLA.

10ishq and others added 2 commits May 18, 2026 16:51
Co-Authored-By: Tanishq Jaiswal <tanishq.jaiswal97@gmail.com>
Co-Authored-By: Tanishq Jaiswal <tanishq.jaiswal97@gmail.com>
@10ishq 10ishq force-pushed the exa-api-modernize branch from 85d8106 to 0f01bad Compare May 18, 2026 16:52
@10ishq
Copy link
Copy Markdown
Author

10ishq commented May 20, 2026

Hey @marcklingen — updates the Exa integration examples to current API conventions. CLA is signed. Would appreciate a review!

Copy link
Copy Markdown
Member

thank you! @jannikmaierhoefer can you review this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants