Search the web with Lisa

2 min read

This post will guide you through installing lisa-cli and enabling web search. 🌐 It’s an essential capability, and enabling it helps you understand the basics of running Lisa, so it’s a great way to get started! 🚀

The plan:

  1. LLM/model access
  2. Run the lisa-cli installer
  3. Set the search provider API key
  4. Enable the search provider
  5. Search the web

LLM/model access

Lisa CLI needs access to a model gateway. It supports Ollama with no configuration (no environment variables or .env files). Other providers, e.g., OpenRouter, OpenAI, etc., require API keys as environment variables.

Create an .env file

The easiest way to set environment variables for Lisa is to create a .env file in ~/.lisa. The lisa-cli repo has an example that you can copy right from the terminal:

Linux/MacOS:

mkdir ~/.lisa
curl -fsSL https://raw.githubusercontent.com/Lisa-Harness/lisa-cli/refs/heads/main/.env.example > ~/.lisa/.env

Windows (PowerShell):

md ~/.lisa
irm https://raw.githubusercontent.com/Lisa-Harness/lisa-cli/refs/heads/main/.env.example | Out-File ~/.lisa/.env

Set an API key

The .env file contains examples for several providers. E.g., OpenRouter, look for the line that says:

# LISA_OPENROUTER_API_KEY=sk-or-...

Uncomment the line, i.e., remove the #, then replace sk-or-... with your OpenRouter API key.

ℹ️ The installer’s verify step will include a warning unless at least one valid API key is set.

Run the lisa-cli installer

The installer downloads uv (unless it’s already present), then uses it to install Lisa. The installation doesn’t require privilege and targets your home directory.

Linux/MacOS (bash):

curl -fsSL https://raw.githubusercontent.com/Lisa-Harness/lisa-cli/main/install.sh | bash

Windows (PowerShell):

irm https://raw.githubusercontent.com/Lisa-Harness/lisa-cli/main/install.ps1 | iex

Look for All checks passed in the output after the installation completes.

Set the search provider API key

The .env file contains BRAVE_, SERPER_, and TAVILY_ variables. Follow the same process to find them, uncomment them, and set them. E.g.

TAVILY_SEARCH_API_KEY=tvly-dev-...

Enable the search provider

To enable the search provider, edit ~/.lisa/config/session_context.md. It is set up for Tavily but there are also packs for Brave and Serper. Just search ’tavily’ and replace ‘brave’ or ‘serper’ to switch.

ℹ️ The provider will require you to sign-up/-in to get an API key.

Update the resources and providers sections to look like this:

resources:
  packs:
    configuration: {}
    required:
      - lisa-pack-markdown
      - lisa-pack-personas
      - lisa-pack-tavily
providers:
  capabilities:
    memory: lisa-pack-memory
  tools:
    web_search: lisa-pack-tavily

ℹ️ Whitespace matters in YAML, so be sure to replace each ‘#’ with exactly one space, so it looks like the above.

Search the web

lisa prompt "research my favorite thing."
← Back to Lisa