A small, shareable web-research agent built with React, OpenComputer, and Exa. Ask a question in the browser and the agent searches the live web with Exa, reads relevant results, and returns a concise answer with source links.
- Natural-language web research with Exa
- Current results instead of model memory alone
- Semantic search with optional date, domain, and category filtering
- Relevant page highlights or full-text retrieval
- Streaming answers with clickable source URLs
- Follow-up questions in the same research session
- Node.js 22 or newer
- An OpenComputer account
- An Exa API key
Never put the Exa key in .env, React source code, or a browser request. The
key is stored by OpenComputer as a managed, write-only secret and is injected
only into requests sent to https://api.exa.ai.
Clone the repository, enter its directory, and install the dependencies:
git clone https://github.com/diggerhq/opencomputer-example-exa.git
cd opencomputer-example-exa
npm installLog in to OpenComputer:
npm run opencomputer -- loginSet the development secret from the project directory:
npm run opencomputer -- secrets set EXA_API_KEYPaste the key when prompted. Input is hidden. Confirm that the secret name is registered without printing its value:
npm run opencomputer -- secrets list --environment developmentOnly EXA_API_KEY is required.
The agent sync and React development server run separately.
npm run devThe first run asks you to create an OpenComputer cloud project or select an existing one. Keep this process running while using the demo.
npm run dev:webOpen http://localhost:5173 in a browser.
- Enter a research question or select one of the example prompts.
- The OpenComputer agent receives the question and calls
exa_search. - Exa searches the live web and returns ranked sources with page content.
- The agent compares the evidence and streams an answer with source URLs.
- Ask follow-up questions to continue in the same session.
Good questions to try:
What are the latest developments in AI coding agents?
Find recent companies hiring their first DevOps engineer.
Compare the newest open-source browser automation tools.
Verify the production React build:
npm run buildProduction uses a separate secret from development. Set it before deploying:
npm run opencomputer -- secrets set EXA_API_KEY \
--environment productionDeploy the agent and application:
npm run deployopencomputer/
agents/hello-world/
agent.ts Agent instructions and tool registration
tools/exa.ts Exa connection and exa_search tool
project.ts OpenComputer project definition
opencomputer/agents/hello-world/skills/exa-search/
SKILL.md Agent-specific research workflow guidance
src/
App.tsx Exa demo interface
use-agent.ts Streaming OpenComputer client
styles.css Responsive presentation styles
| Command | Purpose |
|---|---|
npm install |
Install project dependencies |
npm run dev |
Sync the development agent to OpenComputer |
npm run dev:web |
Start the local React application |
npm run build |
Type-check and build the React application |
npm run session |
Open an agent session from the terminal |
npm run deploy |
Create a production deployment |
npm run opencomputer -- <command> |
Run the project-local OpenComputer CLI |
npm run opencomputer -- secrets set EXA_API_KEY |
Set the Exa secret |
npm run opencomputer -- secrets list |
List configured secret names and scopes |
Start npm run dev first and leave it running before starting npm run dev:web.
Set the key again in the environment you are using:
# Local development
npm run opencomputer -- secrets set EXA_API_KEY \
--environment development
# Production deployment
npm run opencomputer -- secrets set EXA_API_KEY \
--environment productionChoose an existing OpenComputer project or create a new one. The local binding
is stored under .opencomputer/, which is intentionally excluded from Git.
Check that:
npm run devis still running.EXA_API_KEYappears in the development secrets list.- The Exa account has available API usage.
- The terminal running the agent shows no connection or deployment errors.
- Do not commit API keys,
.envfiles, or.opencomputer/state. - React never receives the plaintext Exa key.
- The managed connection permits only HTTPS requests to the declared Exa API origin and methods.
- Rotate the Exa key immediately if it is pasted into source code, logs, chat, or another public location.