# LLMSlim + Exa

> Live web search results as bounded, untrusted context for planning.

ExaSearchSource searches the web with Exa and returns each result as an untrusted RAG ContextItem with its URL, so fresh pages can join an agent’s context without promoting themselves into instructions. A usage guard caps requests and spend.

Category: Backend Services

## Install

```bash
pip install 'llmslim[exa]'
```

## How it fits

- Read EXA_API_KEY on the server and build the source with from_env().
- Search for the current question with a small result limit.
- Results become untrusted RAG ContextItems that keep their source URLs.
- Plan or compress them together with the rest of the context.

## Example

```python
from llmslim.integrations.exa import ExaSearchSource

source = ExaSearchSource.from_env()  # reads EXA_API_KEY
items = await source.search("Sarvam-105B context window", limit=5)
# Pass items to plan_context(documents=items); web results stay untrusted.
```

## Deployment

Keep EXA_API_KEY server-side. Set LLMSLIM_EXA_REQUESTS_PER_MINUTE and LLMSLIM_EXA_MAX_REQUESTS before exposing search to users, and keep result limits small so the planner, not the search, decides what reaches the model.

## Tips

- Search with the user’s actual question; LLMSlim compresses around the same query.
- Restrict domains when the answer must come from known sources.
- Never let page text set SYSTEM or DEVELOPER provenance.

## FAQ

### Does LLMSlim call Exa on its own?

No. A search runs only when your code calls it, within the limits you set.

### Are search results trusted?

No. Every result is untrusted retrieval context with its URL, like any other RAG document.

## Troubleshooting

- **Searches are refused before reaching Exa:** The usage guard stopped them. Raise LLMSLIM_EXA_REQUESTS_PER_MINUTE or LLMSLIM_EXA_MAX_REQUESTS deliberately, or wait for the window to pass.

Canonical page: https://www.llmslim.app/integrations/exa
