Get Started

Build your own Perplexity that has to prove every fact, on your laptop

Ask a question, walk away, come back to a Markdown report with numbered citations, a sources list and a fact-check section. A local model plans the research, Crawl4AI reads the pages politely, and plain code catches the model when it makes things up.

70 minIntermediateTools: Free (no accounts, no API keys)Step 1 free
A Python research agent you ownquestion in, cited report out, all on your PC
Search through Wikipedia's and GOV.UK's official APIs, with no keys and no scraped search engines
A robots.txt checker that understands wildcards, plus polite, one-at-a-time fetching with Crawl4AI
  • Notes the model has to prove with an exact quote, and code that throws away any it can't
  • A fact-check pass that flags claims with no source, fake source numbers and claims the sources don't back
  • A starter kit with every file, ready to run
Before you start
01/06Get the kit and fill in one setting0 done
STEP 01 of 06~10 min

Get the kit and fill in one setting

Five small Python files, one settings file, and a model that's already on your PC.

  1. Here's the whole agent on one page. The grey boxes are your local model. The orange boxes are plain code, which does the same thing every time. That split is the point of this mission: the model makes the judgement calls, and code checks its work.

    Diagram of the research agent. Row one, Find: question, model plans sub-questions, code searches Wikipedia and GOV.UK, model picks pages, code checks robots.txt and fetches with Crawl4AI. Row two, Write: model takes notes with quotes, code checks each quote is really in the page, model writes sentences with source numbers, code and model fact-check, output report.md.
    The pipeline. Each box is one function in the kit.
  2. If you've done Local AI function calling, you've seen a model choose which tool to run. Here the loop lives in code instead, and the model makes choices inside it: which sub-questions to ask, which pages to read, whether a claim is backed up. With a small local model, that's far more predictable.

  3. Download the starter kit: research-agent.zip. Unzip it into your home folder and make your settings file from the example:

    Windows
    cd $HOME\Downloads
    Expand-Archive research-agent.zip -DestinationPath $HOME
    cd $HOME\research-agent
    Copy-Item .env.example .env
    notepad .env
    Mac / Linux
    cd ~/Downloads
    unzip research-agent.zip -d ~
    cd ~/research-agent
    cp .env.example .env
    open -e .env
    .env
    # Copy this file to .env and fill it in. .env stays on your PC (it's in .gitignore).
    
    # Who runs this bot: your email address or a website. Wikipedia asks every program for one.
    RESEARCH_CONTACT=you@example.com
    
    # The Ollama model. gemma4:e4b is smarter if you have 16GB or more of RAM.
    RESEARCH_MODEL=gemma4:e2b
    
    # The model's reading window, in tokens. Drop to 4096 if your PC struggles.
    RESEARCH_NUM_CTX=8192
    
    # Characters kept from each page (roughly 4 characters per token).
    RESEARCH_MAX_CHARS=8000
    
    # Seconds between page fetches. Don't go below 2.
    RESEARCH_DELAY=3
    
    # false = no thinking (fastest). Use auto for a model without a thinking mode.
    RESEARCH_THINK=false
    
    # Where Ollama listens. Leave it unless you've moved Ollama.
    OLLAMA_URL=http://127.0.0.1:11434
  4. Change RESEARCH_CONTACT to your email address or a website, and save. Why: Wikimedia's User-Agent policy ↗ asks every program to say who runs it, and scripts that don't "may be blocked without notice". The agent puts this in every request it makes, and refuses to start while it still says example.

    Tip.env is listed in the kit's .gitignore, so it stays out of Git if you put the project on GitHub. There are no secrets in it today, but it's the right home for an API key if you add a source that needs one later.
  5. Check Ollama is running and has the model. If gemma4:e2b isn't listed, run ollama pull gemma4:e2b (4.6GB):

    Terminal
    ollama list
  6. Every command in this mission starts with uv run. Each .py file begins with a short # /// script header listing what it needs, so uv sets up the right Python and packages for it the first time you run it. You never activate anything.

✓
CheckpointYou have a research-agent folder with .env in it, your contact details are saved in .env, and ollama list shows gemma4:e2b.
If it breaks'uv' is not recognised + 2 more
'uv' is not recognised
Install it as in the Crawl4AI lesson (winget install --id astral-sh.uv -e on Windows, brew install uv on a Mac), then open a new terminal.
Expand-Archive says a file already exists
You've unzipped it before. Add -Force to overwrite, or delete the old research-agent folder first if you don't need anything in it.
"could not connect to a running Ollama instance"
Open Ollama from the Start menu (or Applications on a Mac) and run ollama list again.
Still stuck? Ask the community
Next mission · Own your AIBuild your own MCP server so Claude can use your tools
→