Getting started with SearcherKit
SearcherKit is a modular runtime for building, running, evaluating, and training search agents. It connects an LLM to tools that search local files, the web, Elasticsearch, and MCP services.
How SearcherKit works
dataset or TUI
|
v
AgentRunner ---- logs, retries, checkpoints
|
v
SearchAgent
|
+---- Parser <----> LLM Client
`---- Tool ----> Source or MCP serviceThe LLM decides when to call a tool; tools delegate retrieval to sources and return results to the agent. YAML configuration selects the LLM client, parser, tools, sources, and runtime limits for both interactive and batch runs.
Install SearcherKit
SearcherKit requires Python 3.12 or later. Create and activate a virtual environment, then install the package from PyPI:
python -m venv .venv
source .venv/bin/activate # macOS/Linux
# Windows PowerShell: .venv\Scripts\Activate.ps1
pip install searcherkituv venv --python 3.12
source .venv/bin/activate # macOS/Linux
# Windows PowerShell: .venv\Scripts\Activate.ps1
uv pip install searcherkitConfirm that the command is available:
searcher --helpLocal-file search uses ripgrep for full-text matching. Install it separately and verify that rg is on PATH:
rg --versionThe file source searches readable text files. Common examples are .py, .js, .ts, .java, .c, .cpp, .rs, .go, .html, .css, .md, .json, .yaml, .toml, .csv, .log, and .ipynb, plus names such as Dockerfile and Makefile.
PDF, ZIP, image, and other binary files are not parsed. Run rg --type-list to see the exact list for your ripgrep version. See ripgrep’s File types guide.
Run your first search
The packaged file_search demonstrates an agent that searches through local directory with search and visit tools.
Set the model endpoint and the directory to search:
export LLM_MODEL="YOUR_MODEL"
export LLM_API_KEY="YOUR_API_KEY"
export LLM_BASE_URL="https://your-endpoint.example/v1"
export FILE_SEARCH_ROOT="./docs"$env:LLM_MODEL = "YOUR_MODEL"
$env:LLM_API_KEY = "YOUR_API_KEY"
$env:LLM_BASE_URL = "https://your-endpoint.example/v1"
$env:FILE_SEARCH_ROOT = ".\docs"Start the interactive terminal UI:
searcher tui --config-path file_searchThe agent can now search files under FILE_SEARCH_ROOT, open relevant results, and use their contents to answer your questions.
See Search files with SearcherKit for the complete workflow, output locations, and access restrictions.
Understand the configuration
A SearcherKit run is described by YAML. The smallest useful configuration connects four parts:
- an LLM client that communicates with the model endpoint;
- a parser that converts messages and tool calls;
- one or more sources that retrieve documents;
- tools that expose selected source operations to the model.
config.yaml
agent:
llm_client:
type: openai
model: ${oc.env:LLM_MODEL}
api_key: ${oc.env:LLM_API_KEY,EMPTY}
base_url: ${oc.env:LLM_BASE_URL}
parser:
type: upstream
sources:
- type: file
name: project_docs
root_path: ./docs
tools:
- type: search
name: search
source: [project_docs]
- type: visit
name: visit
source: [project_docs]
system_prompt: >-
Search for evidence when needed and give a concise final answer.
max_turn: 10
output_path: outputs/first-runHere, both tools refer to the source by its unique name, project_docs. The upstream parser expects the provider to return structured tool calls. Models that encode tool calls in text may require a model-specific parser.
If this file is saved as configs/demo/config.yaml, validate and run it with:
searcher inspect --config-path configs/demo/config.yaml
searcher tui --config-path configs/demo/config.yamlHydra-style overrides let you change values without editing the file:
searcher tui --config-path configs/demo/config.yaml \
agent.llm_client.model=Qwen3-8B \
output_path=outputs/qwen3Read LLM integration for clients and parsers, and Sources and tools for retrieval and model-visible tool schemas.
Choose what to do next
| Goal | Next page |
|---|---|
| Search a local directory interactively | Search files with SearcherKit |
| Search the public web interactively | Search the web with SearcherKit |
| Search an Elasticsearch knowledge base | Search with Elasticsearch |
| Run a dataset and evaluate its answers | Run and evaluate |
| Generate data or train a model | Training overview |
| Understand the runtime components | System architecture |
| Connect a model and choose a message format | LLM integration |
| Configure retrieval and model-visible tools | Sources and tools |
| Learn the interactive controls and records | Interactive TUI |
| Configure retries, logs, limits, and resume behavior | Retrying and logging |
| Add a provider, parser, source, or tool | Custom Modules |
| Look up commands and flags | CLI reference |
The API Reference is generated from package docstrings. Use it for exact Python signatures after the guide has identified the component that owns the behavior you want to use or extend.