Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Why the private beta

4got is in a private beta. This page explains why and what that means for you.

The short version

I built this in my free time and I don’t want to expose early testers to security vulnerabilities that haven’t been found yet. A search engine handles sensitive data by nature — your queries reveal what you’re thinking about, what you’re worried about, what you’re researching. I’d rather bring in a small number of people at a time, find the obvious holes, and fix them before opening the doors to everyone.

The longer version

This project started as a personal itch. I wanted a search engine that didn’t suck, didn’t track me, and didn’t require a data center to run. I ralph’d it together in my free time — evenings, weekends, whenever I had the energy. It’s not backed by a company, it’s not funded, and there’s no team. It’s just me and a mass of Claude Code subagents.

That means my bandwidth for handling bug reports, security disclosures, and feature requests is limited. Open-sourcing a security-sensitive application before it’s ready invites problems I can’t respond to fast enough. A private beta lets me control the pace:

  • Bring in a few people. They use it for real. They find bugs I missed.
  • Fix everything they find. No new testers until the current batch is stable.
  • Repeat. Each wave finds fewer issues. The software converges toward something I’m comfortable putting my name on.

This is the same approach Mitchell Hashimoto used for Ghostty, and for similar reasons — not to manufacture hype or exclusivity, but to match the rate of incoming problems to the rate at which one person can fix them.

What this is not

This is not a “sign up for the waitlist and we’ll get back to you” situation. If you know me, ask me. If you don’t know me but you’re genuinely interested, join the community and make yourself known. I’m not trying to be gatekeepy — I just need to be able to sleep at night knowing I’m not serving search results through code that hasn’t been properly reviewed.

When will it be public?

When we’re confident in three things:

  1. Security. The code has been audited enough that I’m not losing sleep over someone’s queries leaking, their session getting hijacked, or the server getting popped through the image proxy or AI research agent.
  2. Direction. The architecture is settled enough that early adopters aren’t going to hit breaking changes every week. The federation protocol, the engine spec, the config format — these need to be stable before other people build on top of them.
  3. Obvious bugs. The kind of stuff that makes you look stupid. Engines that silently return zero results. Oracles that give wrong answers. Cache corruption. The stuff that’s embarrassing in hindsight but invisible when you’re the only person testing.

The code will be released under AGPL-3.0. There’s no open-core play, no commercial license, no bait-and-switch. The private beta is purely a quality gate.

How to get access

Access to the beta is via mTLS client certificates — see Friend Access for the technical details. In practice: I generate a certificate for you, hand it to you (preferably in person), and your browser uses it to authenticate. No accounts, no passwords, no third-party identity provider.

If you want in, reach out. I’m not hard to find.

Why the code is not public yet

The source will be released — 4got is AGPL-3.0 and always was — but not on day one of the public beta. The reason is respect for reviewers’ time: the codebase is large, still sloppy in places, and subject to sweeping change while feedback comes in. Publishing it now would invite people to read deeply into files that may not exist next month. The plan is to take feedback on the product first, keep the freedom to restructure massively, and release the code once the architecture has settled into a shape worth reading. Soon, not never.

Vision

4got is a marketplace for universal questions and hypertext answers. The goal is a better experience than other search engines in practically every way.

We want a world where people are no longer locked into big tech’s walled gardens for something as fundamental as finding information. When search is controlled by companies that profit from your attention, the incentives are broken — you become the product, and the answers are shaped by who pays the most.

4got exists to change that equation. We’d rather pay for an honest search engine than use a free one that sells our behavior. We’d rather self-host our own intelligence than rent it from a corporation that can revoke access, raise prices, or change the rules at any time.

AI-enriched search for everyday people

AI-augmented search is the most common way people interact with AI today. It’s also the use case where self-hosted, local AI makes the most practical sense: your search engine already has the context (the query, the results, the oracles), so the AI doesn’t need to be general-purpose — it just needs to be good at synthesizing search results.

4got is how we get self-hosted local AI into the hands of everyday people — our friends, our families, people who will never run a terminal command. They just type a question and get an intelligent answer, backed by real sources, with no tracking, no ads, and no corporate intermediary.

Today some of that AI still runs elsewhere. The language model is usually rented from a cheap API provider (an owner can point it at Ollama on their own machine instead), and Jev, the classifier that reads each search, runs at TypeSafe. The About page lists exactly what each of them is sent, and anyone can turn them off. We expect this to be temporary: within a few years, models good enough for this will run on the same machine as 4got. Then the AI is fully private, uses no more power than anything else we do on a computer, and is faster, because nothing waits on a data center.

When big AI providers are forced to compete with self-hosted alternatives that regular people can actually use, they’ll have to compete on quality and honesty rather than lock-in and data extraction.

A marketplace, not a monoculture

We envision a future where people build their own niche search engines — a medical search engine curated by doctors, a legal search engine maintained by lawyers, a recipe engine run by home cooks, a local business directory maintained by the community. These niche engines can be layered into 4got and incorporated in a way where everyone benefits without having to hop between walled gardens.

The federation protocol makes this possible: your 4got instance can query your friends’ instances, share cached results, proxy services, and aggregate trending queries — all without any central authority. Each instance is sovereign, but the network is greater than the sum of its parts.

We don’t need big data centers

Search is the canonical “you need massive infrastructure” problem — the one that justified Google’s existence. But 4got is one Go program with a SQLite database. It fans out to hundreds of engines simultaneously using Go’s goroutine model, caches results intelligently, and serves them back in milliseconds.

It runs anywhere you can leave a computer on: a box at home, an old laptop, a VPS. People reach it through ordinary DNS, or through a mesh network (a WireGuard mesh such as Tailscale, Headscale or NetBird), so friends can use it without it ever having a public address.

If a search engine — the thing that supposedly requires the most infrastructure on the internet — can run on an old laptop under your desk, what else doesn’t need a data center? 4got is proof that the “you need scale” argument is a moat, not a truth.

Design principles

  • Privacy is structural, not optional. No tracking parameters, no behavioral data, no fingerprinting. The server doesn’t know who you are unless you choose to tell it.
  • Intelligence over brute force. 30+ oracle types give instant answers without touching a search engine. The AI research agent synthesizes sources. Smart caching means popular queries are answered in milliseconds.
  • The search comes to you. Jev reads each search and acts on what it judges you’d want, without being asked in any particular words: “is it going to rain in berlin tomorrow” opens the weather card, a search that wants pictures gets images among the results, an ambiguous one gets “which did you mean?”. Every card it opened says so, and No Jev in Settings turns it off.
  • Federation over centralization. Friend instances share caches, proxy services for each other, and collectively detect when upstream engines break. No single point of failure.
  • Transparency over trust. The engine timeline shows exactly which engines responded and how long they took. Privacy badges show tracker counts and ToS grades. The code is AGPL-3.0.
  • Pay for the product, not with your data. Whoever runs an instance covers its costs: the power for a computer they may already own and, for now, the AI calls. Users contribute by solving a proof-of-work puzzle, not by surrendering their privacy.

Future directions

  • Visual search — Accept image uploads for reverse image search, OCR/text extraction, and object recognition. The server-side API endpoint would let client apps (desktop Wayland tools, mobile apps) screenshot and search without leaking images to big tech.
  • Niche engine federation — Standardized protocol for community-maintained search engines to register as 4got backends, discoverable through the instance browser.
  • Search-as-Cron — Saved searches with push notifications when new results appear, turning the search engine from reactive to proactive.

Quickstart

Get 4got running in 5 minutes.

Build

git clone <repo-url> 4got && cd 4got
cd go-server && CGO_ENABLED=1 go build -o 4got . && cd ..

Configure

cp data/config.default.kdl data/config.kdl

Edit data/config.kdl — at minimum change owner-secret to something unique. The default is intentionally invalid.

For AI research, also copy and configure data/ai-research.default.kdl to data/ai-research.kdl with your OpenRouter/Groq/Ollama API key.

Run

go-server/4got

Starts on port 8888. Visit http://localhost:8888.

First use

Your first search triggers the IQ test (image captcha). Solve it once and you get a 24-hour session cookie. Returning users get a quicker PoW challenge instead.

Key pages

  • Settings — /settings (engine toggles, privacy, theme, banners)
  • Admin login — /admin/login (enter your owner-secret)
  • Trending — /trending (popular searches + live feed)
  • History — /history (enable in settings first)
  • AI Research — search the same query twice (double-Enter) or start it with !! (requires deluxe group + AI config)
  • SSH — ssh localhost -p 2222 "your query" (if ssh-port configured)

Federation

To connect with a friend’s instance, add their URL to data/peers.kdl:

peer "https://friend.example.com" {
    secret "shared_peer_secret"
}

Both instances must use the same peer-secret in their config.

User Guide

4got is a metasearch engine. It queries dozens of upstream engines simultaneously, deduplicates and ranks the results, and serves them to you without tracking. This page covers everything you can do from the search bar.

Type a query and press Enter. Results come back ranked by cross-engine consensus: pages that multiple engines agree on float to the top.

Category tabs across the top switch between result types:

TabWhat you get
WebGeneral web results
ImagesPhotos, illustrations, stock images
VideosYouTube, Vimeo, PeerTube, Dailymotion, etc.
NewsRecent articles from wire services and aggregators
MusicTracks from SoundCloud, Bandcamp, Deezer, etc.
ScienceAcademic papers from arXiv, PubMed, Crossref, etc.
ITCode repos, package registries, docs, exploits (Sploitus)
FilesTorrents (Pirate Bay, 1337x, Solid Torrents, etc.)
MapsOpenStreetMap and Photon geocoding
SocialReddit, Lemmy, Mastodon, HN, Lobsters
BooksOpen Library, Gutenberg, Goodreads
Q&AStack Exchange network (SO, Super User, Unix SE, etc.)
PackagesLinux distro packages (Arch, NixOS, Alpine, Void, AUR, Flathub)
WeatherThe weather card (Open-Meteo, OpenWeatherMap)
LyricsGenius
MarketplaceListings from XMRBazaar, priced in Monero; asked only on this tab

Jev: what you didn’t have to ask for

Jev is a classifier run by TypeSafe. It writes nothing; it answers short questions about your search (“which instant answer fits this?”, “would images help here?”), and 4got acts on the answer. On a server that uses it, Jev can:

  • Open instant answers by itself. When no oracle recognises your wording, Jev picks the one you’d want and 4got asks it in words it understands: “is it going to rain in berlin tomorrow” opens the weather for Berlin, “could you set a timer for 5 minutes please” starts a timer. A plain yes/no question can get a one-word “Yes.” or “No.” when Jev is at least 90% sure, never on health, medicine or safety.
  • Choose what the page shows: images, videos or a map among the All results where they help (a search about something to look at, a place, a product, an animal, a person, art, food or a how-to, gets pictures on page 1 and the next ones on every later page, low on the page); the dictionary a word’s card opens on; going straight to a site’s own search when you name it (“youtube rust tutorial”).
  • Choose where it goes: each instant answer, the AI overview and related searches go where they fit. An answer you asked for leads; one that may help goes after the third or sixth result; one that probably won’t goes after the last. On a wide screen an answer for the top stays in the right column. An answer that arrives after the results never takes a place already on your screen. Turn it off with “Answers and suggestions among the results” in Settings › What to show on results.
  • Rank and check results: reorder the first ten by your own “My algorithm” text, bring up one of the fifty after them that fits better, and rank tagged pages lower (moved rows say so), point out results that add nothing over another, and tag results with indicators (“slop detected”, “affiliate listicle”, and your own questions).
  • Work with a small language model: “Which did you mean?” for an ambiguous search, follow-up searches drawn from the pages, a search typed the way you’d talk turned into searches engines handle well, and research after the results.

Some of these are on for everyone, others you turn on in Settings › What to show on results or How to calculate results. About › What leaves this server lists what each one sends. To stop Jev, tick No Jev in Settings › What to show on results, which also stops every other AI feature, or Use no outside services in Settings › Advanced › Oracle & AI, which also stops instant answers looked up at other sites.

Quoted phrases

Wrap terms in double quotes to require an exact phrase match:

"rust async trait" stabilization

Engines that support phrase matching will enforce it; the rest filter client-side.

Time filters

Add a time constraint from the settings or URL parameter time=:

ValueWindow
day or dPast 24 hours
week or wPast 7 days
month or mPast 30 days
year or yPast 365 days

Example: /search?q=linux+kernel&time=week

A time range leaves out the engines that can’t filter by date, as safe search leaves out those that can’t filter. An engine is asked when it filters by date itself, or when its results carry their dates: those are then held to the range, and its undated results left out. A result dated before the range is left out whichever engine found it; one dated only by its day is kept from the range’s first day. On Images, Videos and Music, whose results carry no dates, only the engines that filter by date themselves are asked. The filter bar says so while a time range is set.

Bang commands

Start your query with ! followed by a shortcode. Bangs come in three flavors.

Redirect bangs

These take you directly to the target site. No 4got results page.

BangTarget
!gGoogle
!d or !ddgDuckDuckGo
!bBrave Search
!wWikipedia
!ytYouTube
!ghGitHub
!rReddit
!soStack Overflow
!aAmazon
!imdbIMDb
!mapsOpenStreetMap
!nixNixOS Packages
!archArch Linux Packages
!aurAUR
!cratescrates.io
!npmnpm
!pypiPyPI
!mdnMDN Web Docs

Example: !gh rust async runtime opens GitHub search for “rust async runtime”.

Engine bangs

These run the search through 4got but force results from a single engine.

BangEngine
!braveBrave
!startpageStartpage
!mojeekMojeek
!marginaliaMarginalia
!wibyWiby
!hackernews or !hnHacker News
!youtubeYouTube
!soundcloud or !scSoundCloud
!flickrFlickr
!pexelsPexels
!yandexYandex
!qwantQwant
!bingBing
!baiduBaidu
!yahooYahoo
!wikipedia or !wikiWikipedia
!googleGoogle
!duckduckgoDuckDuckGo

Oracle bangs

These redirect to an external instant-answer service.

BangService
!wolfram or !waWolfram Alpha Short Answers
!ddg-iaDuckDuckGo Instant Answers API

Oracles (instant answers)

Oracles are local computations or lightweight API calls that produce an answer box above the search results. No upstream search engine is involved. They trigger automatically when your query matches a pattern. When none matches, Jev can open the one you’d want anyway (“is it going to rain in berlin tomorrow” opens the weather), and No Jev turns this off. Oracles in the search bar’s + menu turns them all off or back on: off is “Oracles on the All tab” and “Oracles on other tabs” both set to Never.

The cards, by group: Numbers and time · Money · Maps and places · Codes and registries · Network · Tools and generators · Music, news and sports · Words and knowledge. Each is named as in Settings › Advanced › Oracle & AI › Oracle configuration, where it can be set to Always (on its own tab’s every search), Sometimes or Off, and says what leaves this server for it, if anything (the rest is worked out here), then gives searches that open it.

On the All tab, a card that is the whole answer (a sum, a conversion, a pasted token or hash) is shown without asking the search engines; Search the web for … anyway asks them. A place you name is found by this server’s geocoder (Open-Meteo or OpenStreetMap, or Geoapify or LocationIQ on a key), which gets only the name.

Numbers and time

Calculator

Evaluates arithmetic expressions inline.

2 + 2                  → 4
15% of 200             → 30
sqrt(144)              → 12
2^10                   → 1024
sin(1.5)               → 0.9974949866
log10(1000)            → 3
7 mod 3                → 1
tip on 82.50           → 12.38 · 14.85 · 16.50 (15%, 18% and 20%)

Supported functions: sqrt, cbrt, sin, cos, tan, asin, acos, atan, log (base 10), log2, log10, ln, abs, ceil, floor, round, exp.

Supported operators: +, -, *, /, %/mod, ^/**.

Searching calculator alone (or calc, calculadora, calculatrice, calcolatrice, taschenrechner) shows the calculator’s keypad on any tab, with the page.

Unit converter

Converts between units of length, weight, volume, speed, and temperature.

10 km to miles         → 6.2137119224 miles
72 fahrenheit to celsius → 22.2222222222 celsius
5 gallons to liters    → 18.92705 liters
100 kph to mph         → 62.1371192237 mph

Supported units:

  • Length: km, m, cm, mm, mi, yd, ft, in
  • Weight: kg, g, lb, oz, st
  • Volume: l, ml, gal, qt, pt, cup, floz
  • Speed: mph, kph, mps, knot
  • Temperature: celsius/c, fahrenheit/f, kelvin/k

Base converter

Converts between decimal, hex, binary, and octal.

0xff in decimal        → 255
255 in hex             → 0xFF
255 in binary          → 0b11111111
0b1010 in decimal      → 10
0o77 in hex            → 0x3F

Roman numerals

Numbers to Roman numerals and back.

1994 in roman, MCMXCIV in decimal

Statistics

The sum, mean, median, range or standard deviation of a list of numbers.

median 3 1 4 1 5, mean 2 4 6, stdev 2 4 6 8

Coin, dice and random numbers

A coin, dice, a number in a range, or a random string or color. Coins, dice and numbers come from random.org when it answers within a second, and it gets only how many numbers and their range (Coin, dice and numbers from random.org in Oracle configuration turns it off); the rest is drawn here.

flip a coin, roll 2d6, random 1 to 100

Time and time zones

The time now in a city or time zone; a time in one zone read in another, daylight saving included; and your own clock, which your browser keeps.

time in tokyo          → Monday, May 12, 2026 2:30 AM JST
time in America/Chicago → Sunday, May 11, 2026 12:30 PM CDT
3pm est to cet         → 9:00 PM CET, and in summer that Eastern time is on EDT
utc to pst             → the time in Pacific time now
what time is it        → your own clock
time in reykjavik      → by the zone the geocoder gives it

Knows 60 cities by name, and any other place through the geocoder, which gets only its name, as for the weather. IST, CST, BST and AST each name several zones: each is read one way (IST as India’s time, CST as US Central), and the card says so.

Dates and holidays

Days until, since or between dates and holidays; when a holiday falls next; the weekday of a date; an age; the week number; leap years. Each counts from your own day, your browser’s date, and gives the International Fixed Calendar date beside it. Lunar New Year, Diwali, Ramadan, the two Eids, Passover, Rosh Hashanah and Hanukkah come from published tables to 2035 (Diwali to 2031).

days until december 25, when is easter, what day is 2026-12-25, how old is someone born 1990-03-14, what week is it, is 2028 a leap year

Moon phase

The moon’s phase now and the next full and new moons, worked out here (Meeus’s lunar phases), in your own time.

moon phase, next full moon, full moon november 2026

Timer

A countdown or a stopwatch on the page.

timer 5 minutes, 10 minute timer, stopwatch

Battery time

How long a battery lasts at the rate a search states, rounded the way you’d say it, with the sum to check it by.

my battery went down 15% in half an hour        → a full battery lasts about 3 h 20 min (from 80%: 2 h 40 min, from 50%: 1 h 40 min)
battery at 60% dropping 15% every 30 minutes    → about 2 h left from 60%
phone charged 20% in 15 minutes                 → empty to full in about 1 h 15 min

Money

Currency

A converter filled from your search: the amount, both currencies and the result, which follow as you change any of them (without scripts, the conversion alone), ⇅ to swap, and the rate over a month, a year and five years, drawn on this server. The rates are frankfurter.dev’s (fawazahmed0’s currency-api when it cannot answer), which gets only the currencies’ codes.

£339.90 to usd                  → 455.23 US dollar
100 eur in yen                  → 17,637 Japanese yen
convert 50 dollars to rupees    → 4,747.50 Indian rupee
how many yen is 100 dollars
1.299,50 € to usd · 10k usd to eur · 339.90 GBP USD · usd to gbp 100

Codes in any case, symbols (£ € ¥ ₹ ₩ ₽ ₺ ₪ ₫ ฿ ₱ ₦ ₴ ₸ ₿ and more, US$, C$, R$), names and their plurals (“pounds”, “quid”, “bucks”, “euros”, “yen”, “rupees”, “bitcoin”), amounts in either convention with k or m. “$”, “¥”, “kr”, “dollars”, “pesos” and “rupees” are read by your region setting (Canada’s dollar in Canada; the US dollar and the yen where it names none), and the card says how it read them.

Crypto prices

A coin’s price in dollars, euros and bitcoin, with the day’s change. CoinGecko gets the coin’s name.

bitcoin price, price of ethereum, $SOL

Stock prices

A share’s latest price, where this server has a market-data key. Alpha Vantage, Twelve Data or Finnhub gets the ticker. A ticker or a company’s name with “stock” or “share price” (“price” or “quote” too when “stock” comes first), or a ticker alone whose first results are its quote pages. The names are those of about 225 large and much-traded companies; past them, a ticker in capitals (“PLUG stock”).

$MSFT, tesla stock price, msft share price, nvda

Inflation

US inflation by the consumer price index, or what a dollar was worth in a year. The index comes from the US Bureau of Labor Statistics, which gets none of your words.

inflation, what was a dollar worth in 1970, purchasing power of a dollar

Company ownership

Who owns a company, or what it owns; Wikidata gets the company’s name. Shareholders link to the company’s SEC filings, and “bitcoin dominance” gives crypto’s market shares, from CoinGecko.

who owns instagram, alphabet subsidiaries, shareholders of TSLA

Maps and places

Weather

Weather comes from Open-Meteo (and OpenWeatherMap when a key is set), named on the card: the weather now with its chance of rain, the next day’s hours every three hours, and the next three days, or the weekend or the week when asked. “Will it rain” answers with that day’s chance of rain first. Without a place, it uses Your location from Settings › Localization; with none set, the card asks you to set one. Your address is never used to guess where you are.

weather                         → your location's weather
will it rain tomorrow           → tomorrow's chance of rain, at your location
weather in oslo                 → Oslo's, with a link to your location's instead
london weather this weekend

Sunrise and sunset

Worked out on this server by NOAA’s solar equations, in the place’s own time. Only the place’s name goes to the geocoder, as for the weather; without a place, it uses Your location, and with none set the card asks you to set one.

sunset tokyo
when is sunset today            → at your location
sunrise tomorrow in paris

Distance

Distances are straight lines between the two places, with rough walk, bike and drive times where a road can join them and a flight time over 200 km. Without a starting place, it starts from Your location, as the weather does.

distance to chicago             → from your location
distance from detroit to chicago
how far is paris from berlin

Where am I

Your coordinates on a map you can drag, with latitude, longitude and elevation. The position comes from your browser, with your permission, or a guess from its time zone, never from your IP address; Open-Meteo gets the point only when you ask for its elevation.

where am i, my coordinates, latitude

Map

A map of a place; on the Maps tab, of any place you search.

map of lyon, map of the eiffel tower

Places (Foursquare, HERE, OpenStreetMap)

On the Maps tab, places of a kind near a place you name; on any tab, “near me” or “open now” looks around Your location, as the weather does. Foursquare is asked first, then HERE, then OpenStreetMap; each gets the words before “near” and the place’s point, yours rounded to about a kilometre. “Open now” is not checked against opening hours, so the AI overview, where you have one, comes too.

ramen near detroit, coffee in paris, museums around lyon, coffee near me, pharmacy open now

Air quality

The air quality index and its pollutants in a place. Open-Meteo gets the place’s point, and aqicn.org its name where this server has aqicn’s key.

air quality in delhi, aqi london, pollution beijing

Earthquakes

The latest earthquakes, anywhere or within 500 km of a place. The USGS gets the place’s point.

earthquakes near tokyo, earthquakes today, quakes in chile

Events (Ticketmaster)

The next events near a place, where you (Settings › API keys) or this server have a Ticketmaster key; Ticketmaster gets only the place’s point, a radius and the dates. For the deluxe group, Lists from the result pages also reads a list from the first results’ pages, each line citing its page.

concerts near detroit, events in lyon this weekend, things to do in austin

Flights

A flight in the air now, by its number, with its altitude, speed and heading; a route links to Google Flights and Flightradar24. adsb.lol gets the flight number; the OpenSky Network, asked when adsb.lol has nothing, gets none of it.

flight UA123, flight status BA286, flights from JFK to LAX

Codes and registries

Package tracking

The carrier of a parcel’s tracking number (UPS, USPS, FedEx, DHL), with a link to the carrier’s own tracking page. Worked out here: the number goes to no search engine, AI or suggester, since it leads to an address; Search the web for … anyway asks the engines. UPS’s and USPS’s numbers are read alone, by their shape and check digit; FedEx’s and DHL’s look like other numbers, so they need a word with them, and then the carrier you name or the number’s length says whose.

1Z999AA10123456784, 9400111899223817361234, fedex tracking 986578788855

Area codes

Where a North American area code is, or a phone number’s, from a table kept on this server.

area code 517, what area code is 312, (517) 555-0123

Postal codes

The place a postal code belongs to, in about 60 countries; a bare five-digit number is read as a US ZIP. zippopotam.us gets the code and the country.

zip 90210, postal code 10115 germany, 90210

VIN decoder

A vehicle’s year, make, model and more, from its VIN; a bare VIN counts when its check digit is right. NHTSA’s decoder gets the VIN.

vin 1HGCM82633A004352, decode vin 1HGCM82633A004352

Callsigns (amateur radio)

A US amateur radio licence: its holder, class, expiry and a four-character grid square, never a street address. callook.info (the FCC’s records) gets the callsign.

callsign W1AW, W1AW ham radio

Company identifiers (LEI)

A company’s Legal Entity Identifier record from GLEIF, with its legal name, headquarters and status: name the company, or paste its LEI. GLEIF gets only the LEI or the name, and Wikidata the name, to find its LEI.

lei of Siemens AG, apple inc lei

Blockchain lookup

A pasted Ethereum or Bitcoin address or transaction, or an ENS name. Blockscout (Ethereum) and mempool.space (Bitcoin) get only what was pasted.

1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa, vitalik.eth

DOI

A DOI’s links, to the publisher through doi.org and to Sci-Hub.

10.1038/nphys1170, doi.org/10.1000/182

Network

IP geolocation

Look up the physical location and ISP of a public IP address, IPv4 or IPv6, with its reverse DNS (PTR) names.

8.8.8.8                → Mountain View, California, United States · ISP: Google LLC
1.1.1.1                → Los Angeles, California, United States · ISP: Cloudflare · PTR: one.one.one.one
2606:4700:4700::1111   → San Francisco, California, United States · Org: Cloudflare, Inc. · PTR: one.one.one.one

Also responds to where is 8.8.8.8 and geolocate 1.1.1.1. A private address gets Private addresses below instead, and one no one can be at (loopback, link-local, multicast) is looked up nowhere. ipapi.co gets the address, and so does Shodan’s InternetDB, for the ports it last saw open.

Private addresses

Detects private/reserved IPs and tells you what range they belong to.

192.168.1.1            → 192.168.1.1 is a private/reserved address in range 192.168.0.0/16 (Class C private)

Reverse DNS

Looks up PTR records, through this server’s DNS resolver.

rdns 8.8.8.8           → dns.google
reverse dns 1.1.1.1    → one.one.one.one
nslookup 8.8.4.4       → dns.google

DNS lookup

Type a bare domain name (or prefix with dig/dns) to see its A, AAAA, MX, and TXT records, through this server’s DNS resolver.

example.com            → A 93.184.216.34, MX 0 ., TXT "v=spf1 -all"
dig archlinux.org      → A 95.217.163.246, MX 10 mail.archlinux.org, ...

WHOIS

A domain’s registrar and when it was registered, last changed and expires. The domain’s own registry gets the domain, over RDAP.

whois example.com, whois archlinux.org

TLS certificates

A site’s certificate, who issued it and when it expires. This server connects to the site to read it.

ssl example.com, cert github.com, certificate wikipedia.org

CIDR

A network range’s subnet table, whether an address is in a range, or a range split smaller.

cidr 192.168.1.0/24, is 10.1.2.3 in 10.0.0.0/8, split 192.168.1.0/24 into /26

Your IP

Your address as this server sees it, with its country from a list kept here.

my ip, what is my ip, ip

Your browser’s headers

The user agent and headers your browser sends, those most used to tell browsers apart first.

my user agent, my headers

Tor check

Whether you come through a Tor exit, from the list of exits this server keeps.

am i using tor, tor check

Speed test

Your connection’s download, upload, latency and jitter, measured against this server. It runs at once on the IT tab; elsewhere it waits for a press.

speed test, internet speed, how fast is my internet

Benchmark

How fast your browser runs JavaScript, WebAssembly, page changes, hashing, drawing and memory work, with the speed test where your group has it. It runs at once on the IT tab; elsewhere it waits for a press.

benchmark, bench, browser benchmark

Tools and generators

Tools (encode, hashes, text)

Small tools, answered on the page:

  • Encode and decode: base64 encode hello world, url encode a b&c, or paste an encoded blob.
  • Hashes and ids: sha256 hello, uuid v7, or paste a hash to have it named.
  • Text and characters: camelcase foo bar, word count The quick brown fox, shrug emoji.
  • Files and devices: mime type .webp, mac vendor 00:1A:2B:3C:4D:5E, http 418.
  • Secrets (worked out in your browser, so neither this server nor the search engines see them): totp JBSWY3DPEHPK3PXP, how strong is Tr0ub4dor&3, passphrase 6 words. On the strength card, Check against leaked passwords sends five of the forty hex digits of the password’s SHA-1 through this server to Have I Been Pwned.
  • Test values: stripe test card, test iban, random username.

Type / in the search box, or press Ctrl-K, for every tool, each with an example.

Color codes

Converts between hex, RGB, and HSL. Shows a color swatch.

#FF5500                → rgb(255, 85, 0) · hsl(20, 100%, 50%)
rgb(0, 128, 255)       → #0080FF · hsl(210, 100%, 50%)
hsl(120, 100, 50)      → #00FF00 · rgb(0, 255, 0)

Also accepts 3-digit hex (#F50).

Package versions

Check the latest version of an npm or PyPI package. npm or PyPI gets the package’s name.

latest lodash          → lodash 4.17.21
npm express            → express 4.19.2
pip requests version   → requests 2.31.0 — Python HTTP for Humans
pypi flask             → Flask 3.0.2 — ...

JWT

A pasted JSON Web Token’s header and payload, decoded but not verified.

eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIn0.c2ln

Cron schedules

A cron expression in words, with its next runs, or words made into one.

*/5 * * * *, @daily, cron every weekday at 9am

chmod

Unix permissions, octal to rwx and back.

chmod 755, chmod rwxr-xr-x

QR codes

A QR code of the words, drawn on this server.

qr https://example.com, qr code hello world

Password generator

A random password made on this server, 16 characters unless you say.

password, strong password, password 24

Fake identity

A made-up person for forms and tests: a real street in the city, a name, a 555-01xx phone number, an example.com email and Stripe’s test card. It is never a real person.

chicago address generator, fake identity, random address in austin

Token counter

Search token counter, count tokens or tokenizer for a link to /tools/tokens. Paste text or choose a file and every row counts it on your device, in the browser: Claude (an estimate with its range), GPT, Gemini, Qwen and DeepSeek, more under “More tokenizers”. Each row shows an estimate at once and the exact count once its tokenizer has downloaded (a few MB, once). Under it, how much of a model’s context window the text takes, or that it does not fit, and what sending it costs, with where the price came from; “N models” lists the same for every model the tokenizer serves. Nothing you paste reaches the server, and the tool never fills itself from your search: what you type in the search box goes to the search engines. Without WebAssembly (Tor Browser at “Safer”) it shows estimates only. The counting is done by tok (MPL-2.0).

Music, news and sports

Radio

Find internet radio stations by location or genre.

radio tokyo            → [list of stations with inline audio players]
fm berlin              → [list of stations with inline audio players]

Results come from radio-browser.info.

An era instead of a place, radio 1950s, 1940s radio or old time radio 1930s, lists that era’s most played broadcasts in the Internet Archive’s Old Time Radio collection, each a link to its page there. archive.org gets the years and any other words.

Music

A song to play, with links to Spotify, SoundCloud and YouTube, and a preview where this server has a Spotify key. Spotify gets the words when there is a key.

play bohemian rhapsody, listen to daft punk, queen - bohemian rhapsody

Lyrics

A song’s words. LRCLIB gets the song’s name.

bohemian rhapsody lyrics, lyrics to yesterday

News

The latest headlines on a subject. Google News and Hacker News, and Currents, Newsdata and GNews where this server has their keys, get the subject.

news about mars, latest news on ukraine, headlines for france

Sports scores

A league’s games, or a team’s last result and next game. ESPN gets the league, and TheSportsDB the team.

nfl scores, premier league scores, arsenal next match

Words and knowledge

Translation

Translate text explicitly or automatically.

translate hello world to french       → bonjour le monde
translate こんにちは to english        → hello
hello in spanish                      → hola
auf Deutsch good morning              → guten Morgen
en español hola                       → hello

The language can be named before or after the words, after in, en, auf, em or på, by its English name or its own (spanish, español, espanol). Words already in the language named are translated into your first known language instead (en español hola → hello).

Auto-translation: if you search in a language that isn’t in your known_languages list, 4got translates the query and shows the translation in an oracle box above the results. Jev says what language a search of one or two words is in; a name, a brand or a loanword is in none, and gets no box.

Translation backends rotate by priority: a small language model first, then DeepL, Papago (CJK), Microsoft, and a Lingva or NLLB instance the operator names. Rate limits are per-cookie, and apply only while you translate on the server’s key: not with your own key, and not if your group has server_api_keys. Your count is under that key in Settings › API keys, and at the foot of the translation card. See translation.kdl for configuration.

Dictionary

A word’s meanings, a tab for each dictionary that has the word; a word or two searched alone gets the card too. Free Dictionary, Wiktionary, Urban Dictionary (only while safe search is off), and Merriam-Webster and Wordnik on this server’s keys get the word.

define serendipity, what does ubiquitous mean, urban yeet

Unicode

What a character is, or the characters whose names fit, each with a copy button; a name given whole, such as “shrug emoji”, is among the Tools. When no name fits, a small model suggests characters for what you describe, such as “emoji for embarrassment”, with Find characters by meaning on; it gets only the description.

unicode arrows, unicode greek, 0x2603

Recipes

A recipe’s first steps, with a link to the whole. TheMealDB gets the dish’s name.

recipe for pancakes, how to make lasagna

Wikipedia

An article’s summary from Wikipedia, for a name of up to three words with a capital letter, or a who or what question. Wikipedia gets the name.

A Wikipedia abstract shows the first Wikipedia article among the first three results, on English Wikipedia or on a Wikipedia in a language you know, when they have one: “wien” shows Vienna, not “.wien”, the top-level domain.

An English article’s card has a tab for each other encyclopedia with an article about the same subject: Simple English Wikipedia, the Stanford Encyclopedia of Philosophy, the Internet Encyclopedia of Philosophy and the 1911 Encyclopædia Britannica (historical: its views are of its time). Wikidata says which have one; one without it has no tab.

Albert Einstein, who is ada lovelace, what is a quasar

Wolfram Alpha

Queries the Wolfram Alpha Short Answers API. Requires an API key (server-level or per-user via the apikey_wolframalpha cookie).

population of france   → 67.75 million people (2023)
distance earth to mars → 225 million km (average)

Trivial/conversational queries (greetings, etc.) are suppressed. Negative results are cached for 30 days to avoid redundant API calls.

DuckDuckGo instant answers

Returns definitions, abstracts, and factual answers from DuckDuckGo’s Instant Answer API.

albert einstein        → [Wikipedia abstract]

Wikipedia, DuckDuckGo and Wolfram are asked at once; the first of them, in that order, with an answer wins, though after a second only those that have answered count. When DuckDuckGo refuses a lookup, it is asked nothing for ten minutes, and the timing chart says so: “DuckDuckGo IA skipped (paced)”.

AI overview

On page 1 of All, a few sentences above the results answer the search, written by the server’s language model from the search and the first eight results’ titles, sites and snippets (no page is read), citing them: each citation is a chip with the site’s icon and name (Settings › Oracle & AI › “AI citations”: Numbers instead), linking to that result, and hovering it (tapping it on a phone) opens a card of its pages, with a line of each and its picture when one is known. Under the words come the pages it drew on in general and could not cite at a point, when there are any, never one it already cites (Settings › What to show on results › “Sources under the AI answer”: every page it cites, as cards, instead). When the search’s own numbers imply a sum (“my phone storage fills 2GB a week and I have 30GB free”), it gives that answer first, with its arithmetic. When the model adds what it knows beyond the results, it says so (“I also know …”), without naming itself: the line under it names the model. It is on by default wherever the server has a language model, and its place is kept from the first paint, so the results never move when it arrives; when the model has nothing useful, the place folds away. On a search about something to look at, the overview is also given the first pictures’ titles, sites and descriptions (never the pictures themselves), and a picture it cites shows beside its words, through this server.

A search for what a word means, a word or two whose first results are mostly dictionary entries (“prettily”) or a meaning asked for by name (“define prettily”), has the overview first and the word’s dictionary card right after it, both before the results.

There is none when an instant answer already answers the search (a sum, a conversion, the time, the weather, a price), for a site’s name or address (“youtube”, “github.com”), for a secret, on the other tabs, or with No Jev or “Use no outside services”. A dictionary, Wikipedia or battery time card does not stop it. Dig deeper, on the card for whoever may use the research agent, starts it for the search in the overview’s place.

AI answer in the search bar’s + menu chooses: Off; Overview (the default); or Research, the research agent below on each search on page 1 of All, unless an oracle already answers it or a file is attached. Settings › Advanced › Oracle & AI › “AI answer” is the same choice, with Lite (picks oracles, writes nothing) too. “Ambient research”, in the same section, has Jev start the research agent when a cited answer would beat the links.

Attaching files. The search bar’s paperclip, when your group may use it, and File analysis (/analyze) read what you attach: up to 10 files, 50 MB in all. Files that fit one read go to the model whole, each with its size (its tokens and lines, and the most, average and fewest tokens a line). A longer file is read in parts by several model calls at once, each looking for what you typed, and the answer is written from what they noted: up to 40 parts, about 1.3 MB of text, a request, and the answer is told of any part left unread. File analysis shows how many parts have been read as it goes. An image’s text is read off it, and for the groups this server names (deluxe unless it says otherwise) a vision model also describes it, for your question.

AI research agent

Dig deeper, under the AI overview, starts the AI research agent; so does a search made twice or begun with !!, where “AI answer on double-search” is Research, as it is unless you choose otherwise, for anyone who may run the agent; “AI answer: Research” runs it on every search. The agent is a tool-using LLM that:

  1. Reads the top search results
  2. Fetches and analyzes the linked pages
  3. Runs code in a sandboxed Lua environment if needed
  4. Streams findings to you in real time via the oracle box

The agent shows an ETA timer and its steps as it works. Its answer appears above the steps as it is written, with its Markdown drawn (bold, lists, code, links), and starts with the answer itself. When it is done, the box’s foot names the model and offers copy (the answer’s Markdown) and download context: everything the model was sent for the answer (the system prompt, with this server’s environment section named rather than shown, the tools, every message and tool result) as a Markdown file, which another agent can carry on from.

The research agent requires server-side configuration (see ai-research.md). Operators choose the LLM provider (Cerebras, OpenRouter, Ollama, or any OpenAI-compatible API) and can restrict access to specific user groups.

Under the AI overview, after the second result (or where “Answers and suggestions among the results” places it, never above the first), four questions the search raises. They are written in the overview’s own call, from the same results, and a question is kept only when one result’s own words answer it. Nobody on this server asked them, hence the name. Open one and a short answer comes below it: the question is searched as your search would be (the shared cache first), and the language model answers from what that search finds and the result the question came from, citing them as the overview does; the citations open in a new tab. Up to three narrower questions, ones that answer does not already answer, then go at the end of the list. “Search for this” searches the question itself.

Their room is drawn with the page, so the results never move when the questions arrive; with none, it folds away. Nothing more leaves the server until you open a question, and an answer is shared with whoever opens the same question on the same search. They come and go with the overview: AI answer: Off, No Jev and “Use no outside services” turn them off. A test search gets them by naming questions (with overview).

Results as a graph

On page 1 of All, graph at the end of the results line (or the key g) shows the first 40 results as a map of their subtopics (page 1’s and those after them in the same list, up to 40, or page 1’s alone when a page holds 40 or more; a site your rules hide is never one of them), in the results’ place; list brings the list back as it was, and the address keeps #graph, so Back and reload work. Nothing is sent until you press it. Then a small model names the subtopics, once for each search, from the results’ titles, sites and snippets, and Jev sorts each result into one: an island for each subtopic with two results or more, the overviews of the whole subject in the middle (“Overviews”), and a result about two subtopics on the shore between them. An island’s best page is drawn large and bright, “a good place to start”, when Jev rates it at least a solid treatment of one part of its subject; an island with no such page has none. The numbers are the results’ places in the list. “How much to show” sets how sure a placement must be, from “only what’s sure” (90%) to “guesses too” (40%); 60% at first, remembered in your browser alone. A result placed less surely is not drawn, and nothing else moves; the words under the map call it “maybe” in its island. An arrow is a page that links to another, from the pages this server read in the last hour, and a double line two pages with the same text. Jev is also asked whether two results are about the same thing, from their titles, sites, snippets and dates, for up to 45 pairs: two results of one island, or two islands’ best pages, never two of one site. A result that is, at 70% sure or more and as sure as “How much to show” asks, has a dashed ring, and choosing or hovering it rings each result it is linked to, solid, and on a wide screen draws a dashed line to each; under the map, a line lists each group, and a result’s card says which. Under the map, a key to what it draws and the same in words, island by island; tap or hover a result for its title (the link), snippet, subtopic and how sure, or hover a number for its title. With your own algorithm ranking the results, “Peak: my algorithm” makes it decide the peaks. The answers are kept and shown to whoever maps the same search. No Jev and “Use no outside services” draw the pages and their lines alone, and with no line known the map only says why, above the list; Settings › What to show on results › Results as a graph takes the word away. A test search gets it by naming graph.

Settings

Visit /settings to customize your search experience. Preferences are stored as cookies; with a session, Server storage (rerank_storage) is on unless you choose this browser’s cookies (local), and keeps your profiles, research contexts and raised and hidden sites on the server, encrypted on disk. It starts off where this browser already keeps raised or hidden sites or a Goggle in its cookies, or profiles of its own, and where the server cannot encrypt them; your choice in Settings is kept either way.

SettingCookieWhat it does
Safe searchsafesearch0 none (default), 1 moderate, 2 strict. Moderate and Strict leave out the engines that can’t filter.
Your locationhome_locationA place name (“Detroit, MI”) for weather and “distance to X”; only the name is looked up
Temperature unittemp_unitC (default), F or K
Distance unitdistance_unitkm (default) or mi
RegionregionDuckDuckGo’s region code (us-en, uk-en, de-de), sent to each engine in its own form: Brave a country, Bing a market, Startpage its own region and language names. A bare country code works too (uk, de). Blank is all regions, in English
Engine badgesbadgesfirst (default: the engine that ranked the result highest, the rest behind “+N”), always (every engine), multiple (only when >1 engine), never
Row badgesbadge_onion, badge_i2p, badge_xmr, badge_http, badge_young, badge_fresh, badge_slop, badge_affiliate, badge_offlineThe marks a result carries when something holds of its site or page: its onion or I2P address, that it accepts Monero, plain http, a newly registered domain, a new date on the same text, “slop detected”, “affiliate listicle”, a local copy. Each looks as it always has until you change it: your own text or a small pasted SVG in place of its symbol or words (drawn only as a picture, an icon in the badge’s colour; at most 1 KB each and 2 KB together once compressed), a colour, and a place: top right, the bottom bar, or bottom right. Only what you change is stored
Fanout hard windowhard_windowMaximum ms to wait for engine responses (default 1000)
Fanout idle timeoutidle_timeoutStop waiting if no new results arrive in this many ms (default 500). An engine still answering when either of these two ends the wait keeps its row in the timing chart with only the faint dot where it was asked: no star and no words
Cache max agecache_max_ageOldest cached copy a search will use, in minutes (default 43200 = 30 days; 0 = always fresh)
Priority enginepriority_engineEngine that must respond before results are shown
NSFW bannersnsfw_bannersShow NSFW banners on the landing page
Browser historybrowser_historyStore search history in browser localStorage
Server historyserver_historyStore search history on the server: 1; off for everyone by default, on for the server’s owner unless he stores off
Try other words when searching my historyrecall_expandOnly for a search on the History page, with server history: when it finds little, a small model suggests other ways to say what you typed, and those are matched against your history here. Sends only the words you typed, never your history; nothing is kept. off turns it off
Find characters by meaningchar_meaningWhen a character search (“emoji for embarrassment”, “/unicode lightning bolt”) matches no Unicode name, a small model suggests characters, and those Unicode has are listed with copy buttons, under Unicode’s names. Sends only what you described. On unless off
Ask Jev to check my history’s matchesrecall_ask_jevA button, “Which of these is it?”, under pages from your history that match a search on the History page. Nothing is sent until you press it; a press sends what you typed and those pages’ titles and sites, at most ten, never an address or a snippet, to Jev, which puts the likeliest first, with its confidence. At most ten Jev calls per press; nothing is kept. off hides the button; No Jev and “Use no outside services” hide it too
Show my searches, with their times, in Trending’s live feedlive_feed1: your searches appear in Trending’s live feed with when you made them, never who. Anyone can see the live feed. They are logged for it even if this server’s log is off. Needs no other setting
Don’t count my searches in Trendingtrend_countoff: your searches never count toward Trending. Offered where the owner counts every logged search (trending-counts "all", the default)
Count my searches in Trendingtrend_optin1: your searches count toward Trending, and are logged for it even if this server’s log is off. Offered, and read, only where the owner set trending-counts "opted-in"
Likes—No setting: the ♡ shows for anyone with a session whose searches count toward Trending (the boxes above), and only they can like; a link you liked before keeps its ♡, lit, so you can always take the like back. A like is kept on this server and counted with everyone’s under “Liked here” on Trending, which shows a link once at least as many people as a search needs have liked it, never who; the count beside your ♡ is shown the same way. A like changes nothing about how your searches are logged. The share_searches cookie of the removed “Share searches anonymously” box is read by nothing and is deleted on your next visit
AutocompleteautocompleteEnable/disable search suggestions (disable by setting to off)
Show scoresshow_scoresShow ranking scores next to results
Progressive SSEprogressive_sseStream results as they arrive via server-sent events
Speedtest graphspeedtest_graphShow engine response time graph
Oracles on the All tabweb_oraclesEmpty (default): when a search asks for one; never: none
Oracles on other tabssmart_tab_oraclesEmpty (default): each tab’s own on every search, and any a search asks for; off: only when a search asks; never: none
Oracle configurationoracles_off, oracles_sometimesPer oracle: Always (its own tab, every search), Sometimes, or Off
Show faviconsshow_faviconsDisplay site favicons next to results
Search methodsearch_methodPOST or GET for the search form
Bookmarksbookmark_modeEnable/disable bookmark saving
Show filtersshow_filtersThe time, Before, region and safe search bar. Empty (default): wide screens only, on the All tab, in the right column beside the results, and nowhere on a narrow screen or another tab; on: always, on every tab, below the category tabs where there is no right column; off: never
Disabled enginesdisabled_<category>Per-category comma-separated engine IDs to skip. An engine that needs an API key you don’t have and the server doesn’t give you is greyed out, with a link to API keys
Engine weightsweight_<engine>Override ranking weight per engine (higher = more influence)
URL rewritesrewrite_<service>, rewrite_<service>_place, rewrite_archive, rewrite_mutedFrontends for each site and where their link goes (see URL rewriting)
Archive linksarchive_linksThe archive ▾ on results; off leaves it out
Show HN discussionsshow_hnMarks a result Hacker News has discussed with “HN” and the number of threads about that page, “HN 5+” when there are more than five; pressing it lists them, the five with the most comments. On by default for the server’s owner; on turns it on for anyone else, off turns it off; a test search (X-4got-Test: 1) asks only with its own show_hn=on. This server asks Hacker News’s search (hn.algolia.com) about each result’s address, without its tracking parameters and never with your search, and keeps the answer an hour. Off while “Use no outside services” is on
Known languagesknown_languagesLanguages you read, comma-separated ISO 639-1 codes (controls auto-translation, whether a single word English doesn’t have gets a dictionary card in a language you read, and the language Wikipedia, its card and its sister wikis are asked in: the first)
Tracker detectiontracker_detectionHighlight known tracking domains in results
Translation privacytranslation_privateAvoid sending translations through third-party APIs
Tabs (each tab’s switch)tab_modeskey=always, sometimes or never, comma-separated, only where you changed one; the key is a tab’s slug (news) or its label in lower case. Always: in the bar. Sometimes: in the bar when Jev judges a search wants it, after the Always tabs, the likeliest first, at most three; otherwise behind More. Never: behind More. All, Images, Videos, Forums, Shortform and Graphicons start Always, Weather, Torrents and Usenet Never, the rest and your own tabs Sometimes. Jev gets your search (never a secret, an address or a bang) with the names of your Sometimes tabs and what your own ones show; the answer is kept on this server for a day. A page never waits for it: one that comes later shows on the next view. Nothing is asked when no tab is Sometimes, or under No Jev or “Use no outside services”. An own tab can’t take another tab’s name. An older hidden_tabs list reads as Never
Your tabscustom_tabsTabs of your own, each with its switch (Sometimes unless you set it): a label, what it shows, and a profile if you like. Shows is words separated by commas: a kind of result (a tab’s name, or torrents, usenet, shortform, graphicons) picks the results and engines; safesearch:off, safesearch:moderate or safesearch:strict the safe search; up to three other words (“torrents, movies”) are checked by Jev, which gets the first 20 results’ titles, sites and short snippets and hides those it is sure are not that, and the page says how many. Nothing is sent under No Jev or “Use no outside services”
AI streamai_streamOn unless turned off (off): the research answer is drawn as it is written; off, it comes whole at the end
Research debugresearch_debugThe owner’s alone: the research agent’s tool calls and results, whole, and its steps not folded away; on for him unless off
Wolfram API keyapikey_wolframalphaPersonal Wolfram Alpha API key (uses server key if empty)

Settings can also be set via URL parameters on /settings?nsfw=yes&region=de&... to create a shareable preferences link. Opening one changes nothing: it lists what it would set, and only Apply sets it, then goes to the front page. A passport from Settings › Move it elsewhere works the same way, and is used up when you press Apply, not when it is opened. If a passport carries a session, the page says first that it is the identity of whoever made it: they would see what you search here. It says so too of an API key or a download client that isn’t yours. The page lists what Apply leaves out, and why. A browser locked to a profile asks for its PIN, and an export file imported from Settings lists its settings the same way before setting them; it leaves out named profiles, the ranking kept on the server and the directory opt-in, which you set in Settings. Anyone can send a link, so the server cannot tell yours from someone else’s without your press. With with the keys in the link itself ticked, settings and API keys travel in the link, after its #: no browser sends that part to a server, so nothing is kept here, and the link works more than once, for as long as the keys do. Opening it shows the same page before anything is set; a session never travels this way. Copy what this browser keeps, below it, moves what only this browser keeps (searches, pages opened, trails, bookmarks, profiles, home links, themes): it is sealed in this browser and the link holds the key after its #; this server holds the sealed copy in memory for 15 minutes and gives it once to the first browser that opens the link, which lists it and adds it to its own on Apply, deleting nothing. A history locked with a passphrase stays out (Sync my locked history carries it).

Profiles & tabs

Setting profiles allow you to turn virtually any setting in 4got into a mode you can tune into as you search. Tabs primarily exist to filter content, but can also be associated with profiles, if you’d like. Finally, research contexts filter content further based on whether a result has been seen already, or otherwise marked to not be shown again.

Profile rules

Settings › Profiles & tabs › Profile rules switches profiles by themselves. One rule per line, a condition, ->, then a profile’s short name (or default); the first rule that holds picks the profile:

gpc or tor -> incognito
phone and not wifi -> incognito
tab == "images" and phone -> images-light
between(hour, 22, 6) -> night
lang == "de" -> deutsch

Conditions use and, or, not, parentheses, == != < <= > >=, numbers and quoted text; # starts a comment. Three functions: accepts("fr") (the browser lists that language anywhere), known(width) (the value has been reported), between(hour, 22, 6) (wraps past midnight). A line with a mistake is reported beside its line number and skipped; the others still apply. The box holds up to 1000 characters and 24 rules and is stored in the profile_rules cookie.

What the request shows: phone, tablet, desktop (User-Agent and Chromium’s Sec-CH-UA-Mobile), lang (first Accept-Language language), hour, weekday, weekend (in your time zone once the browser has sent it, else UTC), tab, profile (the one you picked), tor (the server’s Tor exit list), onion, gpc (Global Privacy Control), save_data. What only the browser knows, sent in the 4got_env cookie only while a rule reads it: network, cellular, wifi (Chromium on Android and ChromeOS only; Firefox and Safari never say), speed (Chromium only), width, screen, touch, dark, reduced_motion. Settings lists each with its current value.

There is no private variable: a private window starts with no cookies, so it never carries your rules, and browsers hide private mode on purpose. gpc (sent by Firefox in private windows by default) and tor are the honest signals.

What wins over a rule: a locked browser, ?profile= on the address (the + menu’s one-off pick and the tabs that carry a profile, like Torrents), a tab bound to a profile, and a profile picked from the + menu, which holds until the browser is closed (“let the rules choose” on the results page ends it sooner). A results page says when a rule chose: “profile: Incognito, by your rule on line 2”. Without server storage a profile you made lives in the browser, so the page switches to it and loads once more.

Skills

Settings › Profiles & tabs › Your skills keeps your own “/” commands. A skill is a name, words to put before and after what you type, and if you like a tab: /papers with site:arxiv.org after it, on Science. Type /papers transformers in the search box or in your browser’s address bar (with 4got as its search engine), or pick /papers in the “/” palette or under + › Skills, which put /papers before what you typed; Search then runs transformers site:arxiv.org on Science. A skill can’t take a built-in command’s name (/weather, /cidr, /tz and the rest). Up to 12, kept in the skills cookie and saved as you add or delete them; to change one, delete it and add it again. Switching profiles doesn’t change them; passports and the export carry them.

Research contexts

A research context is a named list of what you have already seen. Pick one from the plus menu in the search bar; while it is on, results you have seen are hidden from every later search in it, and a muted line above the results says how many were hidden and why (“3 seen-before and 2 bookmarked in Reading hidden · show anyway · rules”). Contexts need server storage (Settings › How to calculate results › Result reranking & Goggles › “Server storage”: On server).

  • The seen button. Each result has a ✓ in the line with the like and bookmark buttons. It marks the result seen without opening it; the row folds away into “Marked seen · undo”. With “show anyway” on, a seen result’s ✓ is lit, and pressing it takes the result back out.
  • Rules (Settings › Research contexts, under each context): hide what I’ve seen; scrolling past counts as seen (turn it off and the context becomes a read-list: only what you open or mark seen goes in); and hide what’s bookmarked in any of your bookmark folders, for “I have these already”. A folder bookmark made in “Domain” mode hides the whole site.
  • Opening a result and “mark all as read” under the results also mark results seen.
  • One search in several. On a results page, + › Research context › Also add this search to puts the search on screen in your other contexts too: each then hides what it would hide, takes what you open or mark seen, and lists the search among its searches, as if it had been made in it. If one of them is a read-list, scrolling past marks nothing. The muted line names them all (“in contexts thesis and rust”). The address carries them as short ids made with your own key (rctx_also), never their names, with its later pages; a link names nothing for anyone else. A new search is in the active context alone.

Bookmarks and offline reading

Each bookmark folder, Default too, is kept either in this browser or on the server, and the Bookmarks page says which. A new folder starts in the browser. Under Manage folders, Move to server puts a folder on the server, where your other devices on the same cookie see it and it can be shared (Share gives it a link); if the server already has a folder of that name, you choose to merge the two, overwrite the server’s, or pull down the server’s. Move to browser brings a folder back and ends its share link. Bookmarks kept in the browser light up and move to the top of your results in that browser, and nothing about them is sent to the server.

Each bookmark can have tags, a note, and be unread (read later): on the Bookmarks page, edit beside a bookmark changes them, and mark read takes an unread one (its title bold) off your reading list. They are kept where the bookmark is: in this browser, or on the server, encrypted as its title is; a shared folder’s page and file show none of them. The search at the top finds words and “phrases” in titles, addresses, tags and notes, #tag finds a tag, and All · Unread · Read filters; a tag on a bookmark is a link to that search. The words are also looked for in the pages this browser keeps offline. To add the page you are on from any tab, drag Bookmark or Read later from Add and import to your browser’s bookmarks bar: either opens a small form here (title, tags, note, folder, unread), and Save keeps the link and closes it. The page’s address reaches only that form, after the # of its address, which no server sees; this server hears of it only when it keeps that page already or you save it there. Installed as an app on a phone, 4got is in the share menu, which opens the same form. Add and import also reads a bookmark file in your browser (linkding’s export, which keeps its tags, unread and notes, or any browser’s) into a folder kept in this browser, which Move to server can then move. Downloaded bookmark files carry the tags, unread and notes as linkding writes them.

Send bookmarks to (Settings › History & Privacy) sends each bookmark you save on to your own linkding or Readwise Reader, with its title and its folder’s name as a tag (none for Default); tick Likes too and each like goes too, tagged “liked”. Your browser sends to Readwise itself. linkding takes no requests from browsers, so this server sends each bookmark on for you, and keeps neither the link nor your token; your linkding must have an https address reachable from the internet. The address and token stay in this browser; a cookie says only which of the two you chose. A send that fails leaves the bookmark saved, and the row says “not sent to linkding · retry”. Nothing is sent under Use no outside services.

Instant answers and the AI overview have the same ♡ and bookmark, at the right end of their bottom line. They keep the search’s own link on this server (its words and tab), titled with the card’s heading or the search, never the answer. A search kept from the engines (a TOTP code, a password, a passphrase, a hash or a token) has none.

“Read here” on a result opens the article as a clean page on this server, and “Keep offline” there saves it in your browser. A bookmark folder on the server can do this by itself: on the Bookmarks page, under Manage folders, press Keep offline for a folder. From then on, a page you bookmark into that folder (double-click the bookmark button, or hold it on a phone, and pick the folder) is saved as a reading copy in the browser you bookmarked from, and “kept offline” appears beside the button. Pages already in the folder are caught up when you press “Keep the other N offline” under the folder’s name.

The copies live in that browser only, never on the server; another browser keeps its own. Pages that ask not to be copied, that are behind a paywall or sign-in, or whose article is only partly in the page get no copy, and the reason is shown. Read and remove copies on the Kept pages page (/reading), which also opens without a connection; removing a bookmark leaves its copy there. Clearing this site’s data in your browser removes them all.

URL rewriting

Settings › Hostname rewriting opens a site’s results on privacy-friendly frontends: YouTube, Reddit, Twitter/X, Medium, Imgur, TikTok, Fandom and doi.org each have a box for a frontend’s hostname. Several, comma-separated, each get a link.

Each site’s line also says where its link goes:

  • beside (the default): the result keeps its own link, and the frontend’s (yewtu.be) is at the right end of its last line;
  • as the link: the result’s title opens the frontend, and “youtube.com originally” links the page itself;
  • as the link, no note: the title opens the frontend and nothing more is said.

Also among a result’s archive links (on) adds the frontends to the archive ▾, which always asks the archives about the page itself; Mute the link beside a result draws it in the muted colour.

The boxes are empty for everyone but the server’s owner, whose boxes hold the server’s suggestions (yewtu.be, old.reddit.com, nitter.poast.org, freedium.cfd, breezewiki.com, sci-hub.st); an empty box’s grey text shows the suggestion. An operator can fill them for everyone with default-on "rewrite_defaults". Clear a box (or type off) to stop rewriting that site.

Privacy features

  • No tracking. No analytics scripts, no user profiles, no fingerprinting.
  • No accounts. Preferences are stored as cookies in your browser, never on the server.
  • Proof-of-work gate. First-time visitors solve a visual captcha (IQ test). Returning visitors solve a client-side PoW challenge. This keeps bots and scraper farms out without requiring JavaScript tracking.
  • URL rewriting. Links to the big platforms can open on privacy frontends (see above).
  • Tracking parameter stripping. UTM tags, fbclid, gclid, and other tracking parameters are removed from all result URLs.
  • Image proxy. Images can be proxied through the 4got server to prevent your IP from leaking to image hosts.
  • No server-side history by default. Search logging is off unless you explicitly enable it in settings.
  • A lock on what your browser keeps. Settings › Lock what this browser keeps encrypts the searches, trails, “new” marks, opened results and offline pages kept in this browser under a passphrase or PIN that never leaves it. While unlocked, Add a passkey lets a passkey unlock it instead of typing the passphrase, which stays the way in. It needs passkeys’ PRF extension (the page says when yours lacks it). The passkey’s answer is used in the browser and never kept or sent; a passkey your password manager syncs also pairs your other devices to Sync my locked history in place of the passphrase.
  • OpenSearch support. Add 4got as a browser search engine via /opensearch.
  • RSS feeds. Subscribe to search results via /feed/search?q=... without visiting the site.

API

4got exposes a JSON API at /api/v1/search?q=QUERY&cat=web. Per-category endpoints also exist: /api/v1/web, /api/v1/images, etc. POST /api/v1/lens is the image search as JSON (an image or its address; then=region for a part you cut): where it appears, its text and its QR codes. See /api on your instance for full documentation, or /api/openapi.yaml for the OpenAPI 3.0 spec.

A script testing 4got should send X-4got-Test: 1 so its searches stay out of Trending and the public log views. A client that cannot set headers can add test=1 to the address instead; it counts only from a client with no session cookie whose User-Agent does not start with Mozilla/, so a browser opening such a link is normally not marked. Requests with the owner secret in a header count as tests unless they send X-4got-Test: 0. This is separate from opting out of logging: a test search is still logged for the owner, marked as a machine’s.

A test search (X-4got-Test: 1 or test=1) is bare: no Jev classifier, no language model, no Wolfram, no browser sidecar, no keyed reverse image search. Name the extras you are testing in X-4got-Want: rerank,merge, or want=rerank,merge in the address of a single request; want=all gets everything. The response’s X-4got-Bare says what you got and X-4got-Want-Unknown lists names it ignored. The owner secret alone does not make a search bare: the owner’s agents get the whole search. Names: routing, universal, news, saying, forums, shortform, lyrics, placement, indicators, page_audio, source, merge, crawl, rerank, tab_filter, tab_picks, pagedates, platform_go, dict_pick, page_profile, cache_judge, planner, clarify, followups, research_after, world_search, deep, research, translation, query_language, morelike, engine_advice, captions, each_language, recall_expand, char_meaning, ask_jev, quiz, attachments, agent_history, graph, wolfram, sidecar, reverse_image, telemetry.

Keyboard shortcuts

  • Enter — Search
  • Enter twice (same query) — Trigger AI research agent
  • Tab — Accept the suggested completion
  • / — The search box; on the home page, just type
  • j / k — Next / previous result; o opens it in a new tab
  • h / l — Previous / next tab; 1–9 the tab in that place
  • p — Switch profile; c — Switch research context
  • ? — The full list

Settings › Keyboard shortcuts turns the single keys off, for example if they clash with a screen reader.

Configuration Reference

4got uses KDL (KDL Document Language) for all configuration. All config files live in the data/ directory.

The files are KDL v1, read by kdl-go: booleans are bare true and false (KDL v2’s #true and #false are refused). A file that is not valid KDL stops the server at startup with file:line:col and nothing from the file itself, since config.kdl holds secrets; a hot reload (SIGUSR1 or POST /admin/reload) keeps what that file configured and logs the same place. 4got --check-config runs the same checks without starting anything (it reads the same file the server would; see below), names each problem by key or file:line:col, never by value, and exits 1 on any fatal one; the deploy runs it before swapping the binary.

config.kdl

The main configuration file. Every field but default-languages has a default.

The server reads the file FGOT_CONFIG names, and stops if it isn’t there. Otherwise it reads the first config.kdl it finds in the folder FGOT_DATA_DIR names, then in data/ under the working directory, then in ../data/. With none, it says so at startup and runs on FGOT_* environment variables alone. Relative data-dir and db-path in a found config.kdl are relative to the folder above its own (with FGOT_CONFIG, to the working directory).

FieldTypeDefaultDescription
portint8888HTTP listen port
hoststring“0.0.0.0”Listen address
owner-secretstring“CHANGE_ME”Admin password. Also used to derive Ed25519 signing keys for session cookies.
deluxe-secretstring“”Legacy cookie-based deluxe tier secret. Leave empty to disable.
pow-difficultyint17The proof of work’s difficulty: 2^difficulty HashWX hashes on average, in 16 puzzles the page solves with a Web Worker per core. Each bit doubles the wait; 17 is about 0.2 s on a desktop’s cores and about a second on one. Under load it is one bit more
default-search-methodstring“GET”The search form’s method for anyone who hasn’t chosen one (GET or POST).
default-bookmark-modestring“link”The bookmark button on results for anyone who hasn’t chosen: link (specific link), domain, or off.
default-audio-playstring“full”How audio reaches someone who may have Full (the owner, and groups with proxy_audio, with proxy-audio on) and hasn’t chosen: full, through this server, or redirect, from its own site; everyone else gets redirect
audio-full-streamsint6Full audio streams (Settings › Play buttons › Audio) playing at once on this server; a person may have two; past either, 429
default-home-buttonstring“right”Where Home sits in the top bar for anyone who hasn’t chosen: right, with the other links, or left, at the bar’s left edge.
default-safesearchint0Safe search for anyone who hasn’t chosen: 0 none, 1 moderate, 2 strict.
default-languagesstringsnone: requiredKnown languages for anyone who hasn’t set theirs, as two-letter ISO 639-1 codes: "en", or "en" "es"; results in another language are translated into the first, and Wikipedia, its card and its sister wikis are asked in it. It has no default: without it the server does not start and --check-config fails, naming the key.
default-friend-sharebooltrueFor anyone who hasn’t chosen: after a fresh search, send its results to this server’s friends (peers.kdl). Settings › History & Privacy › “Send my results to this server’s friends”.
default-tracker-detectionboolfalseTracker detection for anyone who hasn’t chosen: each result names its site’s known trackers (WhoTracksMe), up to three, then “+N” for the rest. Settings › “Tracker detection”.
overload-relayboolfalseWhen the admission gate sheds a web search, run it on the next eligible friend with relay true (federation.md) instead of showing the busy page. That friend reads the words. Never for “Use no outside services” or Incognito.
captcha-bypass-hoursint720How long a captcha solution grants session access
captcha-bypass-searchesint0How many searches the IQ test (or its long proof of work) grants before it is asked again; the pass ends at this or captcha-bypass-hours, whichever comes first. Each results page counts, a later page and the scroll’s next one too, and each API or streamed search; counted in memory, so a restart forgives. The owner and groups that skip the proof of work are not counted. 0 counts nothing
iq-test-log-daysint90Days to keep each IQ test answer (its pictures and their distortions, the squares ticked, the time taken and the day; nothing about who answered), at most the newest 100,000; the owner console counts the last 7 days. -1 keeps them, 0 records none
iq-test-long-extra-bitsint8How much harder than pow-difficulty the IQ test’s alternative for people who can’t see the pictures is; it is worth the same month as the test. Any proof of work is cheaper for a bot than the pictures, so raise this if bots use it; each bit doubles the wait for everyone (8 is about 40 s on four cores of a desktop; the page shows its estimate). A browser without WebAssembly does it in SHA-256, one bit harder. Below 0 counts as 0
pow-bypass-secondsint300How long a PoW solution grants session access
max-searches-per-dayint200The searches a day (UTC) each person, and each API key, may make through the API, MCP, format=json, /feed/search and /search with a key: everything that uses one key shares its count, and a search the cache answers is not counted. A group may set its own in groups.kdl. Past it: 429, saying whose limit it is and when it resets. 0 is no limit; the owner has none
wolfram-answer-sint3600How long a Wolfram|Alpha answer is kept and shown again instead of asking (0 keeps none)
wolfram-miss-sint2592000How long Wolfram|Alpha’s “no answer” is kept, so the question is not sent again (0 keeps none)
ddg-answer-sint86400The same for a DuckDuckGo instant answer
ddg-miss-sint604800The same for DuckDuckGo’s “no answer”
new-cookies-per-dayint0How many browsers a day (UTC) may take the IQ test, or its long proof of work, for a first cookie; then the test says to come back tomorrow. Anyone who passed within captcha-bypass-hours is not counted; 0 is no limit
long-check-sha256-per-dayint20How many long checks a day (UTC) may be passed in SHA-256, the long check’s way for a browser without WebAssembly. A GPU solves SHA-256 cheaply, so these have their own share, apart from new-cookies-per-day; 0 takes none
fanout-hard-window-msint1000Maximum time to wait for engine responses
fanout-idle-timeout-msint500Stop waiting if no new results arrive within this window
cache-ttl-web-sint1800Cache TTL for web results (seconds)
cache-ttl-images-sint7200Cache TTL for image results
cache-ttl-news-sint300Cache TTL for news results
cache-max-mbint0Delete the oldest cached searches once the cache passes this many MB. 0 never deletes: an old search is only no longer used. Set it if your disk is small (a cached search is about 0.4 MB): the cache shares one database file with bookmarks and history, so a full disk stops those saving too, not only caching.
cache-max-rowsint0The same by number of searches; 0 never deletes.
page-facts-disk-sint31536000The longest anything the server learned about a result page (its text, dates, profile, merge, indicator and comparison answers) is kept on disk, where it outlasts a restart, so a page seen before answers at once after a deploy. Each is kept for the page’s own shelf life, which Jev picks from a minute to a year, and never longer than this; in memory, a day at most (0 = the default)
page-facts-disk-mbint1024What those answers, the pages’ text and profiles and the merge and indicator verdicts may take on disk together; past it the oldest go, to be fetched again when needed. 0 never deletes. A year of one small server’s pages was about 220 MB. Cached searches and history are not in it
site-facts-keep-sint2592000How long a site’s TLS version, Encrypted Client Hello and domain age are kept. Any connection the server makes to the site (reading a page for the AI, the page checks, the reader) renews its TLS facts without another connection (0 = the default)
prefetch-thresholdint2Minimum access count before a cache entry is eligible for background prefetch
prefetch-before-expiry-sint60Prefetch entries within this many seconds of expiry
nsfw-landingboolfalseShow NSFW banners on the landing page
kv-retention-daysint90Server-side per-person rows (profiles, boards) untouched this long are deleted (0 = the default). Swept a minute after start and every 6 h
rate-limit-groupblocknoneHosts that share an upstream’s rate limit: rate-limit-group "name" { host "example.com" … }. A 429 from one of them, or from a subdomain, pauses them all until it passes, as the built-in wikimedia group does for every Wikimedia site. Add only hosts you have seen share a limit: a wrong group pauses an engine that works. A group with no name or no host, a host that is not a hostname, a host in two groups or under Wikimedia, a name used twice or wikimedia stops the boot
disabled-enginesstring“”Comma-separated engine ids this instance never asks: the ones its network cannot reach or that block its address. engines.kdl stays shared; this is the instance’s own list
chat-urlstring“”Where “ask a follow-up” on an instant-answer card leads, e.g. https://chat.example.org/?q={q}; {q} takes the question and the answer (a template without it gets q= appended). Unset: no link
chat-labelstring“ask a follow-up”The link’s wording
map-tilesstring, with attribution and attribution-urlOpenStreetMap’sThe tile server for the map card and the “where am i” map: an http or https template with {z}, {x} and {y}, once each ({s} is filled as a), serving PNG tiles; for example map-tiles "http://127.0.0.1:8080/tile/{z}/{x}/{y}.png" attribution="© OpenStreetMap contributors" attribution-url="https://www.openstreetmap.org/copyright". attribution and attribution-url are the credit shown on every map, OpenStreetMap’s when left out. The tiles come through this server’s image proxy, which pages ask by tile number only, and are kept on disk at least a week, as OpenStreetMap’s are: a visitor’s browser never sees the tile server’s address, or a key in it, and never contacts it. A redirect from the tile server is not followed. A server on your own machine or network works. A template the server can’t use stops it at startup
geocoderstring“”Your own Nominatim’s address (http or https, no query; not the public one), e.g. http://127.0.0.1:8088 or https://example.org/nominatim. Asked first for every place a card looks up, without the one-request-a-second pacing the public Nominatim gets. When it doesn’t answer, knows no such place or finds only a weak match, Open-Meteo and the public Nominatim are asked as without it. Unset: Open-Meteo, then the public Nominatim. An address the server can’t use stops it at startup
research-context-idle-daysint30An agent-made research context untouched this long is forgotten (capped at 365). A person’s own context is forgotten after a year
data-dirstring“../data”Path to the data directory (config files, DB, banners, captcha assets), relative to the working directory (go-server/)
db-pathstring“../data/4got.db”Path to the SQLite database
peersstring[][]Legacy peer URLs (prefer peers.kdl instead)
peer-secretstring“”Shared secret for peer authentication
engine-break-alertsboolfalseWhen an engine keeps failing, ask friend instances whether it works for them and send a notification (ntfy, webhook, event log). The old name self-heal-enabled is still read
notify-ntfy-urlstring“”An ntfy topic URL for operator events (an engine that keeps failing, a consensus check, a report from the failure page, a feedback note by its length and file, a site marked as having friction), besides events.jsonl in the cache dir
notify-webhook-urlstring“”A URL POSTed each operator event as JSON (type, engine, message, timestamp, severity)
quotes-modestring“all”Landing page quote visibility: “all”, “deluxe”, “off”
planner-waitboolfalsePlan searches (planner_live.go): make a search wait for the planner’s decision, up to 1.5 s, and skip the search as typed when the plan says those words are not a useful search, so only the planned searches go to the engines (if none of them brings anything back in time, the words as typed go out after all, and a page without them says so with a “search as typed” link). Off is preemptive searching (Alex’s name for it): the search as typed goes at once, beside the planner. Also a switch on /admin, “Preemptive searching”
caption-max-bytesint2097152Describe images (image_captions.go): the most of a thumbnail read to describe it, in bytes; a larger one is skipped, as no thumbnail. Kept between 65536 (64 KB) and 8388608 (8 MB): up to 24 are read at once
jev-fallbackbooltrueWhen Jev (the TypeSafe classifier) fails on the server’s key, from an error, a timeout, no credit or a rate limit, the research AI’s model in ai-research.kdl is asked instead, and answers in Jev’s shape: which instant answer fits a search, quick yes/no answers, result indicators (each page read whole, in one call) and Rank by my algorithm’s first ten. A yes or no it gives is shown only at 98% sure, a score at 60%, and each says who answered on hover (“via DeepSeek V4.1 Flash”); its answers are kept an hour, in memory. For these three, a single timeout is slow, not down: only an error answer (no credit, a refused key, a 5xx), no connection, or routing’s pause after repeated failures sends them to the model, and a page whose own time ran out asks none. Images, videos and maps in All, the ranking’s comparison and the rest wait for Jev, as before. A person’s own Jev key failing gets no stand-in, and nobody with No Jev or “Use no outside services” gets one. Its calls are their own row, jev_fallback, under Paid providers on /admin, and stop for the day at 20,000 (UTC), as the server-key stops do. Also a switch on /admin
api-keysblock{}Third-party API keys (stackexchange, wolframalpha, deepl, freesound, spotify-client-id, spotify-client-secret). stackexchange is a free Stack Apps key: every StackExchange request carries it, for 10,000 requests a day instead of 300 (engine-spec.md, Host budgets)
allow-cookielessboolfalseA visitor without a cookie may search with no IQ test, after the proof of work cookieless-pow-difficulty sets; over Tor (from an exit, or to onion-address through the Tor daemon on the server), with none (the public tier)
cookieless-pow-difficultyintpow-difficulty + 1The proof of work a search without a cookie pays on an allow-cookieless server, raised under load as pow-difficulty is; each bit doubles the wait. 0 asks none
captcha-messagestring“”The IQ test page’s intro words; empty = “This test is good for a month.”
version-labelstring“”Text beside the version on the home page, e.g. “pre-beta”; empty shows none. Its old name, beta-label, is still read
default-onstring list“”Features on for every visitor, not only the owner (setting names, comma-separated, e.g. ai_rerank, merge, crawl, tls_badges; rewrite_defaults fills everyone’s hostname rewrites with the server’s suggestions); a person’s own choice still wins
banners-enabledstring listthe two chosen 2026-09-21Bundled banners in the home page’s rotation (file names, comma-separated); personal and uploaded banners are not gated
onion-addressstring“”This instance’s .onion address, sent as Onion-Location
server-biostring“”One line about this server that /ami4got gives other 4got servers, shown beside its name on their Instances pages (at most 280 characters; empty: “4got metasearch engine”)
open-to-connectingboolfalse/ami4got says this server welcomes new friends; their Instances pages mark it “open to connecting”
cache-dirstringdata-dirRuntime state that cycles: the database, tracker lists, the ToS;DR cache, events.jsonl
cache-opt-out-groupsstring“all”Who may bypass the shared cache entirely: “all”, “none”, or group labels (space- or comma-separated)
memory-limit-mbint0The runtime’s soft memory limit; 0 = half the machine’s memory (never under 128)
log-engine-timingsboolfalseLog one “Engine X: +Nms” line per engine per search (at ~145 engines a search, most of the log)
disable-wtmboolfalseLoad no WhoTracks.me lists
api-quotasstring“”Limits for keyed APIs, over the registry’s stated ones: "serpapi_google=250/month, typesafe=20000/month"
proxy-audioboolfalsePlay audio results through this server, for the owner and groups with the proxy_audio permission; it is Settings’ Full (default-audio-play); off, everyone’s audio is Redirect and /proxy/audio answers 404
token-counter-publicboolfalseOffer the token counter (/tools/tokens) to everyone; off, to the owner alone. It needs tok’s browser build (make tok-web, which make deploy runs and ships as static/tok/) and is not offered without it
tok-web-dirstringstatic/tokWhere tok’s browser build is served from as /static/tok/; a local server names ~/.cache/4got/tok-web
kv-max-bytes-per-cookieint262144Server-side storage per person (profiles, boards, research contexts), in bytes
locked-syncbooltrueKeep the ciphertext of “Sync my locked history” for people who turn it on; false keeps none
locked-sync-mbint20That ciphertext’s allowance per sync id, in MB
qablockoffQuestions and answers (/questions): qa { require "deluxe"; open-max 200; answers-max 50 }. require names who may ask and answer, a group or all (a key carrying that name may too, over MCP); unset or off, no one, and the pages say this server takes no questions. Reading needs nothing
open-maxint200In the qa block: the open questions this server holds at once, held ones counted; past it, a new question is refused until one closes
answers-maxint50In the qa block: the answers one question takes
report-hideint3In the qa block: the people whose reports take a published question or answer off the pages, into the owner’s Held queue
prefetch-depth-apiint or “inf”“inf”Pages fetched ahead for keyless JSON engines; “inf” is every page (to page 100). Keyed engines are never fetched ahead
prefetch-depth-assetsint3Pages fetched ahead for image, video and music searches
prefetch-depth-scrapedint1Pages fetched ahead for scraped engines (1 = none ahead)
deferred-scheduled-defaultint3Pending scheduled searches per person in no group
deferred-standing-defaultint0Standing searches per person in no group (0 = none)
deferred-standing-totalint100Active standing searches on the whole server
deferred-min-refresh-minint30Fewest minutes between two runs of one standing search
admission-enforceboolfalseAdmission control acts (sheds load); false = it computes and logs only
admission-bandwidth-pctfloat80The share of the monthly traffic cap that admission control counts as full
admission-manual-shedfloat0The operator’s floor for shedding load (0 to 1 and over); 0 = off
traffic-cap-gbint0The provider’s monthly traffic cap in GB; 0 = traffic is counted, with no guardrails
traffic-ifacestring“”The network interface metered (“” = every one but loopback)
traffic-reset-dayint1The day of the month the provider’s cap resets
traffic-reset-hhmmstring“00:00”The time of day it resets, UTC
traffic-low-gb-per-dayfloat10Below this many GB a day left until the reset, heavy endpoints are throttled
traffic-critical-gb-per-dayfloat3Below this many, heavy endpoints answer 503
traffic-throttle-kbpsint128Heavy endpoints’ bandwidth while throttled, in KB/s
traffic-user-retention-daysint0Per-cookie traffic rows: 0 = not stored, -1 = kept forever, N = kept N days
speech-urlstring“”An OpenAI-compatible /v1/audio/transcriptions endpoint you run, for the microphone; unset = no microphone
speech-keystring“”Its bearer token (never sent to the page)
speech-modelstring“whisper-1”The model name sent to it
speech-seconds-per-dayint1800The seconds of audio one person may send it a day, counted as sent (dictation sends the recording so far every 2.5 s); past them it is refused until midnight UTC. 0 = no limit; the owner has none

Environment variable overrides

Every config.kdl field has a corresponding FGOT_* environment variable:

  • FGOT_PORT, FGOT_HOST, FGOT_OWNER_SECRET, FGOT_DELUXE_SECRET
  • FGOT_POW_DIFFICULTY, FGOT_CAPTCHA_HOURS, FGOT_POW_SECONDS
  • FGOT_MAX_SEARCHES, FGOT_FANOUT_HARD_WINDOW_MS, FGOT_FANOUT_IDLE_TIMEOUT_MS
  • FGOT_CACHE_WEB_S, FGOT_CACHE_IMAGES_S, FGOT_CACHE_NEWS_S
  • FGOT_DATA_DIR, FGOT_DB_PATH
  • FGOT_DEFAULT_LANGUAGES (en,es), which a server with no config.kdl needs
  • FGOT_CONFIG: the config file to read, instead of looking for one

KDL config files

4got uses KDL (KDL Document Language) for structured subsystem configs. Each subsystem looks for its config in two places:

  1. A dedicated file (e.g. data/peers.kdl)
  2. A named section inside any *.kdl file in data/ (e.g. a peers { ... } block inside data/conf.kdl)

You can use either approach but not both for the same subsystem. This lets you keep everything in a single conf.kdl or split into per-subsystem files.

peers.kdl

Configures the friend/peer network for cache sharing and service proxying.

// Services this instance allows friends to proxy through us
allow-proxy "translation" "wolfram" "autocomplete"

// Prefer a friend for specific services (for groups with friend_proxy)
// prefer-friend "alice" for="translation,wolfram"

// Searches each relay friend may ask us to run in an hour (default 60)
// relay-per-hour 60

// Keep a friend's cached copy in our cache when it answers a search (default true)
keep-friend-copies true

peer "instance-b" {
    url "http://127.0.0.1:8890"
    // Optional mTLS:
    // cert "/path/to/client.crt"
    // key "/path/to/client.key"
    // Optional: how far this friend's cached copies count
    // trust "preview"
    // Optional: run searches for each other (off by default)
    // relay true
}

trust is "full" (the default when the line is absent) or "preview". With full, a copy from this friend’s cache is our cache hit: it is shown, kept in our cache with the friend’s age, and no engine runs. With preview, the copy is shown at once, labelled “on a friend”, and our engines search behind it to refresh our own cache, as for a stale entry; the friend’s copy is never kept as ours. That refresh passes the admission gate (a shedding server serves the preview and searches nothing), and at most one starts per search a minute. Any other value stops the server at startup, naming the line; on a hot reload (SIGUSR1) the file is refused. Even a valid reload does not change the friend list or their trust: those take effect on restart (a reload applies only the proxy permissions). A person’s own cache rules (“Never older than”, “Only if it has results from”) judge a friend’s copy first, so the stricter of the two always wins.

keep-friend-copies (default true) keeps a full friend’s copy in our cache with its age once it has answered a search here, so the next search for it needs no friend; false shows the copy and keeps nothing. Any other value stops the server like a bad trust; it is applied on a reload. The results line names the friend: “(cached 4 minutes ago on alice)”.

relay true (default false; any other value stops the server like a bad trust) lets this friend and this server run searches for each other through POST /api/v1/relay (federation.md). This server runs that friend’s searches only if its pubkey is listed too, since a relay ask is known by its signature, and at most relay-per-hour of them an hour (default 60; 0 refuses every one). The owner’s AI research may send searches to it in turn, which also needs its pubkey: each ask is addressed to that key. Like trust, relay takes effect on restart; relay-per-hour is applied on a reload.

groups.kdl

Defines user tiers/groups and their permissions.

group "deluxe" {
    allow "server_api_keys" "friend_proxy" "priority_fanout"
    label "deluxe"
}

group "researcher" {
    allow "server_api_keys"
    label "researcher"
}

Known permissions: server_api_keys, friend_proxy, priority_fanout, agent_contexts, no_captcha, peer_cache. Groups are assigned to users by identity via the admin panel (/admin/users).

A group named anywhere that groups.kdl does not define stops the server at startup and fails --check-config, naming the file, the key, the name and the groups there are; the owner’s editor refuses to save it. Groups are named in oracle-permissions.kdl, ai-research.kdl’s require keys, image-proxy.kdl’s require, discovery.kdl’s groups=, and config.kdl’s safesearch-floor-groups and cache-opt-out-groups. A name may be a group, its label, or a permission a group allows; all, none, off and owner are the files’ own words.

agent_contexts lets the group’s agents keep research contexts on this server through the API and MCP (context=); without it they search without one. The owner always has it, and deluxe as shipped. Listing and forgetting your own contexts are never gated.

no_captcha (or no_pow): the group’s people are never asked for the IQ test or a proof of work. A session of theirs that has ended is renewed on their next visit, with the same identity (while the browser keeps its cookie, 30 days past the session), and captcha-bypass-searches does not count their searches. Someone removed from the group keeps the session already issued until it ends (captcha-bypass-hours).

peer_cache lets the group’s people ask this server’s cache as a friend does (GET /api/v1/cache), on a server with a peer-secret; without one it answers anyone. A friend server needs no group: it is known by the peer secret.

friend_proxy lets someone use what a friend lends (prefer-friend: translation, Wolfram|Alpha). The owner always has it, and so does any group that allows it (deluxe and translator as shipped). Anyone else’s text goes to this server’s own backends, never to the friend.

storage-mb N is what one person in the group may keep on this server, all kinds together: their server history, bookmarks with folders and likes, settings and research contexts, pastes with their files, and scheduled searches (-1 no ceiling). A group without it takes the default group’s; with none anywhere there is no ceiling, and the owner never has one. Past it, new history, bookmarks, likes and pastes are not kept, the bookmark and the ♡ say “your space here is full”, and Settings › Your data shows how much is kept, by kind, and the ceiling. user_kv also keeps its own per-person cap (kv-max-bytes-per-cookie); a synced locked history has locked-sync-mb.

max-searches-per-day N is the searches a day each person in the group may make through the API and MCP, in place of config.kdl’s max-searches-per-day (0 no limit). It holds too for an API key that names the group: tick the group when making the key at /admin/users, or on the key’s row there (Set groups), which changes an existing key’s groups without reissuing it. A key in two groups takes the more generous limit, no limit beating any number. A key’s count is shared by everything that uses it, and the key’s own searches a day on /agents holds beside it, the fewer of the two binding. A group without it takes the default group’s, else the server’s; the owner has none. A value that is not a whole number of 0 or more stops the server at startup and fails --check-config.

server_api_keys is what lets someone use the keys in api-keys. The owner always has it. An engine that needs a key runs on the server’s key only for these groups; anyone else’s search asks it with their own key or skips it. The Places card’s Foursquare and HERE keys work the same way, and anyone else gets OpenStreetMap’s places. A scheduled or standing search keeps the coverage of whoever made it.

key-limit "gnews" "10/day" is what one person in the group may spend of the server’s key for that id (/min, /hour, /day or /month; "inf" for no limit), on the keyed search engines, the news and stock cards (also in the research agent’s tools), scheduled searches and the image search (Google Vision and SauceNAO; a person the server’s keys do not cover draws it only with the IQ test’s session). Each use made for them is taken from their share and counted under their identity, per day for this month, beside their own keys’ counts; past their share the server’s key is not theirs until the window turns, and someone with no session gets none. Their own key, when they have one, comes first and spends no share. Delete my server data keeps a share’s current window. A group without a line for a key takes the default group’s; the owner has no limit. total="60/day" beside the limit is what everyone the line holds for may spend together, counted under the group’s name and no person’s: the shipped default group takes at most two thirds of the Google Vision and SauceNAO stops, so the owner and the groups with server_api_keys (which say "inf", the stops alone) keep a third. A scheduled search takes the group the server has its maker in (user_groups), else the default group’s. Settings › API keys shows it as gnews 1/10 today (34/100 shared), and a results page whose engine or card was refused says “Your share of GNews is used; it resets at midnight UTC.” A key-limit on a key nothing spends per person is a warning at start and in --check-config.

captcha.kdl

Configures the pre-rendered captcha (IQ test) pool.

pool {
    distorted-target 500     // target pool size for distorted tiles
    distorted-batch 50       // generate this many per cycle
    prebuilt-target 100      // target pool size for assembled captchas
    prebuilt-batch 20        // assemble this many per cycle
    cycle-count 25           // number of generation cycles at startup
    cycle-interval-min 5     // minutes between background replenishment cycles
}

autocomplete.kdl

Configures autocomplete suggestion backends and their weights.

backend "duckduckgo" weight=1 enabled=true
backend "brave" weight=1 enabled=true
backend "qwant" weight=1 enabled=true
backend "yahoo" weight=1 enabled=true
backend "wikipedia" weight=1 enabled=true
backend "google" weight=1 enabled=false
backend "bing" weight=1 enabled=false
// … and swisscows, mwmbl, yandex, privacywall, seznam, baidu, naver, quark,
// 360search, sogou, dbpedia, all off in the shipped file

Higher weight = more influence when merging suggestions from multiple backends. Only the backends the file names are asked; one it names with enabled=false is not. Every backend on the list gets what people type into the search box, so turn on only those you would send it to.

translation.kdl

Configures translation backends with priority routing and per-user rate limits. A limit applies only to someone translating on the server’s key whom the server doesn’t cover: not with their own DeepL, Papago or Microsoft key, and not for the owner or a group with server_api_keys. Settings shows each person their count under that key in API keys, and the translation card shows it at its foot. Lingva and NLLB are asked only where the operator names an instance (lingva_url, nllb_url among the API keys): the public Lingva instances no longer translate.

// Language sets (non-overlapping)
set "cjk" "ja" "zh" "ko"
set "eu" "de" "fr" "nl" "pl" "es" "pt" "it" "ro" "sv" "da" "no" "fi" "cs" "hu" "el"

// Backends: priority (higher=tried first), languages ("all" or set name),
// limit-per-cookie, reset hours
backend "llm" priority=4 languages="all" limit=0
backend "deepl" priority=3 languages="eu" limit=500 reset-hours=24
backend "papago" priority=3 languages="cjk" limit=50 reset-hours=24
backend "lingva" priority=2 languages="all" limit=100 reset-hours=24
backend "nllb" priority=1 languages="all" limit=0
backend "microsoft" priority=2 languages="all" limit=30 reset-hours=24

instances.kdl

Configures the instance browser (shows other 4got instances).

fetch-interval-min 60

friends {
    // instance "https://search.friend.example.com"
}

public {
    // instance "https://public.4got.example.com"
    // url "https://git.example.com/4got/instances/raw/branch/main/instances.txt"
}

A url in public names a public list of instances, read every fetch-interval-min: one address a line (# starts a comment), or a server’s own /ami4got or /ami4get answer, whose instances it lists (url "https://4get.ca/ami4get" brings 4get’s public instances). What a list names is asked only at public addresses, as friends-of-friends are, up to 200 in all. A server that answers /ami4get as 4get does shows with a 4get tag; the failure page never offers it, since 4get’s searches are at other addresses.

ai-research.kdl

Configures the AI research agent that synthesizes search results.

enabled true
mode "lua"                    // "lua" (sandboxed) or "off" — no "bash" mode exists
provider "cerebras"
model "llama3.1-8b"
api-key "csk-..."
base-url "https://api.cerebras.ai/v1"
max-runtime-seconds 360       // six minutes a job
lua-timeout-seconds 180       // three minutes a Lua run
max-tool-iterations 20        // required while enabled: the server won't start without it
require "deluxe"              // group permission required
instructions-require "deluxe" // who may give the AI their own instructions (default: deluxe, whatever require says)
overview-require "all"        // who gets the AI overview above All's results: "all" (default), "off", or a group
vision-require "deluxe"       // whose attached images the vision model reads: a group (default deluxe), "all", "owner" or "off"

See ai-research.md for full details.

image-proxy.kdl (optional)

Configures the SQLite-backed image proxy cache. With no section it is on, with these values, for the require group; enabled false turns it off. A picture is served first as fetched and re-encoded afterwards, one at a time, behind every search (JPEG losslessly, PNG at distance 1, nothing over 1 MB); the rest wait their turn.

enabled true
hold-time-days 30             // evict images unserved for this many days
jxl-reencode true             // reencode to JXL (requires cjxl binary)
redownload-threshold 999      // re-fetch original after N serves
require "deluxe"              // group permission required ("" for everyone)

door.kdl (optional)

Lets the people a friend’s 4got vouches for into a web service of yours, with a cap per friend; see Doors. A line that cannot mean anything stops the start; a reload puts a change in effect.

name "Glen's films"   // what a refused person reads
friend "alice" key="<alice's 4got key, from her /door page>" people=10 url="https://search.alice.example"

engines.kdl budgets

engine-budget "duckduckgo" per-minute=2 per-hour=20 per-day=120

An engine-budget line is the most one engine (a Go engine’s id or an engine block’s) is sent a minute, an hour and a day: its ceiling. Under it the server learns an allowance: a refusal (a captcha, a 429, 403 or 400, or answers gone empty after rows) halves the minute’s and the hour’s, never below one, and each 30 minutes without one, once the suspension it began ends, wins a tenth of the ceiling back. An engine with no line has 30 a minute and 1,000 a day. The allowance, the backoff and the hour’s and day’s counts outlive a restart. All three numbers are required, each above 0 and no more than the next; a wrong number, an engine named twice or a name that is no engine stops the boot and fails --check-config. The shipped file names DuckDuckGo, Brave, Startpage, Yahoo, Swisscows, PrivacyWall, Karmasearch and mwmbl, from measurements made from a server. /admin/health shows what each engine answered this hour and in the last 24 hours, with its allowance beside its ceiling; the counts are kept 30 days, with no query, key or address. Budgets shared by several engines on one host are host-budget lines (the engine spec).

The unified conf.kdl option

Instead of separate files, you can put everything in a single data/conf.kdl:

peers {
    peer "instance-b" {
        url "http://127.0.0.1:8890"
    }
}

groups {
    group "deluxe" {
        allow "server_api_keys"
        label "deluxe"
    }
}

translation {
    backend "lingva" priority=2 languages="all" limit=100 reset-hours=24
}

The resolver scans all *.kdl files for matching section blocks. It is an error to have both peers.kdl and a peers { ... } section in another file.

Users can customize their experience via cookies set on the /settings page:

CookieValuesDescription
safesearch0 (default), 1, 2Safe search: 0 none, 1 moderate, 2 strict
temp_unitC (default), F, KTemperature unit for the weather card
distance_unitkm (default), miDistance unit for the distance card, and wind speed on the weather card
home_locationa place name, URL-escapedWhere weather and distances start (“Detroit, MI”)
regionDuckDuckGo’s region code (us-en, de-de), blank for allThe region engines are asked for, each in its own form (go-server/regions.tsv)
badgesfirst (default), always, multiple, neverEngine badge display mode: first shows the best-placed engine and folds the rest behind “+N”
hard_windowinteger msMaximum time to wait for engine responses (default 1000)
idle_timeoutinteger msStop waiting if no new results in this window (default 500)
cache_max_ageinteger minutesOldest cached copy a search will use (default 43200 = 30 days; 0 = always fresh)
cache_needscomma-separated engine IDsA cached copy (ours or a friend’s) counts only if it has rows from every one of these engines; otherwise the search runs again. Unknown IDs are dropped. Blank (default) = any copy
priority_engineengine ID or “none”Engine that must respond before results are shown
disabled_web, disabled_images, etc.comma-separated engine IDsDisable specific engines per category
weight_<engine>integer >= 1Override engine weight in result ranking
rewrite_<service>hostnames (comma-separated), “off”, “none”, “disabled”The site’s frontends; unset is the owner’s suggestions for the owner (or everyone, with default-on "rewrite_defaults") and none for anyone else
rewrite_<service>_place“replace”, “replace_only”The title opens the first frontend, with or without “ originally”; unset is beside the result’s own link
rewrite_archive“off”Leave the frontends out of the archive ▾
rewrite_muted“on”Draw a frontend’s link beside a result in the muted colour
known_languagescomma-separated ISO 639-1 codesLanguages the user knows (for auto-translation, a dictionary card in one of them for a single word English lacks, and the first for Wikipedia, its card and its sister wikis)
apikey_wolframalphaAPI key stringPersonal Wolfram Alpha API key
history_enabled“1”Older name of server_history; still read, and any Settings save clears it
autocomplete“off” to disableEnable autocomplete suggestions
bookmark_modelink (default), domain, offBookmark flag on each result: the exact link, the site, or none
audio_playfull, redirectHow audio plays: full through this server (only for those who may have it), redirect from its own site; unset is config.kdl’s default-audio-play
page_audioon, offPlay buttons for other sites’ audio (Jev); on for the owner, off for others until they turn it on
home_buttonright (default), leftWhere Home sits in the top bar, on every page; the default is config.kdl’s default-home-button
new_tabonLinks in the results that leave 4got open in a new tab (off by default)
kbdoffSingle-key shortcuts (j, k, p, …) and the home page’s type-anywhere off (on by default)
archive_linkson, offShow archive links on results
show_scores“1”Show ranking scores next to results
search_methodGET (default), POSTHTTP method for search form
tab_modeskey=always|sometimes|never, comma-separatedEach tab’s switch where it differs from the default; an older hidden_tabs list reads as never
tracker_detection“1”Highlight known tracking domains

Engine KDL Specification

This document specifies the KDL format for defining generic engines in data/engines.kdl. Generic engines are parsed by go-server/generic_engine.go and registered alongside hand-written engines (Brave, Google, etc.) at startup. A single engines.kdl file defines all ~274 generic engines.

Engine block structure

Each engine is a top-level engine node with a quoted string ID and a child block of properties:

engine "my_engine" {
    name "My Engine Display Name"
    categories "web" "news"
    search-url "https://example.com/search?q={query}&page={page}"
    method "GET"
    result-type "json"
    results-path "data.items"
    title-path "title"
    url-path "link"
    content-path "description"
    page-size 20
    paging true
    first-page 1
}

The engine ID (the string after engine) is the unique identifier used in logs, cache keys, weight cookies, and the admin UI. It must be a short slug (lowercase, underscores allowed).

Attributes reference

Identity

AttributeTypeRequiredDefaultDescription
namestringNoSame as IDHuman-readable display name shown in engine badges and the settings page.
categoriesstring listYes(none – engine is skipped if empty)Space-separated quoted category slugs. Valid values: web, images, videos, news, music, science, it, files, maps, social, books, qa / q&a, packages, weather, lyrics, marketplace. An engine with no parseable categories is silently skipped during registration.
safe-searchstringNo""What the engine can return at safe search Moderate or Strict: "family" (nothing to filter: code, docs, reference, science, maps; asked at every level) or "moderate" (little to filter: news, books, music, stores; asked at Moderate, not Strict). An engine with neither is not asked at Moderate or Strict.
safe-valuesstringsNo(none)What {safesearch} becomes at None, Moderate and Strict, for an engine with a filter of its own, e.g. safe-values "both" "false" "false" (PeerTube’s nsfw) or safe-values "" "&nsfw=false" "&nsfw=false". An engine with them is asked at every level, when its search-url or body-template holds {safesearch}; without it they are ignored, which the load says. With safe-search "moderate" too, it is asked at Moderate with its filter and not at Strict (the boorus, 7TV).

Request

AttributeTypeRequiredDefaultDescription
search-urlstringYes–URL template. Placeholders: {query} (URL-encoded query), {page} / {pageno} (page number = (page-1) + first-page), {offset} (offset = (page-1) * page-size + first-page), {lang} and {country} (the region’s language and country, from go-server/regions.tsv; en and us for all), {safesearch} (the person’s level, 0, 1 or 2, or what safe-values says for it), {query_json} (the words as the inside of a JSON string, then URL-encoded: for a JSON value carried in the address, as Pinterest’s search is; in a body-template, {query} is already JSON-escaped).
methodstringNo"GET"HTTP method. "GET" or "POST".
body-templatestringNo""POST body template (same placeholders as search-url). Only used when method is "POST".
{query_path}placeholderNo—In search-url, the query encoded as {query} is but a space as %20, not +: for a path segment (pixiv’s /illustrations/{query_path}) or a site that refuses + (Rumble’s q=).
before-paramstringNo""Added to the address (after &) when a search has a Before date (?before=YYYY-MM-DD, before_date.go), e.g. filter=to_publication_date:{before_last}. Placeholders: {before} (2012-01-01), {before_last} (the last day included, 2011-12-31), {before_last_ymd} (that day as 20111231), {before_unix} (the cutoff in unix seconds).
before-querystringNo""Added to the words of the search when it has a Before date, for engines whose date bound is query syntax, e.g. " AND submittedDate:[199101010000 TO {before_last_ymd}2359]". Same placeholders. Either way, rows dated on or after the cutoff are dropped afterwards.
time-paramstringNo""Added to the address (after &) when a search has a time range (past day, week, month or year), e.g. created_after={since_unix}. Placeholders: {since_date} (the range’s first day, 2026-10-25), {since_unix} (its midnight UTC in unix seconds) and {time} (from time-values). An engine with it, or with {time} in its search-url, is asked over a time range (time_range.go); one with neither is asked only if its rows carry dates (published-path, date-selector), and is held to them.
time-valuesstringsNo(none)What {time} becomes, in the address or in time-param: without a time range, then for a past day, week, month and year, in that order, e.g. time-values "all" "day" "week" "month" "year". A range whose value is "" is not sent, and the engine is then asked for it only if its rows carry dates.
near-biasstringNo""For a map engine: added to the address when the search reads “X near Y”, “X around Y” or “X in Y” (for “in”, Y a town or city, not a state, country or island), Y is a clear place, and the person may use the map or Places card. The engine is then asked for X (common words translated, e.g. coffee → cafe) instead of the whole phrase. Placeholders: {lat}, {lon} (Y’s point) and {bbox} (about 5 km either side, as west,south,east,north), e.g. &bbox={bbox}&lat={lat}&lon={lon} (Photon) or &viewbox={bbox}&bounded=1 (Nominatim).
headerssub-blockNo(none)Custom HTTP headers as key-value pairs. Default headers (User-Agent, Accept, Accept-Language, DNT) are always sent; entries here override or add to them.
first-visitstringNo""A page whose visit hands every visitor the cookies the engine’s search wants (Bilibili’s home page sets buvid3 and b_nut; its search answers 412 without them). This server visits it as itself (the engine’s User-Agent), reads the cookies its own answer sets (a redirect is not followed), and sends them with every search: one visit for every search waiting on it, kept until one of them expires or a day. A search refused with them (412, 401 or 403) drops them, and the page is not visited again for a minute; a visit that sets none sends no search. No cookie is ever made up.
token-betweentwo stringsNo(none)With first-visit: its page hands out a token instead of cookies, the text between these two marks in its answer (token-between "'currentSessionId', '" "'": Boardreader’s session id; "\"token\":\"" "\"": Vimeo’s guest JWT), and {token} in search-url and in header values is it ("Authorization" "jwt {token}"). The page is asked with the engine’s headers but those holding {token}; the token is kept 5 minutes, else as first-visit’s cookies are.
query-tagbool or stringNofalse{query} is the words as one hashtag: their letters and digits, joined and lowercased (framework laptop → frameworklaptop). A string goes between the words: query-tag "_" asks a booru for its tag thumbs_up. A search with none is not sent. Used by mastodon_social, seventv, danbooru and safebooru.

Response parsing – HTML mode

Used when result-type is "html" (or "HTML" or "xpath").

A selector ending in @attr reads that attribute of what it finds (img@alt); @attr alone reads the row’s own (@cast: Rotten Tomatoes’ rows carry their facts as attributes); as content-selector, a list in it reads with a space after each comma (“Timothée Chalamet, Zendaya”), a number’s “1,000” as it is.

AttributeTypeRequiredDefaultDescription
result-typestringYes–Set to "html" for CSS-selector-based parsing.
results-selectorstringYes (for HTML)""CSS selector for result container elements. Each match becomes one result.
blocked-ifstringNo""CSS selector for what only a captcha or block page holds, e.g. blocked-if "form#gs_captcha_f": an answer holding it fails the engine (classed blocked, as health and the timeline show it), never read as no results.
title-selectorstringNo""CSS selector (relative to result container) for the title text.
url-selectorstringNo""CSS selector for the URL. Extracts href attribute first; falls back to text content.
content-selectorstringNo""CSS selector for the snippet/description text.
thumbnail-selectorstringNo""CSS selector for a thumbnail image URL: the picture of an image or video result, and the one drawn beside a web or news row. "." is the row’s own text (Emojipedia’s character, ahead of its name); thumbnail-template makes an address of what it reads.
image-from-thumbtwo stringsNo(none)The picture itself, for the Images viewer: the thumbnail’s address with its first "<old>" replaced by "<new>", e.g. image-from-thumb "/280h/" "/960w/". In JSON mode too, where image-path is not set or empty. Without either the viewer shows the thumbnail.
date-selectorstringNo""CSS selector for the result’s publication date. Accepts absolute forms (Jan 5, 2024, 2024-01-05) and relative ones (3 days ago). Unparseable values are ignored rather than rendered wrong.
attribute-selector "Label" "css"repeatableNo—An extra fact read from the row by CSS selector (@attr takes an attribute), e.g. attribute-selector "Seeders" "td.seeds" say="{count} seeders". Takes the same say= and more selectors tried in turn as attribute.

Response parsing – JSON mode

Used when result-type is "json".

AttributeTypeRequiredDefaultDescription
result-typestringYes–Set to "json" for dot-path-based JSON parsing.
results-pathstringNo"" (top-level array)Dot-separated path to the results array in the JSON response. Example: "message.items" navigates {"message":{"items":[...]}}.
empty-is-noneboolNofalseAn empty answer is nothing found, not a failure: Safebooru’s when nothing matches. Without it an empty answer is unreadable, as a soft block or a CDN’s stub is.
title-pathstringsNo""Dot-path to the title field within each result object. More paths after the first are tried in turn while the title is empty: Danbooru’s characters, then its series, then its tags.
url-pathstringNo""Dot-path to the URL field.
content-pathstringNo""Dot-path to the snippet/description field.
thumbnail-pathstringNo""Dot-path to a thumbnail URL field: the picture of an image or video result, and the one drawn beside a web or news row.
thumbnail-templatestringNo""Builds the thumbnail’s address from what thumbnail-path (or thumbnail-selector) reads: {value} is that value, {codepoints} the emoji it begins with as OpenMoji names its pictures (each code point in upper-case hex of four digits or more, joined by -, a lone FE0F after one code point left out: ☺️ is 263A), and {field} another field of the row. With {codepoints} and no emoji, the row has no picture.
thumbnail-replacetwo stringsNo(none)The thumbnail’s address with its first "<old>" replaced by "<new>": a smaller form the host serves, e.g. IMDb’s thumbnail-replace "._V1_." "._V1_QL75_UX320_." (320 px wide, where its own address is the poster at full size, often megabytes).
image-pathstringNo""Dot-path to the full picture’s address, which the Images viewer opens (else image-from-thumb, else the thumbnail).
video-pathstringsNo(none)Dot-paths to a clip the Images viewer plays in the picture’s place, muted and looping, the first with a value taken: Gifbox’s video-path "media_formats.webm.url" "media_formats.mp4.url". Through the image proxy, which passes a video only from Gifbox’s media host.
width-path, height-pathstringNo""Dot-paths to the picture’s size in pixels, for its tile’s shape and resolution badge.
source-pathstringNo""Dot-path to who a row is from: a picture’s author or site (its tile’s credit line and the viewer’s), a video’s channel. A key that holds dots (Dailymotion’s owner.screenname) is read as one key.
sourcestringNo""Who every picture is from when source-path gives none, e.g. source "OpenMoji".
graphiconstringNo""Puts an Images engine on the Graphicons tab, in that group of its second row: "text", "media" or "formats". Any other word stops the server’s start and --check-config.
picture-sizetwo intsNo(none)Every picture’s width and height when its row gives none, so its tile has its shape before it loads, e.g. picture-size 618 618 (OpenMoji’s art).
license, license-pathstringNo""A picture’s licence, after its credit in the tile (“OpenMoji · CC BY-SA 4.0”): license for every row, license-path a dot-path to a row’s own (Commons’ imageinfo.0.extmetadata.LicenseShortName.value), which wins.
views-pathstringNo""Dot-path to a video’s view count (a number, or text such as 1.2M views).
source-link-pathstringNo""Dot-path to the page of who a picture is from (a photographer’s profile): their name in the picture’s credit links it, in the tile and the viewer. On Unsplash’s pictures the credit reads “Photo by on Unsplash”, both links with Unsplash’s utm_source=4got&utm_medium=referral, as its API terms ask.
opened-pathstringNo""Dot-path to an address the engine asks to be told at when one of its pictures is opened (Unsplash’s download_location). When the viewer opens the picture, this server calls it, once per picture a page shows, with the key the person’s search would use (their own, else the server’s while it covers them and is under its stop), counted as a search counts it; only an address an answer gave, and only from a page of this server. A results page alone calls nothing.
published-pathstringNo""Dot-path to a publication date. Handles ISO/RFC3339 strings, unix seconds, unix milliseconds, and a bare four-digit year (IMDb’s y). Values that can’t be a plausible date are dropped — a wrong date misleads about freshness worse than no date does.
rating-pathstringNo""Dot-path to a numeric rating. Displayed in the engine’s own scale (“8.9/10”, “4.5/5”) but ALSO kept numerically, normalized to /10, so ranking and filtering stay possible — the thing searxng gave up by storing ratings as display strings.
rating-scalenumberNo10The engine’s maximum rating (5 for star-rating stores, 10 for IMDb/TVmaze).
attribute "Label" "path"repeatableNo—An extra fact to show under the result, e.g. attribute "Network" "show.network.name", drawn “Network HBO” in the row’s facts line, the facts parted by dots. Ordered: the engine knows which facts matter most in its own domain. Empty values are skipped rather than rendered as a blank row. More paths after the first are tried in turn, the first with a value taken (attribute "Severity" "cve.metrics.cvssMetricV40.0.cvssData.baseSeverity" "cve.metrics.cvssMetricV31.0.cvssData.baseSeverity"). An array’s every item is shown, parted by “, “ (a repository’s licences, a package’s authors). say="…": how the line says it, in place of “Label value”: {} is the value, {count} the value as a count (say="{count} stars": 69626 is “70K stars”, 1 is “1 star”), {ago} a date’s age (say="updated {ago}": “updated 2 days ago”); a value its {count} or {ago} cannot read is left out, and so is a {count} of 0, unless zero="…" says what to show for it (zero="no seeders": a dead torrent).
keep-ifstring, repeatableNo—Dot-path: a row is kept only when it holds something other than nothing, false or 0, e.g. keep-if "account.indexable" (Mastodon: the person lets their posts be searched), keep-if "imageinfo.0.duration" (Commons’ animated GIFs: a still one has no duration).
lang-fieldstringNo""Dot-path to the language a row says it is in (an ISO 639-1 code, e.g. Mastodon’s language). A row in none of the person’s known languages, or the query’s own when it is clearly another, is not drawn (on every tab and in What people are saying); it stays in the shared cache for others. A row that says nothing is drawn.
drop-ifstring, repeatableNo—Dot-path: a row is dropped when it holds something other than nothing, false or 0, e.g. drop-if "sensitive" (behind a content warning), drop-if "skintone" (OpenMoji’s skin-tone variants, 1 to 5). With a value after the path, when it holds that value; with safe=true, at safe search Moderate and Strict alone: drop-if "category" "9" safe=true (emoji.gg’s NSFW category).
order-pathstringNo""Dot-path to a number the rows are put in order of, those without one last: MediaWiki answers a generator’s pages in no order, and index is its search’s.
list-matchstringsNo(none)The answer is a whole catalogue, not a search (search-url without {query}): asked on the first search that needs it and kept a day (again a minute after a failure, the last good one served meanwhile), its rows after keep-if and drop-if kept, and a search shows those whose fields at these dot-paths hold each of its words at a word’s start (“facepalm” finds “person facepalming”), in the catalogue’s order, page-size a page. Imgflip’s get_memes, OpenMoji’s openmoji.json.

URL construction

AttributeTypeRequiredDefaultDescription
url-prefixstringNo""String prepended to every extracted URL. Use for APIs that return relative paths (e.g. "https://developer.mozilla.org" + /en-US/docs/...).
url-templatestringNo""Template for building URLs from result fields. Placeholders: {title} (spaces replaced with _), {id}, {url}, {wikilang}. Takes precedence over url-prefix when set. Example: "https://www.artic.edu/artworks/{id}". {wikilang}, here and in search-url, is the person’s first known language as a Wikimedia wiki names it, among the project’s in the host (https://{wikilang}.wiktionary.org/…; Wikipedia’s elsewhere), from go-server/wikis.txt: nb is no, pt-BR is pt, and en where the project has none.

Pagination

AttributeTypeRequiredDefaultDescription
page-sizeintNo10Results per page. Used to compute {offset}.
pagingboolNofalseWhether this engine supports pagination. Without it and without a {page}/{pageno}/{offset} token, the engine is asked for page 1 only: for page 2 it would answer page 1 again. paging false means page 1 only even with a token in the address. Check the site’s own next-page link before adding a token; a parameter the site ignores repeats page 1.
first-pageintNo0The page/offset number for the first page. Most APIs use 0 or 1.

Content processing

AttributeTypeRequiredDefaultDescription
content-html-to-textboolNofalseStrip HTML tags from the content/snippet field before display. Useful for APIs like StackExchange that return HTML in JSON.
content-markdownboolNofalseThe snippet is Markdown: flatten it to one line of plain text (heading, quote and list marks, link addresses, code marks and escapes go; fenced code is kept as written; a line repeating the title is dropped), and undo code marks and escapes in the title. Emphasis is kept, since ** in developer text is as often **kwargs. Used by firecrawl_dev.
title-from-contentboolNofalseA post with no title (no title-path): the title is its first sentences that fit in 100 characters, when they make 40 or more, else its opening cut at a word with … (and the snippet, the rest, starts with …). With content-html-to-text, a paragraph or line break reads as a space.
strip-textstringsNo(none)Marks taken out of a JSON row’s title and snippet, e.g. strip-text "[Keyword]" "[/Keyword]" (Boardreader’s around the words found).

Lifecycle

AttributeTypeRequiredDefaultDescription
disabledboolNofalseIf true, the engine is parsed but not registered. Use to temporarily disable an engine without removing its config.
cache-hoursintNo(none)A search holding the engine’s rows is kept at most this many hours, however long its category’s cache keeps one, and a full search carries none of the engine’s older rows or timing into its copy, every other engine’s as before: Gifbox’s cache-hours 24, as its terms ask.

Federation

AttributeTypeRequiredDefaultDescription
sharestringNoauto-detectedControls whether results from this engine are shared with peer instances. Values: "none" (never share – used for engines with API keys to avoid leaking quota), "cache" (share cached results but don’t proxy live queries – the default), "proxy" (full proxy: friends can trigger live queries through us). When omitted, the engine factory auto-detects: if the URL or headers contain an API key pattern (api_key=, Authorization, etc.), defaults to "none"; otherwise defaults to "cache".
tor-outboundboolNofalseRoute this engine’s HTTP requests through the local Tor SOCKS5 proxy (127.0.0.1:9050). Use for engines that aggressively IP-ban search aggregators. Requires a running Tor daemon.

Host budgets

Each engine has its own budget of requests: its engine-budget line (see engines.kdl budgets in the configuration reference), or 30 a minute and 1,000 a day. Where several engines ask one upstream that limits the address as a whole, a host-budget line gives that host a budget the engines share, checked before each request alongside the engine’s own:

host-budget "api.stackexchange.com" per-minute=25 per-day=280

The host is matched against each engine’s search-url. Both numbers are required and must be above 0, or the engines file does not load. A test search (X-4got-Test) asks such a host only while at least half of its day is left after it, so people’s searches keep the rest.

A host that takes a key identifying the server itself (not a person’s, and not a paid quota) names it:

host-budget "api.stackexchange.com" per-minute=25 per-day=280 key="stackexchange" key-param="key" keyed-per-minute=120 keyed-per-day=9500

key is the key’s name in config.kdl’s api-keys. While the server has it, every request from these engines to the host carries it in key-param, for everyone, and the keyed numbers are the budget. Without it the requests go keyless under the first numbers.

Examples

JSON API engine (MDN)

engine "mdn" {
    name "MDN Web Docs"
    categories "web"
    search-url "https://developer.mozilla.org/api/v1/search?q={query}&page={page}"
    method "GET"
    result-type "json"
    results-path "documents"
    title-path "title"
    url-path "mdn_url"
    url-prefix "https://developer.mozilla.org"
    content-path "summary"
    page-size 10
    paging true
    first-page 1
}

HTML scraping engine (Anaconda)

engine "anaconda" {
    name "Anaconda"
    categories "web"
    search-url "https://anaconda.org/search?q={query}&page={page}"
    method "GET"
    result-type "html"
    url-prefix "https://anaconda.org"
    results-selector "tbody tr"
    title-selector "td h5"
    url-selector "td h5 a:last-of-type"
    content-selector "td p"
    page-size 10
    paging true
    first-page 0
}

Engine with custom headers (Crossref)

engine "crossref" {
    name "Crossref"
    categories "web"
    search-url "https://api.crossref.org/works?query={query}&rows=20&offset={offset}"
    method "GET"
    result-type "json"
    results-path "message.items"
    title-path "title"
    url-path "URL"
    content-path "abstract"
    content-html-to-text true
    headers {
        "User-Agent" "4got/1.0 (https://4got.org; mailto:admin@4got.org)"
    }
    page-size 20
    paging true
    first-page 0
}

POST engine with body template (ArtStation)

engine "artstation" {
    name "www.artstation.com"
    categories "images"
    search-url "https://www.artstation.com/api/v2/search/projects.json"
    method "POST"
    result-type "json"
    results-path "data"
    title-path "title"
    url-path "permalink"
    content-path "description"
    thumbnail-path "smaller_square_cover_url"
    body-template "{\"query\":\"{query}\",\"page\":{page},\"per_page\":20,\"sorting\":\"relevance\",\"pro_first\":\"1\",\"filters\":[],\"additional_fields\":[\"description\"]}"
    page-size 20
    paging true
    first-page 1
}

URL template engine (Art Institute of Chicago)

engine "artic" {
    name "www.artic.edu"
    categories "images"
    search-url "https://api.artic.edu/api/v1/artworks/search?q={query}&page={page}&limit=20"
    method "GET"
    result-type "json"
    results-path "data"
    title-path "title"
    url-path "id"
    url-template "https://www.artic.edu/artworks/{id}"
    content-path "thumbnail.alt_text"
    page-size 20
    paging true
    first-page 1
}

How the generic engine factory works

At startup, LoadAndRegisterGenericEngines() in generic_engine.go:

  1. Reads data/engines.kdl via resolveKDLNodes() (kdl_doc.go, which supports both standalone files and engines { ... } sections inside a unified KDL file), parsed by kdl-go as KDL v1.
  2. Turns the engine nodes into []GenericEngineConfig via engineConfigs(), which handles engine blocks, headers sub-blocks, and all property types.
  3. Skips entries with empty ID, no categories, or disabled true.
  4. Sets defaults: page-size defaults to 10, name defaults to the ID.
  5. Creates a GenericEngine struct (which implements the Engine interface) for each config and registers it in the global engine registry.
  6. Determines the share policy: explicit share attribute wins; otherwise auto-detects based on whether the URL or headers contain API key patterns.

When Search() is called on a GenericEngine:

  1. Substitutes {query}, {page}, {offset}, {lang} in the URL template (and body template if POST).
  2. Makes the HTTP request, routing through Tor if tor-outbound is set.
  3. Records the raw HTML for drift detection (drift.go).
  4. Dispatches to parseHTML() (goquery CSS selectors) or parseJSON() (dot-path navigation) based on result-type.
  5. Returns []WebResult with each result’s Engine field set to the engine ID.

Testing a new engine via the admin playground

The admin playground at /admin/engines/new (owner-only) provides a web form for configuring and testing generic engines without editing KDL files directly.

  1. Log in as owner at /admin/login.
  2. Navigate to /admin/engines/new.
  3. Fill in the engine identity (ID, display name, categories).
  4. Set the search URL template with {query} and {page} placeholders.
  5. Choose HTML or JSON result type and fill in the corresponding selectors/paths.
  6. Enter a test query and click “Test Engine” – this POSTs to /admin/engines/test, which creates a temporary GenericEngine in memory, runs a search, and returns results as JSON displayed in the form.
  7. Iterate on selectors until results look correct.
  8. Click “Save Engine” to append the generated KDL block to data/engines.kdl and register it in memory immediately (no restart needed).

The test endpoint does not persist anything – only “Save Engine” writes to disk.

Example: an offline Wikipedia (Kiwix)

A local archive is an engine like any other. With kiwix-serve running on this machine:

  1. Download a ZIM from https://download.kiwix.org/zim/ (wikipedia_en_simple_all_mini is about 1 GB).
  2. kiwix-serve --port 8080 /path/to/wikipedia.zim
  3. Add this block to data/engines.kdl, with books.name matching your ZIM, and check the selectors against your kiwix-serve’s search page.
engine "kiwix_local" {
    name "Wikipedia (offline)"
    categories "web"
    search-url "http://127.0.0.1:8080/search?books.name=wikipedia&pattern={query}&userlang=en"
    method "GET"
    result-type "html"
    results-selector "ul.results li"
    title-selector "a"
    url-selector "a"
    content-selector "cite"
    url-prefix "http://127.0.0.1:8080"
    page-size 20
    paging false
    first-page 1
    local true
    serves "en.wikipedia.org/wiki/=>http://127.0.0.1:8080/wikipedia/A/"
}

local true exempts it from rate limits and the fanout’s deadlines. serves marks live Wikipedia results as available offline, linking the local copy.

Engine Catalog

4got ships with 283 engine configurations in data/engines.kdl plus 28 handwritten engines in Go. Engines are grouped by category. Most require no API key; exceptions are noted.

Engines that could no longer run were removed; data/dead-engines.txt lists them with the date and reason. An engine marked disabled that takes a key is asked once you configure its key.

Handwritten engines (Go)

These are implemented directly in Go for speed, reliability, or because they need custom scraping logic.

EngineIDCategoriesNotes
Bravebraveweb, images, newsHTML scraping
DuckDuckGoduckduckgowebHTML scraping
GooglegooglewebHTML scraping
Startpagestartpageweb, news, imagesHTML scraping; its news and pictures from the data its page hands its script
WikipediawikipediawebMediaWiki API
MojeekmojeekwebHTML scraping
MarginaliamarginaliawebJSON API
WibywibywebJSON API
SwisscowsswisscowswebSigned JSON API (Bing’s results, so not counted as a general index)
Hacker NewshackernewsnewsAlgolia API
YouTubeyoutubevideosHTML scraping
SoundCloudsoundcloudmusicJSON API
Flickrflickrimagesits search page’s data; JSON API with a key
Pexelspexelsimagesthe JSON its own pages ask for; its JSON API with a key when that fails
Yandexyandexweb, imagesnot registered since 2026-09-27: Yandex answers scripts with a captcha (!yandex redirects to yandex.ru; serpapi_yandex with a key)
Qwantqwantweb, images, newsJSON API
Bingbingweb, images, news, videosHTML scraping
BaidubaiduwebHTML scraping
Yahooyahooweb, newsHTML scraping
YouTube (shorts)youtube_shortvideosHTML scraping
NavernaverwebHTML scraping
Naver Imagesnaver_imagesimagesJSON API
Naver Videosnaver_videosvideosJSON API
ChatNoirchatnoirwebJSON API; optional key
MagnificmagnificimagesJSON API
GMXgmxwebHTML scraping
XMRBazaarxmrbazaarmarketplaceHTML scraping; asked only on the Marketplace tab
RepologyrepologypackagesJSON API (an object keyed by project); once a second at most
Homebrewhomebrew_pkgpackagesits formula and cask lists, copied to this server’s disk and searched there

Sidecar engines (Python + Playwright)

The Python sidecar runs these in a headless Firefox. For a person with the sidecar permission (the deluxe group in groups.kdl, and the owner), a web search asks the sidecar first for Google and Qwant, and the regular engine whenever the sidecar fails or takes longer than 2.5 s; the sidecar is told the same 2.5 s and closes the browser page when it passes. Yandex has no regular engine: it is asked through the sidecar only, for those people only, and appears in no engine list. When the rate limiter holds Google or Qwant back, a deluxe search still asks the sidecar, but never the held-back engine. Sidecar rows stay out of the shared cache and friend pushes. The route is on only when the sidecar’s /health says "engines": true, which a sidecar without Playwright (math only) does not. A deluxe page waits up to 3 s past its window while a sidecar engine is still out (go-server/sidecar.go).

Separately, an engines.kdl block with the sidecar’s engine name as its ID and sidecar true sends that engine’s searches to the sidecar’s /search for everyone while the sidecar is up. It is opt-in, and no shipped engine sets it.

EngineWhat it handles
Google (sidecar)JS-heavy Google SERPs
Qwant (sidecar)Qwant’s SPA rendering
Yandex (sidecar)Yandex web results, deluxe only; no regular engine

KDL-configured engines by category

Web (130 engines, 103 listed)

General web search. The largest category.

EngineIDNotes
KozmonavtkozmonavtA directory of sites with its own index
Right Daoright_daoAn independent web index
search.chsearchchSwitzerland’s own index; its click counter unwrapped
MDN Web DocsmdnJSON API
StackExchangestackexchangeAPI, Q&A results
npmnpmPackage registry
AnacondaanacondaHTML scraping
Arch WikiarchwikiREST API
WikidatawikidataJSON API
CrossrefcrossrefAcademic DOIs
Apple App Storeapple_app_storeiTunes API
bpb.debpbGerman civic education
crates.iocratesRust packages
Docker Hubdocker_hub
GitHubgithubRepo search
GitHub Codegithub_codeCode search
GitHub Issuesgithub_issues
GitHub Topicsgithub_topics
GitLabgitlab
GitLab Snippetsgitlab_snippets
hex.pmhexElixir packages
Hugging FacehuggingfaceAI models
LemmylemmyFediverse forums
Microsoft Learnmicrosoft_learn
mwmblmwmblOpen-source index
NVDnvdCVE/vulnerability DB
OpenAlexopenalexAcademic
Redditreddit
tagesschau.detagesschauGerman news (web+news)
Void Linuxvoidlinux
Simple Wikipediasimple_wikipedia
Wikibookswikibooks
Wikiquotewikiquote
Wikisourcewikisource
Wikivoyagewikivoyage
Wiktionarywiktionary
Wikimedia Commonswikicommons
Internet Archiveinternet_archive
PubMedpubmed
RubyGemsrubygems
cdnjscdnjsJS CDN
pub.devpub_devDart packages
CocoaPodscocoapodsiOS packages
TVmazetvmazeTV shows
TMDBtmdbMovies
OpenLibrary Booksopenlibrary_search
PhotonphotonGeocoder
Alpine Packagesalpine_packages
Flathubflathub
Snapcraftsnapcraft
YTSytsMovie torrents
Urban Dictionaryurban_dictionary
SteamsteamGames
eBayebay
F-DroidfdroidFOSS Android apps
Podcast Indexpodcast_index
Semantic Scholarsemantic_scholarAcademic
Giteagitea
lib.rslib_rsRust crate search
PackagistpackagistPHP packages
Stack Overflow Tagsstackoverflow_main
Anaconda Cloudanaconda_cloud
HackagehackageHaskell packages
NuGetnuget.NET packages
MavenmavenJava packages
Libraries.iolibraries_ioMulti-registry
Metacriticmetacritic
Rotten Tomatoesrotten_tomatoes
Letterboxdletterboxd
VNDBvndbVisual novels
PCGamingWikipcgamingwiki
IsThereAnyDealisthereanydealGame prices
BoardGameGeekboardgamegeek
Lingueelinguee
Brave Search APIbrave_apiBrave’s paid API; needs a key (Settings › API keys), never asked without one
Yepyep_apiYep’s own index through its paid API; needs a key of your own (Settings › API keys), never asked without one
Gibirugibiru
Emojipediaemojipedia
AlternativeToalternativeto
Goodreadsgoodreads
IMDBimdb_search
itch.ioitch_ioIndie games
Are.naare_na
Kickstarterkickstarter
Product Huntproduct_hunt
IEEE Xploreieee
Springerspringer_open
COREcoreAcademic
DOAJdoajOpen access journals
ZenodozenodoResearch data
ORCIDorcid
KitsukitsuAnime/manga
MyAnimeListjikanVia Jikan API
RAWGrawgGames
MangaDexmangadex
Open Food Factsopenfoodfacts
Etsyetsy
CPANcpanPerl packages
EncycloSearchencyclosearchThe Encyclosphere’s encyclopedias
Wikiversitywikiversity
Minecraft Wikiminecraft_wiki
KeenablekeenableIts own index, keyless
MoviepilotmoviepilotFilms and series (German)

Images (28 engines, 21 listed)

EngineIDNotes
FrinkiacfrinkiacThe Simpsons’ frames by what is said in them
PixabaypixabayIts safe filter on at every level
pixivpixivIllustrations; all ages only at Moderate and Strict
Art Institute of Chicagoartic
ArtStationartstationPOST API
OpenverseopenverseCC-licensed
UnsplashunsplashIts official API; needs a key (Settings › API keys)
Wallhavenwallhaven
Wikimedia Commonswikicommons_images
Startpagina Imagesstartpagina_imagesGoogle’s pictures, through Startpagina
Library of CongresslocPhotographs; 15 requests a minute
PinterestpinterestPins, each linking its pin
ImgflipimgflipGraphicons tab, Formats: its 100 most-captioned meme templates, kept a day
OpenMojiopenmojiGraphicons tab, Text: the open emoji (CC BY-SA 4.0), its catalogue kept a day
EmojipediaemojipediaGraphicons tab, Text: its emoji, drawn in OpenMoji’s art
Wikimedia Commons GIFswikicommons_gifsGraphicons tab, Media: Commons’ animated GIFs, each with its licence
GifboxgifboxGraphicons tab, Media: GIFs, each its poster and its clip; needs a key (Settings › API keys), its answers kept a day
DanboorudanbooruGraphicons tab, Media: anime art by its tags; not at Strict, its general rating at Moderate
SafeboorusafebooruGraphicons tab, Media: its own uploads, not Danbooru’s again; not at Strict, its general rating at Moderate
7TVseventvGraphicons tab, Media: emotes; its NSFW filter at Moderate and Strict
Emoji.ggemojiggGraphicons tab, Media: Discord emoji, its catalogue kept a day, its NSFW category left out

Videos (19 engines, 13 listed)

EngineIDNotes
360 Video360search_videosChinese video sites
PipedpipedYouTube’s videos through a Piped instance, linked to YouTube
Rumblerumble
VimeovimeoWith the guest token its site hands every visitor
BitChutebitchute
CCC Mediaccc_mediaChaos Computer Club
Dailymotiondailymotion
IMDbimdb
Internet Archive Videoarchive_video
OdyseeodyseeLBRY
PeerTubepeertubeFediverse video
Wikimedia Commons Videoswikicommons_videos
BilibilibilibiliChinese video

News (8 engines, 4 listed)

EngineIDNotes
ANSAansaItaly’s news agency, newest first
tagesschau.detagesschauGerman; also in web
Wikinewswikinews
The Guardianthe_guardianUses test API key

Music (11 engines, 10 listed)

EngineIDNotes
FreesoundfreesoundCreative Commons sounds; needs a key
Discogsdiscogs
Geniusgenius
JamendojamendoCC music
Last.fmlastfm
MusicBrainzmusicbrainz
Radio Browserradio_browserInternet radio
fyydfyydPodcasts
DeezerdeezerTracks; its terms: personal, non-commercial use
MixcloudmixcloudDJ mixes and shows

Science (15 engines, 14 listed)

EngineIDNotes
Google Scholargoogle_scholarA captcha is a failure, never answered
OpenAIRE DatasetsopenairedatasetsBy title
OpenAIRE PublicationsopenairepublicationsBy title
OSF PreprintsosfThrough SHARE
arXivarxivAcademic preprints
COREcore_sci
Crossrefcrossref_sci
dblpdblpCS papers
DOAJdoaj_sciOpen access
OpenAlexopenalex_sci
PubMedpubmed_sci
Semantic Scholarsemantic_scholar_sci
Zenodozenodo_sci
Wikispecieswikispecies

IT (25 engines, 24 listed)

EngineIDNotes
Lobsterslobste_rsIts stories
sourcehutsourcehutIts public projects
Codebergcodeberg
crates.iocrates_ioRust
Docker Hubdocker_hub_it
GitHub Reposgithub_repos_it
GitLabgitlab_it
hex.pmhex_itElixir
MDNmdn_it
npmnpm_search
NuGetnuget_it.NET
Packagistpackagist_itPHP
pkg.go.devpkg_go_devGo
pub.devpub_dev_itDart
RubyGemsrubygems_it
SploitussploitusExploits and proofs of concept, each linking its source
Stack Overflowstackoverflow
ManKiermankierMan pages
HooglehoogleHaskell functions by name or type
Hugging Face Datasetshuggingface_datasets
Hugging Face Spaceshuggingface_spaces
Baidu Kaifabaidu_kaifaBaidu’s search for developers
NixOS Wikinixos_wiki
Free Software Directoryfree_software_directoryThe FSF’s, by title

Files (15 engines, 8 listed)

EngineIDNotes
BTDiggbtdiggDHT torrents
Library Genesislibgenlibgen.li
1337x1337x_files
NyaanyaaAnime torrents
Pirate Baypiratebay_files
Solid Torrentssolidtorrents_files
YTSyts_filesMovie torrents
BT4Gbt4gTorrent names, from its RSS feed

Social (13 engines, 9 listed)

EngineIDNotes
BoardreaderboardreaderForum posts
Lobsterslobsters_socialTheir threads
Hacker Newshackernews_social
Lemmylemmy_social
Mastodonmastodon_socialA hashtag’s posts (the words searched, joined)
Redditreddit_social
WordPress.com Readerwordpress_readerBlog posts, newest first
Lemmy Communitieslemmy_communitiesThe most subscribed first
Mastodon Accountsmastodon_accountsAccounts that let themselves be found

Books (4 engines)

EngineIDNotes
Goodreadsgoodreads_books
Internet Archiveinternet_archive_books
Open Libraryopenlibrary_books
Project Gutenberggutenberg_books

Q&A (6 engines)

EngineIDNotes
Ask Ubuntuaskubuntu_qa
Math SEmath_se_qa
Server Faultserverfault_qa
StackExchangestackexchange_qa
Super Usersuperuser_qa
Unix & Linux SEunix_se_qa

Packages (19 engines)

EngineIDNotes
NixOS packagesnixos_packagesnixos-unstable
R-universecranCRAN’s and the R community’s packages
Alpine Packagesalpine_packages_pkg
Anaconda Cloudanaconda_cloudconda packages
Arch Wikiarchwiki_packages
AURaur
crates.iocratesRust packages
Docker Hubdocker_hubcontainer images
Flathubflathub_pkg
Gentoo Wikigentoo_wiki
hex.pmhexElixir packages
MetaCPANmetacpanPerl modules
npmnpmJavaScript packages
NuGetnuget.NET packages
PackagistpackagistPHP packages
pkg.go.devpkg_go_devGo packages
RubyGemsrubygemsRuby gems
Void Linuxvoid_packages_pkg
CachyOS Packagescachy_os

Maps (2 engines)

EngineIDNotes
OpenStreetMap (Nominatim)nominatim_maps
Photon Geocoderphoton_maps

Lyrics (1 engine)

EngineIDNotes
Genius Lyricsgenius_lyrics

Oracles

Oracles are instant-answer widgets shown above search results. They trigger on specific query patterns and provide rich, interactive answers without requiring a click-through. Oracles are checked in CheckOracles() in oracles.go. Access can be restricted per-group via oracle-permissions.kdl.

Local oracles (no external calls)

These run entirely on the server with no network requests. They are mutually exclusive — the first match wins and skips all remaining oracles.

OraclePermission keyTrigger patternsWhat it shows
Calculatorcalculator2+2, sqrt(16), 15% of 200, sin(1.5), 2^8; calculator or calc aloneArithmetic, trig, logarithms, percentage calculations; the keypad alone, on any tab
Unit Converterunit_converter10 km to miles, 72 fahrenheit to celsius, 5 gallons to liters, 100 fl oz to mlLength, weight, volume, speed, data storage, cooking units, temperature, force/mass
Base Converterbase_converter0xff in decimal, 255 in hex, 255 in binary, 0b1010 in decimal, 0o77 in hexDecimal, hex, binary, octal conversions
Colorcolor#FF5500, #f50, rgb(255,85,0), hsl(20,100%,50%)Color swatch with hex/RGB/HSL conversions
Private IPprivate_ipBare IPv4/IPv6 addresses in private ranges (192.168.1.1, 10.0.0.1)Identifies the private range and offers HTTP/HTTPS links
Timezonetimezonetime in tokyo, time in new york, time in UTC+5Current time in 70+ cities and IANA timezones
UUIDuuidAny UUID string (e.g. 550e8400-e29b-41d4-a716-446655440000)Version, variant, and embedded timestamp (v1/v7)
Timestamptimestamp10-digit or 13-digit numbers, now, current timestamp, unix timestampConverts Unix timestamps to human dates, or shows current timestamp
JWTjwtAny header.payload.signature JWT tokenDecodes header and payload, shows algorithm and expiry
CIDRcidr192.168.1.0/24, 10.0.0.0/8Network, broadcast, host range, usable hosts, netmask
Hash/Base64hashMD5 (32 hex), SHA-1 (40 hex), SHA-256 (64 hex), SHA-512 (128 hex), or base64 strings (40+ chars)Identifies hash type, or decodes base64 to text
Croncron5-field cron expressions like 0 */2 * * 1-5Human-readable schedule description with per-field explanation
DOIdoi10.1000/xyz123 or doi.org/10.1000/xyz123Links to publisher (doi.org) and Sci-Hub
Timertimertimer 5 minutes, timer 30s, countdown 10m, stopwatchInteractive countdown timer or stopwatch widget
Randomrandomflip a coin, roll a die, roll 3d20, random 1 to 100Coin flip, dice rolls (NdX), random number in range (crypto/rand)
Passwordpasswordpassword, generate password, password 32 charsCryptographically random password with copy button (4-256 chars)
QR Codeqrqr https://example.com, qr code hello worldInline SVG QR code (up to ~271 bytes, versions 1-10)
Chmodchmodchmod 755, chmod rwxr-xr-xNumeric-to-symbolic and symbolic-to-numeric conversion with explanation
Roman NumeralromanXIV in decimal, 42 in romanRoman numeral to/from decimal conversion (1-3999)
Date Arithmeticdate_arithmeticdays between Jan 1 and Dec 31, 30 days from now, days until Christmas, 90 days agoDay counts, future/past dates, with IFC calendar dates
Battery timebatterymy battery went down 15% in half an hour, battery at 60% dropping 15% every 30 minutes, phone charged 20% in 15 minHow long a full battery lasts at that rate, the time left from the level given, or to full when charging, with the sum; the AI overview stays beside it

Network oracles (external API calls, no key required)

These make external network requests but do not require any API key.

OraclePermission keyTrigger patternsWhat it showsAPI used
Reverse DNSreverse_dnsrdns 8.8.8.8, reverse dns 1.1.1.1, nslookup 8.8.4.4, ptr <IP>PTR records for an IP addressSystem DNS resolver
DNS Lookupdns_digexample.com, dig example.com, dns example.comA, AAAA, MX, TXT recordsSystem DNS resolver
IP Geolocationip_geoBare public IPv4 or IPv6 like 8.8.8.8 or 2606:4700:4700::1111, where is 1.1.1.1, geolocate <IP>City, region, country, ISP, ASN, PTRipapi.co, system DNS resolver
My IPmy_ipmy ip, whats my ip, ip, show my ipThe visitor’s public IP and its country, from the DB-IP list this server keeps (nothing is looked up elsewhere)none
Area codesarea_codearea code 517, what area code is 604, 212 area code, a phone number written as one: (313) 555-0123, +1 415 555 0123Where a North American area code is, since when, and the codes that share its area; drawn with the pagenone (a table built in from Wikipedia’s list, tools/area_codes.py)
Currencycurrency£339.90 to usd, 100 eur in yen, convert 50 dollars to rupees, usd to eurA converter filled from the search, live as it changes, and the rate over a month, a year and five yearsfrankfurter.dev; fawazahmed0/exchange-api (jsDelivr CDN) when it cannot answer
WHOISwhoiswhois example.comDomain registrar, creation/expiry dates, nameserversRDAP (rdap.org)
Speedtestspeedtestspeedtest, speed test, internet speed, bandwidth testInteractive download/upload speed test with latency and jitter; ends by saying what it moved (“Done · 48 MB down, 2.1 MB up”). Drawn with the page, first; a prompt off the IT tabServer’s own /api/v1/speedtest/* endpoints
Benchmarkbenchmarkbenchmark, browser benchmark, system benchmarkJS/DOM/Crypto/Canvas/Memory benchmark with scores; includes speedtest if permittedClient-side JS + server speedtest
Translationtranslationtranslate hello to french, translate X to Y, hello in spanish, en español hola, auf Deutsch XText translation with language detection; words already in the language named are translated into the reader’sConfigured translation backends
Auto-translatetranslation(Automatic on non-native-language queries)Detects foreign language queries and translates to user’s known languageConfigured translation backends
Mapmapmap of paris; on the Maps tab any place: tokyo, directions to berlinOpenStreetMap tile with links to OSM, Apple, Google, HERE, Bing, OsmAnd, Waze, Yandex MapsOpen-Meteo geocoding (Nominatim for weak matches and qualifiers), as weather + OSM tiles
PlacesplacesOn the Maps tab: coffee near lyon, pharmacy in tromsoUp to 8 places nearby: name, kind, address, distance, linkFoursquare, then HERE (with a key), else OpenStreetMap (Nominatim, no key); the place by the cards’ geocoder
WikipediawikipediaEntity-like queries (1-3 capitalized words), who is X, what is XInfobox card with image, summary, and Wikipedia linkWikipedia REST API
DDG Instant Answersddg_ia(Any query — lowest priority among knowledge oracles)Abstract, definition, or answer card from DuckDuckGoDuckDuckGo Instant Answer API
Package Versionpackageslatest lodash, npm lodash, pypi requests, pip flask versionLatest version with link to registrynpm Registry / PyPI
Radioradioradio new york, fm tokyo, radio stations in berlin, radio 1950s, old time radio 1938 mysteryUp to 5 radio stations, each with a listen link; for an era (1920s–1960s, or any year after “old time radio”), up to 6 broadcasts from the Internet Archive’s Old Time Radio collection, each linking to its archive.org pageradio-browser.info; archive.org
Sports Scoressportsnfl scores, premier league scores, arsenal score, real madrid next match, when do the celtics playA league’s scoreboard (NFL, NBA, MLB, NHL, MLS, EPL, La Liga, Bundesliga, Serie A, Ligue 1, Champions League, WNBA, NCAA); a team’s last result and next game, any team the world over, its times in your own zoneTheSportsDB for a team, else ESPN; ESPN for a league
SSL Certificatessl_certssl example.com, cert example.com, certificate example.comCertificate issuer, validity dates, SANs, protocol version, cipher suiteDirect TLS connection
Earthquakeearthquakeearthquakes, earthquakes today, recent earthquakes, earthquakes in californiaRecent significant earthquakes with magnitude, location, depth, and timeUSGS Earthquake API
Flightsflightsflight UA123, flight status AA456, flights from JFK to LAXLive flight tracking by callsign; route planning with bearing and distanceOpenSky Network API
Recipereciperecipe for pasta, how to make brownies, how to cook risottoStep-by-step recipe with ingredients, thumbnail, and source linkTheMealDB

API-keyed oracles (require configuration)

These oracles require API keys configured in config.kdl under api-keys { ... }. Without the key, the oracle silently returns nothing.

OraclePermission keyTrigger patternsWhat it showsAPI key configAPI used
Wolfram Alphawolfram(Any query — lowest priority knowledge oracle)Computational answers, facts, mathwolframalpha "..."Wolfram Alpha Short Answers API
Weatherweatherweather in paris, forecast tokyo, temperature in london (a place is needed: the visitor’s address is never used to guess one)Current temperature, humidity, wind, conditions with iconOptional: openweathermap "..."Open-Meteo (free, always); OpenWeatherMap (if key set, tabbed multi-source)
Dictionarydictionarydefine serendipity, meaning of ubiquitous, what does ephemeral mean, urban slangMulti-source tabbed definitionsOptional: mw_collegiate, mw_thesaurus, mw_learners, mw_medical, mw_spanish, mw_school, mw_elementary, mw_intermediate, mw_intermediate_thesaurus, wordnikFree Dictionary API + Wiktionary + Urban Dictionary (always); up to 9 Merriam-Webster products + Wordnik (with keys)
Stockstock$AAPL, TSLA stock, stock price MSFTPrice, change, open/high/low, previous closeOptional: alpha_vantage "...", twelvedata "...", finnhub "..."Alpha Vantage, Twelve Data, Finnhub (multi-source tabbed if multiple keys)
Blockchain lookupchaina pasted Ethereum address 0xd8dA6BF2…6045, transaction 0x5c50…2060 or name vitalik.eth; a Bitcoin address bc1q… / 1A1zP1…; a Bitcoin txid with the word bitcoin, btc, tx, txid or transactionBalance, ENS name, contract or not and transaction count; a transaction’s state, block, time, value and fee; when it was read; a link to the explorerNoneBlockscout (eth.blockscout.com), mempool.space: only what was pasted
Callsigncallsigncallsign W1AW, ham W1AW, W1AW ham radio (US amateur callsigns; a word saying so is needed)Holder, licence class, grid square (four characters), expiry, former callsign, a club’s trustee; a link to the FCC’s record; never the addressNonecallook.info (the FCC’s licences): only the callsign
Company identifier (LEI)leian LEI HWUPKR0MPOU8FGXBT394 (its check digits must hold) or lei HWUP…; apple lei number, lei code siemens, siemens ag leiLegal name, LEI, headquarters, jurisdiction, entity and registration status, renewal date; a link to GLEIF’s recordNoneGLEIF (api.gleif.org); Wikidata to find a named company’s LEI: only the LEI or the name
Cryptocrypto$BTC, bitcoin price, price of ethereum, crypto solanaUSD/EUR/BTC price, 24h change, market capNone (free API)CoinGecko
Inflation / CPIinflationinflation, cpi, consumer price index, dollar inflationAnnual inflation rate with 12-month sparkline chartNone (free API)Bureau of Labor Statistics
Purchasing Powerinflationpurchasing power of dollar, dollar worth in 1970Historical purchasing power table or year-specific comparisonNone (free API)Bureau of Labor Statistics CPI-U data
Air Qualityair_qualityair quality in beijing, aqi paris (a place is needed)AQI value, category, dominant pollutant, color-coded displayOptional: aqicn "..."Open-Meteo Air Quality (free, always); AQICN (with key, tabbed multi-source)
Newsnewsnews about AI, latest news on climate, headlines technologyMulti-source news headlines with thumbnailsOptional: currentsapi "...", newsdata "...", gnews "..."Google News RSS (free, always); Currents API, Newsdata.io, GNews (with keys, tabbed)
Music / Spotifymusicplay bohemian rhapsody, listen to radiohead, song despacito, Artist — TrackSpotify embed player with album info and alternative service linksOptional: spotify-client-id "..." + spotify-client-secret "..."Spotify Web API (with keys); links-only fallback without keys
Eventseventsconcerts near detroit, events in lyon this weekend, things to do in austin, gigs tonight in leeds (a place is needed; “near me” names none)The next 8 events within 40 km: date and time at the venue, name, venue, price range, a link to its Ticketmaster page; concerts and gigs only musicticketmaster "..." (nothing without one)Ticketmaster Discovery API: only the place’s coordinates, a radius and dates

Knowledge oracles (fire concurrently)

Three knowledge oracles fire simultaneously on every query and the best result wins. Priority order: Wikipedia > DDG Instant Answers > Wolfram Alpha.

PriorityOraclePermission keyAPI
0 (highest)Wikipedia InfoboxwikipediaWikipedia REST API (no key)
1DDG Instant Answersddg_iaDuckDuckGo IA API (no key)
2 (lowest)Wolfram AlphawolframWolfram Alpha Short Answers API (requires key)

Oracles on tabs

Settings › Advanced › Oracle & AI has two switches. Oracles on the All tab (web_oracles): sometimes, when a search asks for one (the default), or never. Oracles on other tabs (smart_tab_oracles): always (the default), sometimes (off), or never (never). “Always” adds each tab’s own oracles, which fire without trigger words. Below them, Oracle configuration lists every oracle with one choice each: Always (on its own tab’s every search; offered only to the oracles in this table), Sometimes (when a search asks for it) or Off (never). It stores oracles_off and oracles_sometimes:

TabAuto-fired oracles
MapsMap + Weather (for the displayed place; none when no place is found), IP Geolocation (a typed address)
MusicMusic (with forced “play” prefix), Radio
ScienceCalculator (its keypad, on every search), Unit Converter
ITYour IP (the address and its country, from this server’s own list; on every search), DNS Lookup, Base Converter; a benchmark or speed test asked for runs at once
WeatherWeather (with “weather” prefix)
LyricsLyrics

AI Research tools

When AI mode is enabled (lite or full), the AI research agent has access to these tools. These are not query-triggered oracles but tools the AI can invoke during research:

ToolDescription
fetchFetches and extracts text from URLs; supports depth=2 for same-domain crawling
psychoscrapeCitation-aware web scraper that extracts structured claims with source attribution
youtube_transcriptExtracts timestamped transcripts/captions from YouTube videos
luaSandboxed Lua execution environment with HTTP, JSON, math, and string libraries
sendShows intermediate findings to the user during research
etaUpdates the user-facing ETA countdown
frictionLogs improvement suggestions for the server developer
pinPins a result to the top of the search results
forgetRemoves a result from the search results
friend_searchSearches federated peer instances for additional results

API keys

Most engines scrape public pages and need no key. Engines that benefit from or require API keys:

ServiceConfig keyRequired?
Wolfram Alphaapi-keys { wolframalpha "..." }Optional; enables Wolfram oracle
DeepLapi-keys { deepl "..." }Optional; translation backend
Freesoundapi-keys { freesound "..." }Required for freesound engine
Spotifyapi-keys { spotify-client-id / spotify-client-secret }Optional; enables Spotify embed in music oracle
OpenWeatherMapapi-keys { openweathermap "..." }Optional; adds second weather source
Alpha Vantageapi-keys { alpha_vantage "..." }Optional; stock quotes
Twelve Dataapi-keys { twelvedata "..." }Optional; stock quotes
Finnhubapi-keys { finnhub "..." }Optional; stock quotes
AQICNapi-keys { aqicn "..." }Optional; adds second air quality source
Currents APIapi-keys { currentsapi "..." }Optional; news oracle source
Newsdata.ioapi-keys { newsdata "..." }Optional; news oracle source
GNewsapi-keys { gnews "..." }Optional; news oracle source
MW Collegiateapi-keys { mw_collegiate "..." }Optional; dictionary source
MW Thesaurusapi-keys { mw_thesaurus "..." }Optional; dictionary source (synonyms/antonyms)
MW Learner’sapi-keys { mw_learners "..." }Optional; dictionary source
MW Medicalapi-keys { mw_medical "..." }Optional; dictionary source
MW Spanishapi-keys { mw_spanish "..." }Optional; bilingual dictionary source
MW Schoolapi-keys { mw_school "..." }Optional; dictionary source
MW Elementaryapi-keys { mw_elementary "..." }Optional; dictionary source
MW Intermediateapi-keys { mw_intermediate "..." }Optional; dictionary source
MW Int. Thesaurusapi-keys { mw_intermediate_thesaurus "..." }Optional; dictionary source
Wordnikapi-keys { wordnik "..." }Optional; dictionary source
Unsplashapi-keys { unsplash "..." }Required for the unsplash engine (its official API)
The GuardianHardcoded test keyNone needed
Pexelsapi-keys { pexels "..." }, or one’s own in Settings › API keysOptional: Pexels’ API (api.pexels.com), with the key pexels.com/api gives, asked when Pexels’ site does not answer, never over a time range, which the API cannot filter

Adding a new engine

Add an engine block to data/engines.kdl:

engine "my_engine" {
    name "My Engine"
    categories "web"
    search-url "https://api.example.com/search?q={query}&page={page}"
    method "GET"
    result-type "json"
    results-path "results"
    title-path "title"
    url-path "url"
    content-path "snippet"
    page-size 20
    paging true
    first-page 1
}

Restart 4got. The engine registers automatically.

Template variables: {query}, {page}/{pageno}, {offset}, {lang}.

For HTML scraping, set result-type "html" and use CSS selectors (results-selector, title-selector, url-selector, content-selector).

Architecture

Request flow

User query
    │
    ▼
┌─────────────────────────────────────────────────────────┐
│ handleSearch()                                          │
│                                                         │
│  1. Parse bangs ──── !g, !w, etc. ──→ 302 redirect     │
│     │ (no match)                                        │
│     ▼                                                   │
│  2. Auth check                                          │
│     │                                                   │
│     ├── No session, first visit ──→ /captcha (IQ test)  │
│     ├── No session, returning ───→ PoW challenge page   │
│     │                              (client-side mining)  │
│     ▼                                                   │
│  3. Parse search params (query, category, cookies)      │
│     │                                                   │
│     ▼                                                   │
│  4. Local cache lookup ── hit ──→ skip to step 8        │
│     │ (miss)                                            │
│     ▼                                                   │
│  5. Friend cache lookup ── hit ──→ store locally,       │
│     │ (miss)                        skip to step 8      │
│     ▼                                                   │
│  6. Fanout (singleflight-coalesced)                     │
│     ├── Engine 1 ──→ goroutine ──→ HTTP scrape/API      │
│     ├── Engine 2 ──→ goroutine ──→ HTTP scrape/API      │
│     ├── Engine N ──→ goroutine ──→ HTTP scrape/API      │
│     └── Friends  ──→ goroutine ──→ peer cache query     │
│     │                                                   │
│     │  hard window (1000ms default) or                  │
│     │  idle timeout (500ms) with must-include gate       │
│     ▼                                                   │
│  7. Merge + deduplicate + rank                          │
│     ├── URL normalization + dedup                       │
│     ├── Cross-engine consensus scoring                  │
│     ├── Per-engine weight × position decay              │
│     ├── General web indexes count 17.5× (engine_trust)  │
│     ├── Intent-based boost (code, academic, images...)  │
│     ├── Tracking param stripping                        │
│     └── Store merged results in cache                   │
│     │                                                   │
│     ▼                                                   │
│  8. Render                                              │
│     ├── Check oracles (calculator, unit, timezone, etc.)│
│     ├── URL rewriting (YouTube→Invidious, etc.)         │
│     ├── Auto-translate if foreign query detected        │
│     ├── Log search (if history enabled)                 │
│     └── Render HTML template with results + timeline    │
│                                                         │
│  9. Push to peer caches (background goroutine)          │
└─────────────────────────────────────────────────────────┘

Auth flow

New visitor                 Returning visitor
    │                            │
    ▼                            ▼
┌────────────┐           ┌─────────────┐
│ IQ Test    │           │ PoW WASM    │
│ (captcha)  │           │ (SHA-256    │
│ Image grid │           │  mining)    │
└────┬───────┘           └──────┬──────┘
     │ correct                  │ valid nonce
     ▼                          ▼
┌──────────────────────────────────────┐
│ Ed25519-signed session cookie        │
│ (AuthCaptcha or AuthPow)             │
│ TTL: captcha=24h, pow=5min           │
└──────────────────────────────────────┘

Owner: POST /admin/login with owner_secret
       → AuthOwner session cookie

Groups: cookie hash → group lookup (groups.kdl)
        → permissions: sidecar, server_api_keys,
          friend_proxy, priority_fanout

Federation protocol

Instance A                         Instance B
    │                                   │
    │  GET /api/v1/cache               │
    │  ?q=QUERY&cat=web                │
    │  Authorization: Bearer PEER_SEC  │
    │ ─────────────────────────────→   │
    │                                   │
    │  200 OK (cached results)          │
    │  or 204 No Content               │
    │ ←─────────────────────────────   │
    │                                   │
    │  POST /api/v1/cache              │
    │  (push fresh results to friend)  │
    │ ─────────────────────────────→   │
    │                                   │
    │  POST /api/v1/proxy              │
    │  {"service":"translation",       │
    │   "params":{...}}                │
    │ ─────────────────────────────→   │
    │                                   │
    │  200 OK (translation result)     │
    │ ←─────────────────────────────   │
    │                                   │
    │  GET /ami4got                    │
    │ ─────────────────────────────→   │
    │  {"version":"2.0",               │
    │   "engine_count":15, ...}        │
    │ ←─────────────────────────────   │

Proxyable services: translation, wolfram, autocomplete
Auth: shared peer_secret as Bearer token
Wait policy: not built; the first friend with a cached copy answers (planned: all, N or a share of friends, or always named ones; the unused config was removed 2026-09-28)
Failure tracking: a friend that fails 3 times in a row is skipped for 5 minutes (planned: a threshold such as 1% over 1d)

AI research agent loop

User searches same query twice
         │
         ▼
GET /api/v1/research?q=QUERY  (SSE stream)
         │
         ▼
┌─────────────────────────────────────────┐
│ RunAIResearch()                         │
│                                         │
│  System prompt (data/metaprompt.md)     │
│  + top search result URLs               │
│         │                               │
│         ▼                               │
│  LLM generates tool calls:             │
│  ┌──────────────────────────────────┐   │
│  │ fetch(url)  → HTTP GET + strip   │   │
│  │ lua(code)   → sandboxed Lua VM   │   │
│  │ send(text)  → SSE "message"      │   │
│  │ eta(s,job)  → SSE "eta"          │   │
│  │ pin(text)   → permanent context  │   │
│  │ forget(id)  → evict old result   │   │
│  │ friction(s) → operator feedback  │   │
│  └──────────────────────────────────┘   │
│         │                               │
│         │ (loop until done or timeout)  │
│         ▼                               │
│  SSE "done" event with final answer     │
│                                         │
│  Cache result for replay               │
└─────────────────────────────────────────┘

Provider: any OpenAI-compatible API
          (Cerebras, OpenRouter, Ollama, custom)
Sandbox:  Lua (recommended) or bash (containers only)
Timeout:  max-runtime-seconds (default 60)
MCP:      optional external tool servers via stdio/HTTP

File organization

Go server (go-server/)

FileLinesPurpose
main.go503Entry point, config loading, startup sequence
routes.go364HTTP route registration table
handlers_search.go455Search and landing page handlers
handlers_settings.go281Settings page GET/POST
handlers_auth.go280Captcha and PoW handlers
handlers_admin.go~200Admin log and login
handlers_api.go~150JSON API endpoint
handlers_misc.go~100About, health, robots
admin_users.go210User group management
engine.go483Engine interface, types, registry, HTTP client
generic_engine.go453KDL-driven engine factory
engine_brave.go377Brave scraper
engine_google.go301Google scraper
engine_bing.go405Bing scraper
engine_yahoo.go351Yahoo scraper
engine_baidu.go307Baidu scraper
engine_duckduckgo.go230DDG scraper
engine_startpage.go~170Startpage scraper
engine_yandex.go~170Yandex scraper
engine_qwant.go~150Qwant API client
engine_wikipedia.go~120MediaWiki API
engine_youtube.go~130YouTube scraper
engine_hackernews.go~100HN Algolia API
engine_marginalia.go~100Marginalia API
engine_mojeek.go~100Mojeek scraper
engine_wiby.go~80Wiby API
engine_flickr.go~80Flickr API
engine_pexels.go~80Pexels API
engine_soundcloud.go~100SoundCloud API
fanout.go988Concurrent engine dispatch, scoring, dedup, merge
cache.go346In-memory LRU + TTL cache
peercache.go249Friend cache query/push
peers.go268Peer config loading, failure tracking
friendproxy.go327Service proxy between friends
auth.go316Ed25519 sessions, PoW verification
captcha_prerender.go688Pre-rendered captcha pool (IQ test grid)
captcha_image.go307Captcha image compositing
oracles.go893Calculator, unit, timezone, base, translate, DDG IA, Wolfram
oracle_*.go50–780 eachOne oracle (or a tight family) per file: currency, IP, DNS, dictionary, stock, crypto…; shared caches in oracle_helpers.go
airesearch.go600AI agent: the LLM tool loop (RunAIResearch)
airesearch_*.go180–400 eachIts config, environment, LLM client, tools, fetchers, psychoscraper, Lua sandbox
airesearch_sse.go187SSE event streaming
airesearch_cache.go~100Research result caching
mcp_client.go195MCP tool server integration
translation.go614Multi-backend translation with routing
langdetect.go~100Language detection for auto-translate
autocomplete.go302Multi-backend autocomplete merger
classifier.go~100Query intent classification
imageproxy.go433Image proxy with SSRF protection
templates.go260html/template set and shared render helpers
templates_*.go140–570 eachRendering by page or concern: layout, tabs, results frame, row, results, media, settings, log, history, pages
db.go304SQLite schema, logging, queries
groups.go263User tier/group loading from KDL
tiers.go222Permission checking
rate_limit.go202Per-IP rate limiting
rewrite.go~100URL hostname rewriting
instances.go288Instance browser + ami4got
plugins.go214Lua plugin system
engine_snapshots.go52Last working and failing response per engine, for health notifications
sidecar.go~100Python sidecar integration
rss.go~100Atom feed generation
openapi.go530OpenAPI 3.0 spec generation
api_compat.go~1004get-compatible API
api_doc.go~100Plain-text API docs
metrics.go~100Prometheus counters
counters.go~50Atomic hit/miss counters
config_validate.go186Config validation at startup
kdl_doc.go~200The only file that imports kdl-go: node getters, section resolution, syntax errors as file:line:col
helpers.go~80Cookie reading, IP extraction
stubs.go199Compile-time stubs for optional features
types.go~50Shared type definitions

Python sidecar (python-sidecar/)

FileLinesPurpose
server.py96Flask HTTP server
google.py245Google Playwright scraper
yandex.py219Yandex Playwright scraper
qwant.py259Qwant Playwright scraper

KDL configs (data/)

FileControls
config.kdlMain server configuration (port, auth, cache, API keys)
config.default.kdlDefault config template
engines.kdlAll 274 generic engine definitions
peers.kdl / peers.default.kdlFriend network topology and wait policy
groups.kdlUser tiers and permissions
captcha.kdlCaptcha pool sizes and generation cadence
autocomplete.kdlAutocomplete backend weights
translation.kdlTranslation backend priority and rate limits
instances.kdlInstance browser entries
ai-research.kdl / ai-research.default.kdlAI agent provider, model, access control
metaprompt.mdAI agent system prompt

Static assets (static/)

CSS, JavaScript (PoW WASM worker, autocomplete, SSE client), and fonts.

Templates

HTML templates rendered server-side by templates.go; results pages are built in Go in templates_*.go. No client-side framework.

Key design decisions

Single binary. The Go server compiles to one static binary (plus CGO for SQLite). No runtime dependencies except the data/ and static/ directories.

KDL over JSON for subsystems. Human-readable, comment-friendly config. The resolver supports both per-file (peers.kdl) and unified (conf.kdl with sections) layouts.

Singleflight coalescing. Concurrent identical queries share one fanout, preventing thundering herd on popular searches.

Ed25519 session cookies. Session tokens are signed, not stored server-side. No session table, no Redis.

Dual-layer anti-abuse. First-time visitors solve a visual captcha (pre-rendered, no JS required for the test itself). Returning visitors solve a proof of work: HashWX, in WebAssembly, in a Web Worker per core. Both issue signed session cookies.

Oracle-first. Queries that match oracle patterns (math, units, DNS, etc.) return instant answers without waiting for engine fanout.

Friend-first cache. Before fanning out to upstream engines, 4got checks local cache, then friend caches. This minimizes upstream load across the friend network.

Design Decisions

Why federation over Tor outbound for IP-ban avoidance. Tor exit nodes are heavily flagged by upstream engines, leading to high captcha rates and slow responses. Federation distributes queries across multiple real IPs (each friend instance has its own), so no single IP gets rate-limited. Tor outbound is still available per-engine (tor-outbound true) for engines that block datacenter IPs but not Tor, but the primary strategy is the friend network.

Why the code and its comments explain it. Alex, 2026-05-18: “i want to be able to go to any part in the codebase itself and understand completely via code and comments what something is doing and what place it has in the codebase”. Each file opens with what it is for and where it fits; a comment says what is true now and why, the assumption it rests on and the lesson behind it, and leaves the story of how it got there to the devlog.

Why KDL over YAML/TOML/JSON for config. KDL supports inline comments, nested blocks without deep indentation, and space-separated multi-value attributes (ideal for categories "web" "news"). YAML is whitespace-sensitive and error-prone; TOML doesn’t handle nested structures cleanly; JSON forbids comments. KDL’s document-oriented model maps naturally to engine definitions and peer configs.

Why SQLite over Redis/Postgres. SQLite is embedded (no external daemon), survives restarts without a separate persistence layer, and handles 4got’s write volume (search logs, cache, stats) comfortably on a single core. The entire database is one file, trivially backed up. Redis would add an operational dependency for the cache layer alone; Postgres is overkill for a single-instance search engine.

Why single-binary Go over microservices. A metasearch engine’s subsystems (fanout, caching, auth, federation) share in-process state (the engine registry, in-memory cache, rate limiter). Splitting them into services would add network hops on the hot path and complicate deployment for self-hosters. The Python sidecar exists only for Playwright-dependent engines that need a real browser, and communicates over localhost HTTP.

Why no BM25. BM25 was implemented and tested but removed. The marginal ranking improvement over the existing position-weighted cross-engine consensus scoring was negligible, and BM25 is vulnerable to keyword stuffing in snippets – an attacker can inflate term frequency in a single engine’s results to dominate rankings. The current scoring (inverse position * engine weight * engine count * authority domain multiplier) is simpler and harder to game.

Why a general web index counts 17.5 times a specialised engine. Measured, not guessed (2026-09-27; engine_trust.go, go-server/eval_weights_test.go). Package registries, app stores, anime and film databases answer every web search, relevant or not, and each one’s first place used to weigh as much as Bing’s. Over 150 hand-written queries, with each engine’s answers snapshotted once and the two rankings’ top tens judged blind in both orders by an LLM, the trusted general indexes won 138 queries to 4. Weaker settings lost to this one, and stronger ones were no better. Letting Jev pick the kinds of source per query did worse than the fixed rule, and so did trusting the reference sites too.

Why no click tracking. 4got is privacy-first: no result click is recorded, no outbound redirect URL wraps results, and no client-side beacon fires on click. This means ranking cannot incorporate click-through signals, which is an accepted trade-off. The honeypot link (/static/assets/beacon.js) exists solely to detect bots, not to track users.

Why engine goroutines are not cancelled after the user gets their response. When the fanout time budget expires and results are served to the user, the remaining engine goroutines continue running in the background. This is intentional: late-arriving results are merged into the cache, so the next user who searches the same query gets richer results. Cancelling goroutines would save a few connections but would mean cached results are permanently limited to whatever came back within the first time window. The cache is the product; the user’s wait time is the budget.

Why engine health monitoring is notification-based, not autonomous. Engine health snapshots (engine_snapshots.go) store the last working and last error HTML for each engine, and the notification system (notify.go) dispatches structured events to ntfy push notifications, webhooks, and a JSONL event log. Actual remediation happens outside the program — the operator hooks up whatever they want (a Claude agent, a cron job, a human reading notifications). This keeps the search engine’s scope clean: it detects problems and tells you, it doesn’t try to fix them itself. The switch is engine-break-alerts in config.kdl.

Why adaptive PoW difficulty, not static. AdaptivePowDifficulty in auth.go scales the PoW difficulty based on current server load: +1 bit above 100 RPM, +2 above 500, +3 above 1000. This means legitimate users during low-traffic periods solve a ~1 second puzzle, while during attacks the difficulty automatically ramps up. Combined with the image captcha (first visit) and Tor-aware exemptions, this creates a graduated defense that doesn’t punish normal users for attacker behavior.

Why the planner runs in shadow first (plan-first, step 3; planner.go). A search typed as a person talks can be turned into the searches an engine does well with, but whether that helps, how often Jev should send a search on, and how long it takes must be measured before anything a visitor sees depends on it. So for the owner only, beside each web search (never waited for), the planner asks Jev whether rewording or splitting would help and, when it says so, asks the small model for one to three searches, each checked by Jev for drift. Per search that is Jev up to four times (once to decide, and once per planned search to check it hasn’t drifted) plus one model call; a reload within ten minutes asks nothing again. Nothing it plans is searched. What it decided shows in the page’s “This page”; the health page summarises the numbers, kept without the search’s words.

Security Architecture

This document describes the threat model, authentication tiers, and security mechanisms in the 4got metasearch engine.

Threat model

4got faces several threat categories:

  1. Abuse (bots, scraping, DoS): Automated clients attempting to use the instance as a free search API proxy, or overwhelming it with requests.
  2. Privacy leakage: Search queries, user IPs, or browsing patterns leaking to upstream engines, result sites, or third parties.
  3. Server-Side Request Forgery (SSRF): Attackers using the image proxy, service proxy, or AI research agent to access internal network resources.
  4. Cross-Site Request Forgery (CSRF): Malicious sites submitting forms to the instance on behalf of authenticated users.
  5. Plugin/extension code execution: Lua plugins or AI research agents executing arbitrary code within the server process.
  6. Federation trust abuse: Malicious or compromised peer instances exploiting the cache sharing or service proxy mechanisms.

Non-threats (by design)

  • User account compromise: No user accounts exist. All personalization is cookie-based with no passwords.
  • Data theft from database: The SQLite database contains only search logs, engine stats, and anonymized trending data. No PII is stored.

Network-level access control

For private instances shared with friends, 4got recommends mTLS client certificates at the reverse proxy layer (Caddy/nginx). This keeps authentication entirely outside 4got’s scope — unauthorized users are rejected at the TLS handshake before any HTTP traffic is exchanged. See Friend Access (mTLS) for setup instructions.

Authentication tiers

4got uses a tiered authentication model defined in groups.kdl:

TierHow acquiredCapabilities
UnauthenticatedNo cookieRedirected to PoW or captcha challenge
Session (cookie)Solve PoW or captchaSearch access, settings, history
API keyIssued by ownerProgrammatic search access via X-API-Key header
DeluxeGroup membershipAccess to browser-backed engines, banner uploads, AI features
OwnerBearer token matching owner-secret in configFull admin: search logs, user management, engine health, force-unsuspend

Group membership is determined by the group-members section in config.kdl, which maps cookie hashes to groups. Groups inherit permissions from their definition in groups.kdl.

Session lifecycle

  1. New visitor hits any search endpoint.
  2. Server checks for a valid 4got_session cookie.
  3. If absent, redirects to PoW challenge (or captcha for JavaScript-disabled clients and Tor users).
  4. PoW solution or captcha answer is verified server-side.
  5. On success, a session cookie is set with a configurable TTL (captcha-bypass-hours).
  6. The 4got_seen cookie marks a browser that passed the captcha, so later visits go straight to PoW (from a Tor exit, past it). It is signed by the server (an HMAC keyed from the identity key) and expires after captcha-bypass-hours; a cookie the server did not sign, or an expired one, counts as absent.

CSRF implementation

All state-mutating POST endpoints are protected by double-submit CSRF tokens:

  1. EnsureCSRFToken() reads or generates a 32-hex-character token (16 random bytes from crypto/rand).
  2. The token is stored in a csrf_token cookie (HttpOnly is not set because JavaScript needs to read it for AJAX requests).
  3. Every form includes a hidden <input name="_csrf"> field with the token value.
  4. On POST, ValidateCSRF() compares the form field (or X-CSRF-Token header for JSON endpoints) against the cookie using crypto/subtle.ConstantTimeCompare.
  5. Mismatches return 403.

Protected endpoints include: settings update, feedback submission, captcha/PoW verification, banner upload/delete, bookmark operations, and admin actions.

SSRF protection

Multiple subsystems make outbound HTTP requests. Each enforces SSRF protections:

Image proxy (/proxy/image)

  • Fetches through a guarded client (safe_fetch.go): the dialer resolves the name and connects only to an address publicIP() accepts — not private, loopback, link-local, CGNAT (100.64.0.0/10), IPv6 ULA, multicast or reserved. The check is made on every connection, redirects included, so neither DNS rebinding nor a redirect to an inside address gets through.
  • Only fetches image content types; rejects non-image responses.
  • Size limit prevents memory exhaustion from large responses.

AI research agent

  • URL fetch and POST tool calls, and child URLs discovered during page scraping, go through the same guarded client.
  • The Lua sandbox (see below) only exposes http_get/http_post when lua-network is enabled in the AI config.

Favicon proxy (/proxy/favicon)

  • Proxies through DuckDuckGo’s favicon service, not direct connections to arbitrary hosts.

Service proxy (/api/v1/proxy)

  • Only proxies to pre-configured service endpoints (translation backends, Wolfram Alpha, etc.).
  • Only for a friend: the X-Peer-Secret header, this server’s peer-secret.
  • Service names are whitelisted: translation, deepl, lingva, nllb, wolfram, autocomplete.

Lua sandbox boundaries

Plugins (data/plugins/*.lua) and the AI research agent run in sandboxed Lua states with restricted capabilities:

What is allowed

  • Safe standard libraries: base (minus dangerous functions), string, table, math
  • Safe os functions: os.time(), os.clock() only
  • JSON: json_decode(), json_encode()
  • Network (when enabled): http_get(), http_post() with SSRF protection
  • Logging: log() (writes to server log), print() (writes to response stream for AI)
  • Events: emit_event() for plugin hooks

What is blocked

  • Filesystem access: dofile, loadfile, require, io, os.execute, os.remove, os.rename – all removed or never loaded
  • Code loading: load, loadstring – removed
  • Raw table access: rawget, rawset, rawequal, rawlen, getmetatable, setmetatable – removed
  • Full os library: Only time() and clock() are injected; the os library is never opened
  • Debug library: Never loaded
  • Package/module system: Never loaded

Execution limits

  • Per-execution timeout (configurable, default 180s for AI research, shorter for plugins).
  • The Lua state is created fresh per execution – no persistent state between calls.
  • Plugin states persist across calls but are isolated from each other.

Federation trust model

4got instances can form friend networks for cache sharing and service proxying. The trust model is:

Authentication

  • Peer secret: A shared secret (peer-secret in config.kdl) used as a Bearer token for inter-instance API calls.
  • Mutual configuration: Both instances must list each other in their peers.kdl configuration.

Cache sharing

  • Friend instances share search result caches via /api/v1/cache GET/POST.
  • Cache entries are keyed by query hash – friends cannot enumerate what was searched.

Service proxying

  • Instances can proxy service calls (translation, Wolfram Alpha, autocomplete) through friends.
  • allow-proxy in config whitelists which services can be proxied.
  • prefer-friend directives route specific services through preferred friends, only for the owner and groups with friend_proxy; anyone else’s text never reaches the friend.
  • Each proxied request carries the peer secret for authentication.

Trust boundaries

  • Friends see query hashes (SHA-256) but not the original queries in cache keys.
  • No IP addresses or user identifiers are shared between instances.
  • A compromised friend can inject bad cache entries (low-quality results) but cannot:
    • Access the local instance’s search logs or user data
    • Execute code on the local instance
    • Access internal network resources (SSRF protection applies to all outbound requests)
  • Friend connection failures are handled gracefully with the same exponential backoff as engine failures.

Additional security measures

Rate limiting

  • Per-IP and per-cookie-hash rate limiting on search endpoints.
  • Adaptive PoW difficulty increases under load (+1 bit at >100 RPM, +2 bits at >500 RPM).
  • Engine-level rate limiting prevents upstream abuse.

Content Security

  • All user-generated content is HTML-escaped via html.EscapeString().
  • Result URLs use rel="noreferrer nofollow" to prevent referrer leakage.
  • The image proxy strips EXIF data and re-encodes images to JXL where possible.
  • robots meta tag is set to noindex,nofollow on all pages.
  • Session cookies use SameSite=Lax to prevent cross-site attachment.
  • Settings are stored as plaintext key=value cookies with no sensitive data.
  • Cookie hashes (SHA-256 of the session cookie) are used for internal tracking – the raw cookie value is never logged.

No tracking

  • No IP logging in search results or history views.
  • No browser fingerprinting.
  • No third-party analytics or tracking scripts.
  • The /static/assets/beacon.js link is a honeypot for ad blockers, not a real tracker.

Deploying 4got

Quick Start

git clone https://github.com/your-user/4got.git && cd 4got
cp data/config.default.kdl data/config.kdl   # edit owner-secret!
docker compose up -d

Open http://localhost:8888 — you have a working search engine. See First-run configuration to set your admin secret and API keys.

Docker Compose

The recommended way to run 4got. The docker-compose.yml builds both the Go server and the optional Python sidecar.

# Start the server only (no browser-backed engines)
docker compose up -d

# Start with the Python sidecar (Google/Qwant/Yandex in a real browser, math answers, reverse image search)
docker compose --profile sidecar up -d

# View logs
docker compose logs -f server

# Stop everything
docker compose down

Configuration lives in data/config.kdl (mounted as a volume). The SQLite database (data/4got.db) is created automatically on first run.

To customise ports, API keys, or peer settings, copy the override example and edit it:

cp docker-compose.override.yml.example docker-compose.override.yml
# edit docker-compose.override.yml, then:
docker compose up -d

First-run configuration

  1. Copy data/config.default.kdl to data/config.kdl if you haven’t already
  2. Set owner-secret to a strong random string — this is your admin password:
    python3 -c "import secrets; print(secrets.token_urlsafe(32))"
    
  3. Add API keys in the api-keys block (all optional):
    • wolframalpha — instant answers
    • deepl — translation widget
    • spotify-client-id / spotify-client-secret — music results
  4. Configure engine groups in data/groups.kdl (the defaults are sensible)
  5. Start the server and visit /admin/login to authenticate as owner
  6. Optionally set peer-secret and configure data/peers.kdl for federated search across multiple instances
  7. Run ./4got --bench for this machine’s capacity report (see Size it below)

Prerequisites

  • Go 1.23+ (the go.mod targets 1.25 but 1.23+ should work)
  • SQLite3 development headers (e.g. libsqlite3-dev on Debian, sqlite-dev on Alpine)
  • GCC or a C compiler (required by go-sqlite3’s CGO binding)
  • The programs under Programs it calls, for the features that use them
  • Playwright (optional) for the Python sidecar that handles JS-rendered engine scraping

Programs it calls

Each is optional: without one, only its feature goes. The container image has the first five.

  • cjxl, djxl (libjxl-tools): JPEG XL captchas, banners and cached pictures; banners as PNG for browsers without JPEG XL; uploaded still banners
  • avifenc (libavif-bin): AVIF banners and captchas for browsers without JPEG XL (else PNG and JPEG)
  • pdftotext (poppler-utils): the text of attached PDFs
  • tesseract (tesseract-ocr): the text in an image searched or attached
  • zbarimg (zbar-tools): QR codes and barcodes in an image searched
  • pandoc (pandoc): the text of attached DOCX and ODT files
  • ffmpeg (ffmpeg): uploaded animated GIF banners, as animated AVIF

On Debian: apt install --no-install-recommends libjxl-tools libavif-bin poppler-utils tesseract-ocr zbar-tools, and pandoc ffmpeg for the last two (about 580 MB more). The container image takes those two with --build-arg EXTRAS="pandoc ffmpeg".

Building from source

make build

This writes the binary outside the source tree (to ~/.cache/go-builds/4got/). Avoid a bare go build inside go-server/ — it leaves a ~50 MB binary in the checkout, which is gitignored (so git never warns) but still churns through Syncthing/Dropbox and any filesystem snapshots. A test in the suite fails if one appears.

Python sidecar (local dev only)

python-sidecar/start.sh creates its virtualenv outside the checkout by default — at ${XDG_CACHE_HOME:-~/.cache}/4got/python-sidecar-venv — for the same reason: a Playwright env is ~400 MB. Point it wherever you like:

SIDECAR_VENV=/opt/4got/venv ./python-sidecar/start.sh
SIDECAR_VENV=.venv          ./python-sidecar/start.sh   # in-tree, if you prefer

It uses uv when installed and falls back to python3 -m venv + pip otherwise, so no extra tooling is required. None of this applies to the Docker deployment above, which installs into the image.

CGO must be enabled (it is by default). If cross-compiling, set CGO_ENABLED=1 explicitly:

CGO_ENABLED=1 go build -o 4got .

The binary is fully self-contained. Copy it alongside the data/, static/, and templates/ directories.

The documentation

The server serves this documentation at /docs/ when a built book sits at docs/book/ beside data/. The Docker image builds it. From source, make book builds it into ~/.cache/4got/book (it needs mdbook); copy that to docs/book/ beside your data/. Recommended: your own copy matches your version, which matters if you run an older release or a fork.

Directory layout

4got/
  go-server/
    4got          # the binary
  data/
    config.kdl    # main configuration
    *.kdl         # subsystem configs (peers, groups, captcha, etc.)
    4got.db       # SQLite database (created automatically)
  static/         # CSS, JS, fonts
  templates/      # HTML templates

The binary reads the file FGOT_CONFIG names, or else the first config.kdl in $FGOT_DATA_DIR, data/ under the working directory, or ../data/ (when running from go-server/). With none it says so at startup and runs on FGOT_* environment variables alone.

Running directly

cd /path/to/4got
./go-server/4got

By default it listens on 0.0.0.0:8888. Override via config.kdl or environment variables:

FGOT_PORT=9999 FGOT_HOST=127.0.0.1 ./go-server/4got

Running with systemd

A production-ready unit file ships in the repo at 4got.service. Install it:

sudo cp 4got.service /etc/systemd/system/4got.service
sudo systemctl daemon-reload
sudo systemctl enable --now 4got
sudo journalctl -u 4got -f

The unit file targets network-online.target, runs as user/group 4got, applies security hardening (ProtectSystem=strict, ProtectHome=yes, NoNewPrivileges, PrivateTmp), and sets LimitNOFILE=65536 for high-concurrency deployments. Edit ReadWritePaths if your data directory is not /opt/4got/data.

Server storage at rest, and a one-time VACUUM

What people keep on the server (settings, profiles, research contexts, bookmarks and folders, scheduled searches, pasted Goggles) is sealed under the server history key, as server history is. The first start of a version that seals it seals what was kept in the clear, in the background, a person at a time, and then truncates the WAL; its log line says how many values and how long it took. Back up history.key apart from the database: without it none of this can be read, and once anything is sealed a start without it refuses.

Pages freed before the database zeroed what it deletes (secure_delete, on since 2026-10-06) can still hold old values in the clear inside the database file. The binary has no flag for clearing them. To clear them once, stop the server and VACUUM the database, with free disk equal to its size (it holds the database for minutes when it is large, so do it in a maintenance window):

sudo systemctl stop 4got
sqlite3 /opt/4got/data/4got.db 'VACUUM;'
sudo systemctl start 4got

Rolling back. Roll back only to v0.452.10 or later: an earlier release deletes sealed research contexts at start and runs sealed scheduled searches. While rolled back, leave settings alone: a release before sealing shows the sealed ranking, profiles and contexts as empty, and a change made then wins over the sealed one at the next upgrade.

Reverse proxy

nginx

server {
    listen 443 ssl http2;
    server_name search.example.com;

    # The Privacy page says a visitor's address is written nowhere that
    # outlives the request; nginx writes it in both of these logs.
    access_log off;
    error_log /dev/null;

    ssl_certificate     /etc/letsencrypt/live/search.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/search.example.com/privkey.pem;

    # A browser's settings travel in a few cookies of up to 4 KB each, so its
    # Cookie header can pass 8 KB (every API key set: 11 KB; every key and
    # every engine's weight: 18 KB), and the first answer after the upgrade
    # that packs a browser's old cookies carries up to 24 KB of Set-Cookie (a
    # browser at Firefox's 180 cookies). nginx's defaults (8 KB a request
    # header, 4 KB of response headers) answer 400 and 502.
    large_client_header_buffers 4 32k;

    location / {
        proxy_pass http://127.0.0.1:8888;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_buffer_size 32k;
        proxy_buffers 8 16k;

        # SSE support (AI research agent)
        proxy_buffering off;
        proxy_cache off;
        proxy_read_timeout 120s;
    }

    # Optional: serve static files directly
    location /static/ {
        alias /opt/4got/static/;
        expires 7d;
    }
}

Caddy

{
    # The Privacy page says a visitor's address is written nowhere that
    # outlives the request; Caddy's error lines hold it, with the URL.
    log {
        format filter {
            wrap json
            fields {
                request>remote_ip delete
                request>client_ip delete
                request>remote_port delete
                request>uri delete
                request>headers delete
                request>tls delete
            }
        }
    }
}

search.example.com {
    reverse_proxy 127.0.0.1:8888
}

Caddy handles TLS automatically via Let’s Encrypt.

Docker / Podman

From nothing to a working 4got you own, in three steps. There is no published image, so you build one from the Dockerfile in the repo root first (about four minutes, six the first time; the image is about 370 MB). Every command works the same with docker in place of podman.

git clone <repo-url> 4got && cd 4got
podman build -t 4got .

1. Start it.

podman run -d --name 4got -p 8888:8888 -v 4got-data:/data 4got

Everything the server keeps lives in the 4got-data volume, mounted at /data: config.kdl, the other .kdl files, the database and the caches. On the first start the container copies the shipped files into the empty volume and starts config.kdl from config.default.kdl. Search at http://localhost:8888.

2. Get your owner secret. The owner secret is your admin password. On the first start the server makes a strong one, writes it into /data/config.kdl (readable by its owner only), and logs one line saying where it is, never the secret itself. Read it with:

podman exec 4got grep owner-secret /data/config.kdl

It stays the same across restarts. To set your own instead, pass it when you start the container; it wins over the file:

podman run -d --name 4got -p 8888:8888 -v 4got-data:/data -e FGOT_OWNER_SECRET='your-own-long-secret' 4got

3. Log in and work down the Suggestions. Open http://localhost:8888/admin/login, paste the secret, and you land on /admin. Suggestions lists what is worth doing next (API keys left empty, AI research off, and so on), each with the file and key to change. Switches change one setting at once, and Edit a file opens groups.kdl and the other offered files with Validate and Save; both write into the volume and keep a backup.

4. Size it. podman exec 4got ./4got --bench prints a capacity report and exits, leaving the running server alone: memory and disk, how much cache fits, searches and people so far, your API keys’ daily limits, how many people a day each group could serve, and how fast history grows, with when to prune it. Set the cache sizes and group limits from it, and run it again once real searches have come in.

To change anything else by hand, edit the file in the volume and restart:

podman exec -it 4got sh    # files are in /data
podman restart 4got

To upgrade, rebuild the image, then podman rm -f 4got and run step 1 again with the same volume. Your config and secret are kept, files new in the release arrive, and files you deleted stay deleted (/data/.shipped-files remembers what was offered). Shipped updates to a file already in your volume, such as engines.kdl, do not replace your copy; only the *.default.kdl references are refreshed.

docker compose up -d (Docker Compose) does the same with the docker-compose.yml in the repo, and docker compose --profile sidecar up -d adds the Python sidecar; read the secret with docker compose exec server grep owner-secret /data/config.kdl.

Codebase size comparison

Measured 2026-10-27 at v0.408.1, with wc -l for lines and tok for tokens (Claude Opus 5.5’s tokenizer, an estimate), against 4get and SearXNG as of their 2026-08-01 commits. Vendored code (go-server/third_party, 8,106 lines) is left out.

LinesTokens
4got Go (minus tests)127,0631,926,507
4got browser JS and CSS24,929528,094
4got KDL config (engines, groups, translation)5,13465,090
4got HTML templates2,06375,558
4got Python (sidecar, tools)2,14129,430
4got, without tests161,3302,624,679
4got Go tests112,1812,092,128
SearXNG Python (minus tests)51,364625,301
SearXNG client (TypeScript, LESS)5,67751,409
SearXNG settings.yml3,45837,017
SearXNG Jinja templates2,29650,054
SearXNG, without tests62,795763,781
SearXNG tests3,76154,328
4get PHP38,092393,526
4get JS and CSS3,89629,340
4get (no tests)41,988422,866

Without its tests, 4got is 2.6 times SearXNG’s lines and 3.4 times its tokens, and 3.8 and 6.2 times 4get’s. It does more than either: oracles, the research agent and AI overview, Jev’s ranking, friends and federation, history with its lock, bookmarks and likes, pastes, Lens, and its own engines in Go. Its tests are nearly as large as its code: AI agents write them, and every claim in .meta/claims.jsonl names the test that catches its mutation.

Page weight

Measured 2026-10-29 on production (v0.435.1) with tools/page_weight.py, which loads a page in Firefox and reads the browser’s own Resource Timing (bytes over the wire, headers included; 0 for what came from the browser’s cache). The search was “sphagnum moss”, as a machine (no AI extras).

HTMLHTML as sentfirst visit, as sentagain, as sent
4got results page133.7 KB17.7 KB575 KB (87 requests)19.6 KB
DuckDuckGo, the JavaScript page19.2 KB19.5 KB1,641 KB (48 requests)20.1 KB

A second search costs about the same as its HTML, because 4got’s stylesheet and scripts are cached for a year (their addresses change with each release). The first visit’s 575 KB was 60 scripts (291 KB as sent, 743 KB once unpacked), 20 site icons (192 KB), the stylesheet (71 KB) and the page. The site icons are now kept at the size a row draws them: the same 20 came to 29 KB (favicon_shrink.go). Every results page still loads every script; loading each only where the page uses it is the next step.

An answer card is a small part of a page. Each card’s own HTML, on the same day: currency 1.3 KB, the time 1.5 KB, an area code 1.6 KB, a UUID 1.7 KB, weather 2.0 KB, a map 3.1 KB, radio by era 3.5 KB, the Wikipedia card with its other encyclopedias 4.0 KB, the dictionary with its tabs 6.9 KB. Of the 134 KB (unpacked) of the “sphagnum moss” page’s HTML, its 20 rows were 88 KB (4.4 KB each, with their menus), inline SVG icons 24 KB and inline scripts 5 KB.

4get.ca answered this server’s honest User-Agent with “Tshh, blocked!”, DuckDuckGo’s no-JavaScript page (html.duckduckgo.com) with a picture challenge, and searx.be with a browser check, so their results pages can’t be measured from here without pretending to be a browser. What they ship to every page can: 4get.ca’s stylesheet and script came to 65 KB as sent, and SearXNG’s results page needs its stylesheet (86 KB, 13.5 KB gzipped) and one script (4.6 KB, 1.9 KB gzipped), its map and other code loading only when used.

Rerun: python3 tools/page_weight.py pages URL … for whole pages, python3 tools/page_weight.py cards BASE QUERY … for the bytes of each answer card on a 4got.

PaaS providers

SQLite needs persistent storage on every PaaS. Ephemeral filesystems lose your cache, stats, and search history on every redeploy. Always mount a volume at /data.

Fly.io

A fly.toml is included in the repo root. Create a volume before deploying:

fly launch          # creates the app, detects the Dockerfile
fly volumes create 4got_data --region iad --size 1
fly deploy

The fly.toml mounts the volume at /data and exposes port 8888 internally. Fly handles TLS and routing automatically.

Railway

Railway auto-detects the Dockerfile. Set the PORT environment variable to 8888 in your service settings. Attach a persistent volume mounted at /data to keep SQLite state across deploys.

Render

Create a new Web Service with Docker deployment. Point it at the repo, then add a persistent disk mounted at /data (minimum 1 GB). Set the HTTP port to 8888 in the service configuration.

Coolify

Self-hosted PaaS. Point Coolify at the git repo, it will build from the Dockerfile. Add a persistent volume mapped to /data. No special configuration needed beyond that.

LXC / bare metal

Install Go 1.25+ and a C compiler (GCC), then build from source:

cd go-server
CGO_ENABLED=1 go build -o 4got .

Copy the binary alongside the required directories to the target machine:

rsync -a go-server/4got go-server/templates/ static/ data/ docs/ target:/opt/4got/

The binary runs from the project root and expects data/, static/, and go-server/templates/ as siblings (it searches multiple template paths automatically). See Running with systemd above for a production service file.

DNS privacy

To prevent search query leakage to your ISP via DNS resolution, run dnscrypt-proxy in front of your system resolver (Technitium, Unbound, or systemd-resolved). This encrypts outgoing DNS queries to upstream resolvers.

Recommended setup:

  1. Install dnscrypt-proxy and point it at trusted DoH/DoT servers (e.g. Quad9 9.9.9.9, Cloudflare 1.1.1.1).
  2. Configure your local resolver (Technitium/Unbound) to forward to 127.0.0.1:5353 (dnscrypt-proxy’s default listen port).
  3. Ensure 4got’s host uses this resolver chain so engine queries don’t leak plaintext DNS to your ISP.

Or just point Claude Code at this repo and ask it to help you deploy

claude "Deploy 4got to my server at /opt/4got. Set up systemd, nginx reverse proxy on search.example.com, and configure a Wolfram Alpha API key."

Address-bound instances (kids.4got.alexs.space, deployed 2026-09-03)

A worked example of bindings.kdl, from the live instance.

The point: a hostname cannot enforce a content filter, because the client writes the Host header. An address can — the connection is established before any HTTP is parsed. This is the same reason forcesafesearch.google.com resolves to different servers rather than setting a flag.

Setup, in this order. DNS is LAST; pointing a kids. name at an unfiltered instance serves unfiltered results under a name that reads as safe.

  1. Add the address to the interface, and persist it:

    sudo ip -6 addr add 2a07:e05:3:82::2/64 dev eth0
    # then add it to /etc/netplan/50-cloud-init.yaml and `netplan generate`
    
  2. Write data/bindings.kdl binding that address (see below).

  3. Restart, and confirm BOTH log lines appear:

    BIND: [2a07:e05:3:82::2]:8888 -> kids (3 settings, locked=true)
    BIND: also listening on [2a07:e05:3:82::2]:8888
    
  4. Verify it actually filters, sending a cookie that tries to turn filtering OFF.

  5. Only then create the DNS record — AAAA, unproxied. A proxied record sends traffic through Cloudflare, which terminates the connection and erases the destination address, so the binding would match nothing.

  6. Give it TLS. A bound listener speaks plain HTTP, so a public hostname pointed at it fails with SSL_ERROR_INTERNAL_ERROR_ALERT — Caddy is already on *:443 and has no certificate for the new name. Add a site block that proxies to the BOUND ADDRESS, never to localhost:

    kids.4got.alexs.space {
        encode zstd gzip
        reverse_proxy [2a07:e05:3:82::2]:8888
    }
    

    Proxying to 127.0.0.1 here would erase the destination and silently disable the binding — unfiltered results under a name that reads as safe. Forwarding to the bound address preserves it (verified: 0 adult-site links through the full HTTPS path with safesearch=0 sent).

    The ACME challenge (tls-alpn-01) reaches the host over IPv6, which works only because the AAAA is unproxied. A Cloudflare-proxied record breaks both the challenge and the binding.

    This step was MISSED on the first deployment: HTTP-only was reasoned about for a LAN, then carried unexamined onto a public hostname. Alex found it by clicking the link.

safesearch alone is not enough. Measured on the live instance: with safesearch forced to strict, porn still returned 8 links to adult sites (the sites themselves plus archive.ph, web.archive.org and webcache mirrors of them), because upstream engines filter imperfectly. Adding discard_domains took it to 0 across porn, xxx and nude, versus 32 on the normal listener.

The discard list mirrors the Kid-safe profile preset in profile_presets.go; keep them in step.

Verified adversarially: the test sent safesearch=0 AND an empty discard_domains= — an explicit attempt to clear the filter — and the locked binding overrode both.

IPv6 reach: this address is IPv6-only, so an IPv4-only client cannot reach it. It fails closed (unreachable, not unfiltered), but on a network without IPv6 it will not work at all. For general reach, bind an IPv4 address or a distinct port.

Scaling plan

Every server owner needs one. This is the capacity model for a 4got instance, worked for the reference deployment (1 vCPU, 1 GB RAM, 300 mbps, 1 TB/month), and the API-key policy that survives growth.

The surprise: bandwidth is the binding constraint, not compute

Go handles thousands of concurrent connections on one core; a cached search serve is sub-millisecond work. The ceilings, in the order you will actually hit them:

  1. Monthly traffic cap. 1 TB/month ≈ 33 GB/day ≈ 385 KB/s sustained. A results page is ~100 KB raw, ~30 KB with compression, before proxied images. That prices the box at roughly ~1M page views/month as an absolute ceiling — and proxied images eat it far faster, which is why the traffic guardrails throttle heavy transfers first while search stays fast. Watch the Traffic line in settings; the knobs are traffic-* in config.kdl.
  2. Upstream engine tolerance. Every UNCACHED search fans out to dozens–hundreds of engines from one IP. Public engines throttle single IPs long before your hardware blinks. The realistic uncached-fanout budget is hundreds to low thousands per day per engine — the communal cache’s hit rate is therefore the real multiplier of the whole system. Everything that raises hit rate (shared anonymous cache, prefetch, peers) is scaling work.
  3. Compute/RAM. Last by a wide margin: ~50–100 simultaneous uncached fanouts before TLS handshake latency degrades on one core; cached serves in the hundreds per second; SQLite’s single writer is nowhere near stressed at these rates.

Net: thousands of daily active users are realistic on the reference box if the cache hit rate is healthy; millions of monthly uniques require more egress — a bigger pipe, and more usefully, peers: federated instances sharing caches are the horizontal-scaling story, and each peer brings its own upstream IP budget.

API keys: the tiered policy

Server-covered keys do not scale — a 25-req/day API handed to the public is exhausted by breakfast and everyone’s annoyed. The policy that scales:

  • Trusted groups (deluxe: friends, family, beta testers) — keys covered by the server, limits shown in settings.
  • Everyone else — bring your own key. A pool BYO keys can opt into (Settings › API keys, Share beside your own key, with limits like “30/day; 3/day everyone; 6/day trusted”; search APIs only, go-server/key_pool.go), whose draws are randomly scrambled across contributed keys, which (a) gives contributors anonymity-by-randomness against the API provider — the provider sees the server’s IP either way, but key-scrambling breaks the which-human-asked-what linkage that identity-tied keys otherwise leak — and (b) absorbs surges, since most people use a fraction of their quota on most days, so a member could burst far beyond their own key some days (their agents too) against the pool’s slack. Only someone with no key of their own, whom the server’s keys don’t cover, draws today; (a) and the bursting are not built.
  • Grace budget (Monero era, planned): pool members may run negative within a configured grace; the deeper negative, the harder the scheduler works to lend their key out. Balances settle when the ledger lands.
  • ToS note for owners: some API providers prohibit key pooling. Enabling the pool will be the owner’s call per API; the per-key limit fields and group gating already let you keep sensitive keys unpooled.

Changing server defaults without fighting users’ cookies

Revoking a covered key, changing a default, renaming a setting — all must be supported behavior, not a migration crisis. Mechanism (planned): a settings epoch — the server stamps an epoch into served settings; cookies carry the epoch they were written under; on mismatch the server migrates known-renamed keys, drops known-dead ones, and (where a change is user-visible) says so once. Until the epoch machinery lands, the rule of thumb: additive changes are free; renames keep a legacy-read fallback (as ai_mode → ai_mode_single/double does today); revocations of covered keys degrade to “bring your own” messaging rather than errors.

Troubleshooting

Common operational issues and how to resolve them.

Engine suspension

Symptoms: An engine shows “suspended” status on the /admin/log page, or search results suddenly exclude a particular source.

Cause: The rate limiter auto-suspends engines after repeated failures (timeouts, HTTP errors, empty results). Suspension uses exponential backoff – each successive failure doubles the cooldown period.

Diagnosis:

  1. Visit /admin/log (public) or /admin/health (owner). Suspended engines show a red “suspended” status badge.
  2. Check the server logs for lines like engine X: error ... or engine X: timeout.
  3. Verify the upstream engine is actually reachable: curl -I https://engine-url/.

Resolution:

  • Engines auto-recover once the backoff period expires and the next request succeeds.
  • Owner can force-unsuspend via the admin health dashboard.
  • If the engine requires an API key, verify the key is valid and not rate-limited.
  • For scraping-based engines (Google, Bing, Yahoo), verify the instance IP is not blocked. Rotating the IP or enabling deluxe mode (browser backend) may help.

PoW difficulty tuning

Symptoms: Users complain PoW takes too long, or bots are getting through too easily.

Configuration: Set pow-difficulty in config.kdl (default: 22 bits). Higher values require more computation:

  • 18-20: fast solve (~100ms), low bot resistance
  • 22-24: moderate (~500ms-2s), good balance for most instances
  • 26+: strong bot resistance, may frustrate users on slow devices

The server applies adaptive difficulty automatically: +1 bit above 100 requests/minute, +2 bits above 500 RPM. The base difficulty in config is the floor.

Tuning tips:

  • Monitor PoW success/fail rates on /admin/log (IQ stats section).
  • If PoW fails are very high, bots may be attempting brute force – raise difficulty.
  • If legitimate users report slow verification, lower the base or ensure the PoW JavaScript is loading correctly (check for CDN/proxy issues stripping scripts).

SQLite WAL growth

Symptoms: The 4got.db-wal file grows continuously, consuming disk space.

Cause: SQLite WAL (Write-Ahead Logging) mode checkpoints periodically, but under sustained write load the WAL file can grow before checkpointing catches up. The server opens the DB with _journal_mode=WAL&_busy_timeout=5000.

Resolution:

  1. Check WAL size: ls -lh data/4got.db-wal
  2. Force a checkpoint: sqlite3 data/4got.db 'PRAGMA wal_checkpoint(TRUNCATE);'
  3. If the WAL grows beyond a few hundred MB consistently, the write rate may be too high. Consider:
    • Reducing search logging verbosity
    • Raising the acceptable cache age (cache_max_age) to reduce repeated engine calls
    • Disabling server-side history for non-owner users
  4. The -shm file is a shared memory index for WAL and is safe to ignore.

Prevention: The server uses separate read and write DB connections. The write connection handles checkpointing. Under normal operation, WAL files stay small (<50 MB).

Peer auth failures

Symptoms: Friend instances show errors in logs, peer cache sharing fails, proxy requests return 401/403.

Diagnosis:

  1. Verify peer-secret in config.kdl matches on both sides.
  2. Check that the friend’s URL in peers.kdl is reachable and includes the correct protocol (https://).
  3. Look for TLS certificate errors in logs – self-signed certs need explicit trust.
  4. Verify the friend instance is running a compatible API version (/ami4got returns version info).

Common issues:

  • Clock skew: if timestamps are used in auth tokens, ensure NTP is synced on both instances.
  • Firewall rules: peer cache uses /api/v1/cache and /api/v1/proxy endpoints – ensure they are not blocked.
  • Permissions: a friend needs no group. It is known by peer-secret, and its push by its pubkey in peers.kdl.

Memory usage

Symptoms: The server process consumes more memory than expected, or OOM-kills occur.

Common causes:

  1. Image proxy cache: In-memory image cache grows with traffic. Configure max_cache_size in the image proxy config, or rely on SQLite-backed caching with eviction.
  2. Highlight regex cache: Capped at 10,000 entries, auto-evicts when full. Not usually a problem.
  3. Peer cache: Cached results from friend instances are held in memory. Large peer networks with high traffic multiply memory usage.
  4. AI research: The LLM research agent (if enabled) buffers responses. Each concurrent research session uses memory proportional to response length.
  5. Prerendered captchas: Image data is held in memory until served. The pool size is bounded.

Monitoring: Check /ami4got for basic stats. For detailed memory profiling, run with GODEBUG=gctrace=1 or attach pprof if built with the debug profile.

Mitigation:

  • Set GOGC environment variable to control GC aggressiveness (default 100; lower values like 50 trade CPU for less memory).
  • Reduce max_cache_size for image proxy.
  • Limit concurrent AI research sessions.

Common Docker issues

Symptoms: Container fails to start, database errors, or static files not found.

Template/static file not found:

  • The Dockerfile copies go-server/templates/ and static/ into the image. If you modified the directory structure, update the Dockerfile paths.
  • Verify with docker exec <container> ls /app/templates/ and ls /app/static/.

Database permissions:

  • SQLite needs write access to the data directory. Mount a volume: -v ./data:/app/data.
  • If the container runs as a non-root user, ensure the volume has correct ownership.

Port binding:

  • Default port is 8080. Map it with -p 8080:8080 or set HOST / PORT environment variables.
  • In docker-compose.yml, verify the ports section matches your config.

CGO / SQLite:

  • The binary requires CGO for SQLite. The Dockerfile uses CGO_ENABLED=1. If building a custom image, ensure gcc and sqlite-dev are installed.

Health checks:

  • Use /ami4got as a Docker health check endpoint: HEALTHCHECK CMD curl -sf http://localhost:8080/ami4got || exit 1.

fly.io specific:

  • The fly.toml mounts a persistent volume at /data. Ensure the volume exists: fly volumes create data.
  • Memory: fly.io shared-1x VMs have 256 MB. If using AI research or large peer networks, upgrade to at least 512 MB.

Friend Access with mTLS

4got uses mutual TLS (mTLS) client certificates to control who can access your instance. This is a deliberate choice over OAuth, SSO, or any third-party identity provider — your friends prove their identity with a cryptographic certificate that you issued, and no external service is involved in the handshake.

Why mTLS instead of OAuth?

OAuth solves “let strangers log in with their existing accounts.” You’re solving “let my friends in and everyone else out.” Different problem, different tool.

With mTLS:

  • No third party knows who uses your search engine. There’s no Google/GitHub/Discord OAuth callback leaking the fact that your friend searched for something. The authentication is a TLS handshake between the client and your server — no one else is in the loop.
  • No tokens to steal. A stolen OAuth token gives an attacker your session. A stolen client cert without the private key is useless. The private key never leaves your friend’s device.
  • No session hijacking. The TLS handshake happens before HTTP. There are no cookies, headers, or query parameters that a man-in-the-middle or XSS attack could extract.
  • No infrastructure dependency. Your auth doesn’t break when GitHub is down, when Google changes their OAuth scopes, or when Discord decides to deprecate an API version.
  • Revocation is simple. Remove a friend’s certificate serial number from the trust list. Done. No “invalidate all sessions” dance.

The tradeoff is that cert distribution requires a one-time manual step per friend. For a friends-and-family instance, this is a feature, not a bug — it means access can’t be self-service, which is exactly what you want.

How it works

Friend's browser                         Your server
      |                                       |
      |------- TLS ClientHello -------------->|
      |<------ TLS ServerHello + ServerCert --|
      |<------ CertificateRequest ------------|
      |------- ClientCert (signed by your CA) |
      |------- CertificateVerify ------------>|
      |                                       |
      |  (server checks: is this cert signed  |
      |   by my CA? is it not revoked?)       |
      |                                       |
      |<------ TLS Finished ------------------|
      |------- HTTP request ----------------->|
      |<------ Search results ----------------|

If the client doesn’t present a valid certificate, the TLS handshake fails. The connection is refused before any HTTP traffic is exchanged. Unauthorized users never reach 4got — they get a TLS error, not a login page.

Setup

1. Create your Certificate Authority

You are the CA. This is a one-time operation.

mkdir -p /etc/4got/certs && cd /etc/4got/certs

# Generate CA private key
openssl genrsa -out ca.key 4096

# Generate CA certificate (valid 10 years)
openssl req -new -x509 -key ca.key -out ca.crt -days 3650 \
  -subj "/CN=4got Friend CA/O=4got"

Guard ca.key with your life. Anyone with this file can issue client certs that your server will trust. Store it offline when not issuing new certs.

2. Issue a client certificate for a friend

Run this for each friend. Replace alice with their name.

# Generate friend's private key
openssl genrsa -out alice.key 2048

# Generate a certificate signing request
openssl req -new -key alice.key -out alice.csr \
  -subj "/CN=alice/O=4got Friends"

# Sign with your CA (valid 2 years)
openssl x509 -req -in alice.csr -CA ca.crt -CAkey ca.key \
  -CAcreateserial -out alice.crt -days 730

# Package into a .p12 file (this is what your friend installs)
openssl pkcs12 -export -out alice.p12 \
  -inkey alice.key -in alice.crt -certfile ca.crt \
  -name "4got (alice)"

You’ll be prompted for an export password. Pick something simple — your friend needs to type it once during import. You can use an empty password if you trust the delivery channel.

Clean up the intermediate files:

rm alice.key alice.csr alice.crt
# Keep alice.p12 — this is what you give to your friend

3. Give the .p12 to your friend

Preferably via sneakernet — hand them a USB drive, AirDrop it across the table, or NFC beam it from your phone. Physical proximity is the strongest delivery channel because there’s no server, no log, no metadata trail, and no possibility of interception.

If physical handoff isn’t possible, send the .p12 over an end-to-end encrypted channel (Signal, Matrix with verification, encrypted email). Communicate the export password through a different channel than the file itself (e.g., file over Signal, password spoken over a phone call).

Never send client certificates over unencrypted email, Discord DMs, Slack, or any platform that stores messages server-side. The .p12 contains your friend’s private key — if it leaks, you need to revoke and reissue.

4. Configure Caddy

Caddy handles the public-facing TLS (automatic Let’s Encrypt) and verifies client certificates against your CA.

search.yourdomain.com {
    tls {
        client_auth {
            mode require_and_verify
            trusted_ca_cert_file /etc/4got/certs/ca.crt
        }
    }
    reverse_proxy localhost:8888
}

That’s the entire Caddyfile. Caddy:

  • Obtains and renews a Let’s Encrypt certificate for search.yourdomain.com automatically
  • Requires every connecting client to present a certificate signed by your CA
  • Rejects unauthorized connections at the TLS layer (before HTTP)
  • Forwards authenticated requests to 4got on localhost

5. Your friend installs the certificate

Android

Tap the .p12 file (from Files, a download, or a file manager). Android prompts to install it as a user certificate. Enter the export password. Chrome and other browsers will present it automatically when connecting to your instance.

iOS / iPadOS

Tap the .p12 file to open it. Go to Settings → General → VPN & Device Management and install the profile. Enter the export password. Safari and all apps using the system keychain will present it automatically.

macOS

Double-click the .p12 file. Keychain Access opens and imports it. Enter the export password. Safari and Chrome use it automatically. Firefox users: Preferences → Privacy & Security → Certificates → View Certificates → Import.

Windows

Double-click the .p12 file. The Certificate Import Wizard opens. Follow the prompts, enter the export password, and import into the “Personal” store. Edge and Chrome use it automatically. Firefox users: Settings → Privacy & Security → Certificates → View Certificates → Import.

Linux

Firefox: Preferences → Privacy & Security → Certificates → View Certificates → Your Certificates → Import. Select the .p12 file and enter the export password. Chromium-based browsers: use the system NSS certificate store or import via chrome://settings/certificates.

None of this touches VPN settings, proxy configuration, or network setup. The certificate is a TLS identity credential — it lives in the browser/OS certificate store alongside everything else and is presented during the TLS handshake when the server requests it.

Revoking a friend’s access

Quick method: reissue the CA

If you only have a handful of friends and need to revoke one, the simplest approach is to regenerate the CA and reissue certificates to everyone except the revoked friend. This is practical when you have fewer than ~20 friends.

Proper method: Certificate Revocation List (CRL)

For larger deployments or when you don’t want to bother everyone:

# Create a CRL (first time)
openssl ca -gencrl -out /etc/4got/certs/crl.pem \
  -keyfile /etc/4got/certs/ca.key \
  -cert /etc/4got/certs/ca.crt

# Revoke a specific certificate
openssl ca -revoke alice.crt \
  -keyfile /etc/4got/certs/ca.key \
  -cert /etc/4got/certs/ca.crt

# Regenerate the CRL
openssl ca -gencrl -out /etc/4got/certs/crl.pem \
  -keyfile /etc/4got/certs/ca.key \
  -cert /etc/4got/certs/ca.crt

Note: CRL-based revocation with Caddy requires checking the tls directive documentation for your Caddy version, as CRL support has varied across releases. An alternative is to maintain a list of allowed certificate fingerprints and check them in a Caddy handler.

FAQ

Why not Tailscale / WireGuard? Those are great for private access but they require your friends to install a VPN client and join your network. mTLS works in any browser on any device with zero additional software. It’s also invisible to the user after the one-time cert install — they just open the URL and search.

Why not Cloudflare Access? Cloudflare terminates TLS at their edge and inspects all HTTP traffic in plaintext. There is no Cloudflare configuration where they cannot read your search queries. If you’re building a privacy-first search engine, routing all traffic through a surveillance company defeats the purpose.

Why not HTTP basic auth? Passwords get shared, written down, reused, and phished. Client certificates are cryptographic keys bound to a device. Basic auth is also transmitted on every request (Base64 encoded, not encrypted beyond TLS), while client cert auth happens once during the TLS handshake.

Why not OAuth2 Proxy / Authelia / Authentik? These are good tools for multi-tenant SaaS applications. For a friends-only search engine, they add a database, a login page, a session store, password reset flows, and a dependency on an external identity provider — all to solve a problem that mTLS solves with zero moving parts.

Can my ISP see that my friends are connecting? Your ISP can see that an IP address connected to your server on port 443. They cannot see the client certificate, the search queries, or any HTTP content — that’s all inside the TLS tunnel. The mTLS handshake itself is encrypted.

What if a friend loses their device? Revoke their certificate and issue a new one. The old cert becomes useless immediately (once the CRL is updated or the CA is reissued).

Federation: The Friend Network

4got instances can form a peer-to-peer friend network for cache sharing, service proxying, and instance discovery. This is how multiple 4got deployments cooperate to improve speed and resilience.

Philosophy

The 4got protocol is a result-sharing protocol for self-contained queries — queries that are small, universal, and should have roughly the same answer regardless of who asks or where they ask from. Search engines are just one type of intelligence backend that can feed results into this protocol. A friend’s instance might answer a query from Google, from a custom scraper, from an AI agent, from a local database, or from another friend’s cache — the protocol doesn’t care. It exists to share answers between friends, not to replace any particular search provider. There is room for the protocol to be used with all kinds of intelligence backends beyond traditional search engines.

Overview

The friend network provides three capabilities:

  1. Peer cache sharing — friends share cached search results, reducing redundant upstream queries
  2. Service proxy — friends proxy expensive services (translation, Wolfram Alpha, autocomplete) for each other
  3. Instance discovery — the /ami4got endpoint and instance browser let users find other instances

Peer cache sharing protocol

When a search is performed, 4got asks all configured friends in parallel via GET /api/v1/cache?key=<hash>. The key is a hash of the query and its settings, so the words themselves never leave the instance. Those settings include the region and, from a reader whose first known language is not English, the language their search asks Wikimedia’s wikis in: a copy from a German reader’s search answers only a search asked in German. Friends respond with cached results if available. The ask carries X-Peer-Secret; a person may ask too, as the owner or with a group or API key that allows peer_cache. Without a peer-secret, the cache answers anyone.

Request flow

  1. User searches for “quantum computing”
  2. 4got sends the cache key to all configured friends simultaneously
  3. Friends check their local cache and respond with results (or 404 Not Found on a miss)
  4. 4got merges friend results with its own engine results using the standard scoring/deduplication algorithm

How old a friend’s copy is (age_s, protocol 1.1)

A friend’s answer carries age_s: how many seconds ago its engines answered. A copy is kept in our cache with that age, so it is never fresher here than it really is, and the results line says “(cached 4 minutes ago on alice)”, naming the friend as peers.kdl does (keep-friend-copies false shows the copy without keeping it). A friend from before protocol 1.1 sends no age_s; its copy is read as age 0, which is what every friend’s copy was before, and the line says only “(cached on alice)”. An age_s over a year is refused as a broken answer. Friends on 1.0 and 1.1 understand each other; only a different major version is logged.

A person’s own rules judge the copy first: one older than their “Never older than” limit, or without rows from an engine their “Only if it has results from” list names, is a miss. “Let the classifier judge each search” (Settings › Advanced › Cache freshness, on by default) can shorten that limit for a search whose results it judged short-lived, and then a friend’s copy may be no older than the shorter limit, as ours may not. A friend never shares rows from the engines it runs on its own API keys (share "none"), so naming one of those in the list rules out its copies. Only then does the owner’s trust for that friend apply (see configuration.md): full makes it our cache hit, preview shows it while our engines refresh our cache. When a full and a preview friend both have a copy, the full one is taken.

The push (POST /api/v1/cache)

After a fresh search, 4got sends its results to its friends (the owner’s default-friend-share, and each person’s “Send my results to this server’s friends”). The push is signed with the sender’s key and names it in X-Peer-Identity. The receiver keeps it under the friend whose key in peers.kdl signed it; a push it cannot pin on a friend (verified only by its own key, or unsigned on a server with no friends), or from a friend it blocked, is acknowledged and not kept.

The receiver’s own searches use it: after their own cache misses, a pushed copy is that friend’s copy, already here, judged exactly as one fetched from the friend, by the person’s rules and then the owner’s trust in the sender. Its age is how long ago it arrived. A full friend’s push is a cache hit, and nobody is asked; behind a preview friend’s push, only the full friends are asked, since only they could beat it. “Use no outside services” and Incognito ignore pushed copies, as they ignore friends.

A push goes one hop. It is never served to the receiver’s other friends: GET /api/v1/cache answers only with the server’s own copy. A full friend’s copy that a search took becomes the server’s own, and is served on like any other.

Preferred friends

// Prefer this friend for specific services
prefer-friend "alice" for="translation,wolfram"

Service proxy

Friends can proxy expensive API-backed services for each other. This lets a single Wolfram Alpha API key serve multiple instances, or a single translation backend serve the whole friend network.

How it works

  1. Instance A needs to translate text but has no DeepL API key
  2. Instance A sends POST /api/v1/proxy to friend Instance B with a form-encoded body: service=translation&text=hello&target=fr. The text is in the body, not the URL, so it stays out of access logs. (A receiver also accepts the same fields in the query string, which is what older instances send.) A friend that hasn’t upgraded reads only the query string, so it rejects the body; until it upgrades, instance A falls back to its own service.
  3. Instance B checks its allow-proxy list, finds “translation” is allowed, performs the translation, and returns the result
  4. Instance A uses the result as if it performed the translation locally

Supported services

  • translation — text translation (DeepL, Papago, Lingva, NLLB, Microsoft)
  • wolfram — Wolfram Alpha short answers API
  • autocomplete — search suggestion backends

Configuration

On the provider instance (the one that actually has the API keys):

allow-proxy "translation" "wolfram" "autocomplete"

On the consumer instance (the one that wants to use the services):

prefer-friend "provider-name" for="translation,wolfram"

The consumer will try the preferred friend first, then fall back to local backends. It asks the friend only for the owner and groups that allow friend_proxy (deluxe and translator as shipped); anyone else’s text never reaches the friend, and the local backends answer as if no friend were preferred. Who may use a lent service is the consumer’s choice; the provider only chooses what it lends.

Authentication

Service proxy requests are authenticated using the peer-secret from config.kdl, sent in the X-Peer-Secret header. It is sent with mTLS too, because the receiver checks only the secret.

Relayed searches (POST /api/v1/relay)

A friend can run one web search for another, so the engines see the friend’s address instead of the asker’s. Both owners opt in, per friend, with relay true in that friend’s peer block; the lender must also list the asker’s pubkey.

The lender

  1. The request carries the words in a JSON body, never the URL: {"q", "safe", "region", "page", "to", "asked_at"}, where to is the lender’s fingerprint, so an ask cannot be replayed to another friend. A body over 16 KB gets 413. It is signed like a push: X-Result-Signature (ed25519 over the body) and X-Peer-Identity (the asker’s fingerprint), plus X-Peer-Secret.
  2. Unsigned, signed by a key it does not list, addressed (to) to another server, or asked_at more than 5 minutes from its clock: 401. A friend without relay true, or one it blocked: 403.
  3. Each friend gets relay-per-hour searches an hour (default 60). Past them: 429 with Retry-After. The 200, 429 and 503 answers carry X-4got-Relay-Left, the searches left this hour.
  4. The search passes the lender’s admission gate like a stranger’s. Shedding: 503 with Retry-After, and the search is not counted.
  5. It runs on a fixed set, the lender’s web engines whose rows it shares (never share "none", whose rows are withheld, nor a key-requiring engine or a hand-written one using the lender’s configured key, which would spend the lender’s key), whatever the asker’s request says, at the asker’s safe-search level, never below the lender’s floor, and answers {"results": [...]}: up to 30 rows, without the rows of its share "none" engines.
  6. The words are kept nowhere: no search log, no cache, no push, no trending. Only a count by outcome (fgot_friend_relay_total) is kept.

A friend’s search on one of our engines through POST /api/v1/proxy (service=engine:<id>) is counted too, by engine (fgot_friend_engine_proxy_total), though not limited.

The borrower

The owner’s AI research sends its own searches (the agent’s search tool) through friends: one search at a time, each to the next eligible friend in turn (round-robin, in peers.kdl order). A friend is eligible with relay true and a pubkey, not blocked, its breaker closed, and not waiting out a refusal: a minute after a 503, a quarter hour after a 429, an hour after a 401 or 403. When none is eligible, or the friend asked fails, that search runs here. No classifier picks the friend. The agent also has friend_search(query, instance) to ask one friend by name.

Both are the owner’s only (or everyone’s when default-on lists research_relay), and “Use no outside services” and Incognito turn both off. The research-after-results sub-searches and the planner’s searches are not relayed: they run on chosen engines, which a relay cannot name. Each friend reads the exact words of the searches it is sent.

With overload-relay true (default false), a web search the admission gate sheds goes to the next eligible friend in the same turn instead of the busy page. It respects research’s holds but sets none and leaves the breaker alone, skips a friend whose last X-4got-Relay-Left (within the hour) is 10 or fewer, so research keeps those, waits at most 4 seconds, and at most 2 run at once server-wide. The page shows the friend’s rows, filtered by the person’s engines, labelled “(searched on a friend: this server is busy)”; the SearXNG-shaped JSON (format=json) carries the same words in notice. None of them is cached, prefetched or pushed. With no eligible friend, both slots taken, a failed ask or no rows, the busy page is shown. “Use no outside services” and Incognito turn it off. A search that is not shed is never relayed: to search on another server, search there.

The streamed results (/search/stream, the opt-in progressive results) pass the same admission gate, and a shed web stream goes to a relay friend the same way.

Engines from friends (GET /api/v1/engine-offers)

Friends offer each other the engines they run from engines.kdl. Only the generic blocks travel (settings: an address, selectors or JSON paths), never a Go engine, a plugin or a key.

  1. The offering friend answers only a friend whose pubkey it lists, holding the peer secret, naming itself (X-Peer-Identity) and signing the ask with its identity key: ?at=<unix>&sig=<ed25519 over "engine-offers <offering server's fingerprint> <at>">, within 5 minutes. The secret is every friend’s, so a name alone proves nothing. Each block comes signed with the offering server’s identity key, with its own health for that engine (as /api/v1/engine-health says it). It never passes on what it took from a friend, nor a block holding a secret of its own or a key: a parameter of its address or body named for one (key, token, secret, auth, pass) with a value, or a credential header. A key written inside an address’s path matches no pattern and is not caught, unless the server itself holds it.
  2. The owner’s Engines from friends page (/admin/engines/offers, on the Owner console) asks each friend with a pubkey when it opens. It shows each block this server lacks, and each it runs differently as a diff. A block not signed by that friend’s key is dropped. One that cannot be taken says so: its search address is not http(s) or is a private address, another address in it is not http(s), it holds a key, it would ask the sidecar, a local archive or Tor, or it would replace a built-in engine. A keyed block that would send a key to another host than ours of that id asks says that. A name (localhost, a .lan host) is left to the dial guard, which checks where it resolves.
  3. Accept writes the block to engines.local.d/<friend>-<id>.kdl in the data dir and loads it at once. --check-config and a start read that folder too. A block there replaces engines.kdl’s of the same id. A deploy never writes there. Its engine reaches public addresses only, redirects included. To take one back, delete its file and reload (POST /admin/reload or SIGUSR1). The New engine playground saves there too, as playground-<id>.kdl: such an engine is not offered to friends (propose it upstream instead).
  4. Ignore keeps the block’s hash in engines.local.d/ignored, and that block is not shown again. Mute and Unmute post to the Friends page: a muted friend is not asked, and its directory entries are dropped too.
  5. Each engine in engines.local.d has Propose upstream: a new issue on reference-repo’s tracker (Gitea’s or GitHub’s) with the block in it, opened in your browser for you to send. Nothing is posted by itself.

Questions from friends (GET /api/v1/qa/offer)

Where both servers take questions (the qa block), each lists the other’s open questions and lets the other’s awarded ones answer its searches. One hop: what a friend sent is never offered on. Answering a friend’s question happens on its own server.

  1. A server offers anyone holding the peer secret what anyone reads of its questions: its open ones (id, title, the opening of its words, when asked, its deadline, how many answers, whether an agent asked) and its awarded ones with the opening of the accepted answer and its evidence, 100 of each, newest first. Never a held question, one hidden by reports, one withdrawn or removed, nor an answer before it is published. The list carries its time and is signed by the server’s identity key (ed25519 over "4got-sign|v1|questions\n" and the list). Anyone else, and any asker where questions are off, gets 404.
  2. Each friend’s list is fetched when a page needs it (/questions, a search’s card, MCP’s questions) from each friend trusted on the Friends page whose pubkey peers.kdl lists, and kept 5 minutes from when it arrives, then fetched again; a friend slow to answer holds up no other. A page waits at most 2 seconds in all and shows the lists that have arrived; a search’s card waits for none, and reads only the lists already kept. Nothing older than the 5 minutes is shown, so a question a friend removes or reports hide leaves within them. A list past 1 MB, not signed by that key, or more than 5 minutes from this server’s clock, is dropped whole. Each question is read as a post here is: one whose id is not one, whose title is empty or holds a control character, whose page there is not an http(s) address, or that was asked, or awarded, after its list’s time is refused; a title is cut to 200 characters and the words to their opening; an evidence link not http(s) is dropped; at most 100 open and 100 awarded are taken.
  3. /questions lists each friend’s open questions under “On · ”, after this server’s own, each linking to its page there. A friend’s awarded questions are matched against a search here by the same rule as this server’s (at least two of its words, and half of them), then judged by the classifier as this server’s are, so a search’s words never go to a friend; among those holding as many of its words, this server’s come first. The card says “Answered on ” and links there, and MCP’s search line says so too. A friend muted on the Friends page is left out at once and not asked again; a blocked one is never asked.

Instance discovery

The ami4got endpoint

Every 4got instance exposes GET /ami4got (inspired by 4get’s /ami4get.php). This returns a JSON object with instance metadata:

{
  "status": "ok",
  "service": "4got",
  "server": {
    "name": "search.example.org",
    "description": "Glen's server in Lansing; ask me on Matrix for a friend link",
    "open_to_connecting": true,
    "bot_protection": true,
    "real_searches": 6789,
    "bot_requests": 120,
    "api_enabled": true,
    "version": "2.0",
    "pressure": 0.12,
    "shedding": false
  },
  "protocol_version": "1.1",
  "capabilities": ["cache_share", "cache_push", "proxy", "trending", "consensus", "research", "relay"],
  "instances": ["https://search.friend.example.com"]
}

description is the operator’s server-bio (one line, at most 280 characters; “4got metasearch engine” when unset), and open_to_connecting their open-to-connecting true: this server welcomes new friends.

Instance browser

The /instances page shows a list of known 4got instances. It fetches info from configured friends and public instances periodically.

Each list is nearest first: “From here” is how long this server’s last ask of each took. A server near this one is likely near the person reading the page, so the top of each list is the one to try first. Servers that did not answer come after, then the blocked.

Configure in instances.kdl:

fetch-interval-min 60

friends {
    instance "https://search.friend.example.com"
}

public {
    instance "https://public.4got.example.com"
}

Friend-of-friend discovery

When Instance A fetches /ami4got from Instance B, it can discover Instance B’s own friends. This creates an organic network where adding a single friend connection transitively discovers the broader network.

Setting up two instances as friends

Step 1: Choose a shared secret

Both instances need the same peer-secret in their config.kdl:

peer-secret "a_strong_random_string_shared_between_friends"

Step 2: Configure peers on each instance

On Instance A (data/peers.kdl):

allow-proxy "translation" "wolfram"

peer "instance-b" {
    url "https://search-b.example.com"
}

On Instance B (data/peers.kdl):

allow-proxy "translation" "wolfram"

peer "instance-a" {
    url "https://search-a.example.com"
}

Step 3: Add to instance browser (optional)

On both instances, add each other to instances.kdl:

friends {
    instance "https://search-b.example.com"
}

Step 4: Test

  1. Restart both instances
  2. Search on Instance A — check the logs for “cached on 1 friend” in the results
  3. Visit /admin/log to see engine stats (friend results appear as (friend) entries)

Step 5: Optional mTLS

For additional security, configure mutual TLS between friends:

peer "instance-b" {
    url "https://search-b.example.com"
    cert "/path/to/client.crt"
    key "/path/to/client.key"
}

Both instances need to trust each other’s client certificates.

Discovery Channel federation

Peer instances can advertise their Discovery Channel entries to each other, so a channel is a network rather than one operator’s bookmark file. Entries learned from a peer appear on /discovery under that peer’s name and in search results tagged via <peer> — never merged into your own channel file, and never presented as yours.

What leaves your instance. Only entries you explicitly mark federate=true, and even then three categories are withheld unconditionally:

withheldwhy
entries with user/passa shared credential is between you and the people you gave it to
entries with groups=…scoped to your groups, which have no meaning on someone else’s server
the contact fielda point of contact is for your channel’s members, not every peer-of-a-peer
entries with join=… or cert=…a meshnet invite or a client certificate is a bearer token — anyone who reads it can get in, so broadcasting one hands access to strangers

/api/v1/discovery/advertise requires peer authorization, so the list of what you share is not public.

What arrives. Peers are polled hourly (30s after startup), each response capped at 1 MB and 500 entries. The federated set is REPLACED on each refresh rather than merged, so an entry a peer retracts actually disappears from your instance instead of living forever. Peer entries are shown only to cookie-holders — the same gate as your local channel.

Entry liveness

Entries marked check-uptime=true are probed every 6 hours and show up or unreachable on /discovery and in search results. The channel points at self-hosted services and private hosts, which disappear far more often than indexed web pages — an entry that quietly rotted wastes the reader’s click.

Two deliberate constraints:

  • The server probes, not the browser. A client-side check would have every visitor connect to every private host in the channel — a phonebook behaving like a port scan, and leaking each reader’s IP to every operator listed.
  • Opt-in, HEAD only, no redirects followed, 250 ms apart. Somebody’s home server shouldn’t be pinged because a friend listed it, and a burst of connections from one IP to a list of private hosts is indistinguishable from scanning.

401 and 403 count as up: for a channel full of auth-walled services, an auth wall is the door existing and being locked, which is exactly what the entry promised. Only 5xx and connection failures count as unreachable. An entry with no badge means unknown — either it didn’t opt in, or no check has run yet.

The webring

Entries marked webring=true form this server’s public webring: /ring lists them for anyone, with or without a cookie, and each member can paste a badge on its own pages (the code is beside it on /discovery):

<nav aria-label="search.example webring"><a href="https://search.example/ring/prev?from=1a2b3c4d" rel="prev" referrerpolicy="no-referrer">← prev</a> · <a href="https://search.example/ring" referrerpolicy="no-referrer">search.example webring</a> · <a href="https://search.example/ring/random?from=1a2b3c4d" referrerpolicy="no-referrer">random</a> · <a href="https://search.example/ring/next?from=1a2b3c4d" rel="next" referrerpolicy="no-referrer">next →</a></nav>
  • The badge loads nothing from your server. It is links only, with no image, script or style sheet, so a page view costs you nothing and tells you nothing. A visitor’s browser asks only when they follow one, and the link doesn’t send the page’s address.
  • A hop keeps nothing. /ring/next, /ring/prev and /ring/random redirect to the chosen member, wrapping around the ends, and the redirect carries Referrer-Policy: no-referrer, so the next site isn’t told which member sent the visitor. from is the first 8 hex digits of the sha256 of the member’s address, so reordering discovery.kdl doesn’t break a badge already pasted. When the member has left, the walk starts at the ring’s ends.
  • Joining is public. The flag is ignored for the same entries federation withholds (groups, user/pass, join, cert), and a member’s contact is never shown on /ring.
  • Friends share one ring. Each server advertises its own members to its friends, marked as ring members (with or without federate=true: they are public already), and a friend’s members join your ring after your own, once per address, marked “via” that friend on /ring. A member’s id is the same on every server, so a badge pasted for any friend’s ring walks yours too. It is one hop: a friend’s members are never advertised on, and a muted or blocked friend’s never arrive.

Doors

A door lets the people a friend’s 4got vouches for into a web service of yours (a wiki, Kiwix, a file index, a bookmark manager’s web page), each under a name only your service sees, as many as you allow that friend. It replaces a Discovery entry’s shared user/pass for a web service. Alex, 2026-10-02: “the server using a friends lended service would be responsible for controlling the group that can use it, and the friend lending it would merely have various levels of rate limiting that they use to protect themselves.”

How a person comes in:

  1. They open the service’s entry in their own 4got’s Discovery Channel. Its link is /door/go, which checks that the entry is shown to their group, signs a pass with their server’s key and sends them to https://<the service>/.4got/enter. The entry must be an https address, so a pass never travels in the clear.
  2. The door checks the pass against that friend’s key, offline: signed by a friend it names, addressed to this door, at most two minutes old, never used before, and not from before the door started. It sets its own cookie (Secure, HttpOnly) for 12 hours and sends them on into the service.
  3. Before each request, the reverse proxy asks the door (forward auth). It answers 200 with Remote-User: alice-1a2b3c4d5e6f7a8b (the friend’s name and the person’s name for this door), Remote-Name the same and Remote-Groups: alice, or “come in through your 4got”. When the cookie lapses, the next page load goes back through the person’s 4got for a fresh pass, with no click; someone who has left the group there is refused there. The door tells that 4got only the service’s address: it keeps the page the person was on in a cookie of its own for those five minutes.

A person’s name for a door is made from their identity on their own 4got, so that identity has to last from one visit to the next. /door/go keeps it (as History or a bookmark does) only on the person’s own press: the Discovery link, pressed on their 4got. Someone who keeps nothing there and is sent to /door/go by another site is asked first (“Go in to Glen’s films?”), and nothing is kept unless they press Go in.

For a minute after it starts, a door takes no pass: it has forgotten which passes were used before, and a friend’s clock may run up to a minute fast. A person who meets that reads “The door to Glen’s films has just restarted”. A friend’s pass that arrives outside its two minutes is refused as out of date, and the owner’s /door then says how far off it was: the two servers’ clocks may disagree.

A pass carries the person’s server’s fingerprint, the door’s, the person’s name for this door (an HMAC under their server’s key of the door and their identity, so two doors cannot tell they share a person, and neither can link them to their identity at home), its expiry and a nonce. Never the cookie, its hash, the group or a search. Their server keeps only a count of passes by outcome (fgot_door_passes_total).

Setting up a door

The door runs beside the service: the 4got already there, or 4got --door, which runs the door alone (no search, nothing fetched) from a config.kdl of its own with port, host, owner-secret and the block below. In config.kdl, or door.kdl:

door {
    name "Glen's films"   // what a refused person reads; the service's host if left out
    friend "alice" key="<alice's key>" people=10 url="https://search.alice.example"
}
  • key is the friend’s 4got key, from their /door page.
  • people is how many people that friend may send in any 30 days; without it, no cap. The eleventh reads “Glen’s films is full for alice’s server”. A person counts again after 30 days without coming.
  • url is the friend’s 4got, where a lapsed cookie goes for a fresh pass. Without it, the person comes in again from their Discovery Channel.
  • The friend’s name begins the user name of each person they send, so renaming a friend gives their people new names at the service. Their pause, people and refusals are kept under their key, so renaming moves none of those.

A line that cannot mean anything stops the start and fails --check-config, saying what is wrong and in which file. A reload (SIGUSR1) puts a change in effect, or keeps the door as it was if the change is wrong.

The owner’s /door (on the Owner console) shows this server’s key, and per friend: people in the last 30 days, refusals (a count per day; no pass is kept), when one was last seen, and Pause, which shuts the door to that friend’s people at once, those already in included. It lists no one.

4got --door listens where its config says, 127.0.0.1 in the examples here, so its /door is reached from the box itself. From your own computer, forward the port over ssh, then open http://127.0.0.1:8890/admin/login, sign in with the door’s owner-secret, and you are on /door:

ssh -N -L 8890:127.0.0.1:8890 you@the-box

Or give the door a name of its own behind the reverse proxy, open only to you (Caddy):

door.glen.example {
	@me remote_ip 203.0.113.7
	handle @me {
		reverse_proxy 127.0.0.1:8890
	}
	respond 403
}

On the friend’s 4got, the Discovery entry names the door’s key, from the door’s /door page. It holds no secret, and its address must be https (anything else stops the start):

entry "https://films.glen.example" title="Glen's films" door="<the door's key>" groups="friends"

The reverse proxy

The door answers on Authelia’s forward-auth paths, /api/authz/forward-auth (Caddy, Traefik) and /api/authz/auth-request (nginx), so a snippet written for Authelia needs only its address changed. /.4got/ on the service’s host goes to the door unchecked. Each snippet below drops the Remote-* headers a client sends; the door’s 200 sets every one Authelia’s snippets copy as well. The door here listens on 127.0.0.1:8890 and the service on 8096.

Caddy:

films.glen.example {
	handle /.4got/* {
		reverse_proxy 127.0.0.1:8890
	}
	handle {
		route {
			request_header -Remote-*
			forward_auth 127.0.0.1:8890 {
				uri /api/authz/forward-auth
				copy_headers Remote-User Remote-Groups Remote-Name
			}
			reverse_proxy 127.0.0.1:8096
		}
	}
}

Traefik (file provider):

http:
  routers:
    films:
      rule: Host(`films.glen.example`)
      middlewares: [no-remote, door]
      service: films
    films-door:
      rule: Host(`films.glen.example`) && PathPrefix(`/.4got/`)
      service: door
  middlewares:
    no-remote:
      headers:
        customRequestHeaders: {Remote-User: "", Remote-Groups: "", Remote-Name: "", Remote-Email: ""}
    door:
      forwardAuth:
        address: http://127.0.0.1:8890/api/authz/forward-auth
        authResponseHeaders: [Remote-User, Remote-Groups, Remote-Name]
  services:
    door:
      loadBalancer: {servers: [{url: "http://127.0.0.1:8890"}]}
    films:
      loadBalancer: {servers: [{url: "http://127.0.0.1:8096"}]}

nginx:

server {
    server_name films.glen.example;
    location /.4got/ {
        proxy_pass http://127.0.0.1:8890;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
    location = /internal/door {
        internal;
        proxy_pass http://127.0.0.1:8890/api/authz/auth-request;
        proxy_pass_request_body off;
        proxy_set_header Content-Length "";
        proxy_set_header X-Original-URL $scheme://$http_host$request_uri;
    }
    location / {
        auth_request /internal/door;
        auth_request_set $user $upstream_http_remote_user;
        auth_request_set $groups $upstream_http_remote_groups;
        auth_request_set $redirection_url $upstream_http_location;
        error_page 401 =302 $redirection_url;
        proxy_set_header Remote-User $user;
        proxy_set_header Remote-Name $user;
        proxy_set_header Remote-Groups $groups;
        proxy_set_header Remote-Email "";
        proxy_pass http://127.0.0.1:8096;
    }
}

Not yet

Later steps of the design, not built: accounts the door makes in Jellyfin (its apps send only a user name and password, so no gate in front of them works), door entries passed on to friends’ friends, paid terms, the door as an OIDC provider, passes even the person’s own server cannot link, and client certificates.

AI Research Agent

The AI research agent is a tool-using LLM that synthesizes search results into a comprehensive answer. It is triggered when a user searches the same query twice (the “double-search” trigger), indicating they want deeper analysis than raw search results can provide.

How it works

  1. User searches “quantum error correction”
  2. 4got returns normal search results
  3. User searches “quantum error correction” again (or clicks the “Research” button)
  4. 4got starts the AI research agent as a Server-Sent Events (SSE) stream
  5. The agent fetches top search result URLs, reads them, and synthesizes an answer
  6. Intermediate findings stream to the user in real time via the oracle box

Configuration

Edit data/ai-research.kdl:

enabled true
mode "lua"
provider "cerebras"
model "llama3.1-8b"
api-key "csk-..."
base-url "https://api.cerebras.ai/v1"
max-runtime-seconds 360
lua-timeout-seconds 180
max-tool-iterations 20
require "deluxe"

Fields

FieldDescription
enabledMaster switch (true/false)
modeExecution mode: "lua" (sandboxed) or "off". A "bash" mode was once documented here but never implemented — only "off" is special-cased.
providerLLM provider: “cerebras”, “openrouter”, “ollama”, “openai”, or any OpenAI-compatible endpoint
modelModel name (provider-specific)
api-keyAPI key for the provider
base-urlOverride the API endpoint URL. Defaults are inferred from provider name.
max-runtime-secondsKill the agent after this many seconds; 360 as shipped (Alex, 2026-05-14: “raise it universally to 6 minutes and 3 minutes for a lua job”)
lua-timeout-secondsStop one Lua run after this many seconds; 180 as shipped
max-tool-iterationsThe most tool rounds one job may take. Required while enabled: the server won’t start, and --check-config fails, without it.
requireGroup permission required to use the agent (e.g. “deluxe”). Empty = everyone.
instructions-requireThe group whose own instructions (Settings, “Custom AI instructions”) reach the agent; they win on conflict. Default: deluxe, whatever require says, so opening the AI to everyone does not open instructions that win over the server’s to everyone. "all" = everyone.
overview-requireWho gets the AI overview (below): "all" (the default, visitors included), "off" (nobody), or a group, such as "deluxe". It needs only provider, model and api-key, not enabled.
vision-requireWhose attached images the vision model (the one image descriptions use) reads, for their question: a group (the default, "deluxe"), "all", "owner" or "off". Everyone else’s attached image reaches the model as the text read off it.

AI overview

On page 1 of All, a few cited sentences above the results, from one model call over the search and the first eight results’ titles, sites and snippets (no page is read; for a search about something to look at, also the first four pictures’ titles, sites and kept descriptions, which it may cite as [P1]), streamed into a slot drawn with the page at the height it keeps. It is on by default for everyone overview-require names, wherever a provider and key are set. A person turns it off with “AI answer: Off” in the search bar’s + menu, “AI on search: Off” in Settings, No Jev, or “Use no outside services”. None is written when an instant answer already answers the search, for a site’s name or address, for a secret, on other tabs, or for a test search that does not name overview in X-4got-Want.

The call is made when the page opens the overview’s stream, not when the page is drawn, so a page read by a script, without JavaScript or for a link’s preview costs nothing. Its limits, checked when the page is drawn: 60 a minute per address, and 3,000 calls a day on the server’s key (/admin, Server-key stops; the row is overview). An overview is kept six hours for the same search and results (a failed call is not), a reload while one is being written shares that call, and a search known to have nothing gets no slot. “Dig deeper” on the card, for whoever may run the agent (require), starts the research agent in the overview’s place. With DeepSeek V4.1 Flash on DeepInfra one costs about $0.00017 (about 980 tokens in, 75 out, measured 2026-10-13). The stream is GET /api/v1/overview?k=<the slot's key>: sources, then token events, then done (or none). done’s also names the sources the answer drew on in general and cites at no point in its words, at most three: the model writes them on an “Also drawn on:” line after its answer, which is never shown.

Providers

Cerebras (recommended for free tier):

provider "cerebras"
model "llama3.1-8b"
api-key "csk-..."
base-url "https://api.cerebras.ai/v1"

Cerebras offers free API access for Llama 3.1 8B with extremely fast inference (~1000 tok/s). Good enough for research synthesis.

OpenRouter (access to many models):

provider "openrouter"
model "anthropic/claude-sonnet-4-20250514"
api-key "sk-or-..."

Ollama (local, no API key needed):

provider "ollama"
model "llama3.1:8b"
base-url "http://localhost:11434/v1"

Any OpenAI-compatible API:

provider "custom"
model "your-model"
api-key "your-key"
base-url "https://your-api.example.com/v1"

Metaprompt customization

The agent’s system prompt is loaded from data/metaprompt.md. This file controls the agent’s personality, tool usage patterns, and output format.

Key sections in the default metaprompt:

  • Context: explains to the LLM where it is and what 4got does
  • Tools: describes each tool and when to use it
  • Behavior rules: answer straight from “What the pages say” when it covers the question, eta() right before every fetch() or lua() in the same response, send() only beside the call it announces
  • Final answer format: the answer in the first sentence, as short as the question allows (under 120 words for most, never more than 200), light Markdown, no recap and no list of sources
  • Context management: how to use pin() and forget() to manage the limited context window

Before it, the server writes the agent’s environment: the CPU, memory, timeouts, model and the end of its training data, the Lua benchmarks run at boot, past jobs’ durations, and the model’s speed on this server, measured over its last 100 streamed calls (the average wait for its first word, then its tokens a second), with a worked step for its estimates of how long a job will take. After the metaprompt comes the invocation context: today’s date, and how the run began, triggered manually or not (Alex, 2026-05-22: “that’s even more useful context”): Dig deeper pressed, the same search made again, Ambient research’s questions answered, or !! before the search; or not: the person’s settings research every search, or Ambient research’s classifier (Jev) judged the search wanted it. A program calling the API is said to be one. Nothing of the person’s is in it.

You can customize the metaprompt to change the agent’s behavior. For example, to make it more concise:

Add to metaprompt.md:

## Output length
Keep your final answer under 200 words. Be direct.

Or to make it focus on academic sources:

## Source priority
Prefer academic sources (arxiv.org, scholar.google.com, .edu domains) over news articles.
Always check if there's a relevant arXiv paper.

Tool reference

send(text)

Shows a short line among the steps, beside the call it announces. The answer itself is the final message, never a send(). send("clear") folds the steps so far away: the box’s foot then offers “view thinking process”, which opens and closes them (debug mode keeps every step in view).

send("Found that Rust 1.84 adds async trait support. Checking release notes...")

eta(seconds, job_name)

Updates the ETA countdown timer shown to the user. Call before any slow operation (fetching URLs, running code). The box’s corner counts it down as “ai eta 3:31”; a download (the opening read of the results, or fetch’s pages) gives its own estimate beside it from the pages done so far, “download eta 4:30”, with “(woops!)” when it will end after the AI expected.

eta(5, "fetching rust-lang.org blog")

fetch(url)

Fetches a URL and returns the page’s text (its article, when it has one), at most 100 KB a page, with a 10-second timeout; depth=2 also follows same-domain links, as many as the room left in the context holds. A result longer than 12 KB comes in parts, each ending with how many tokens are left: count_only says how long a result is (about N tokens, its KB, lines and parts) without reading it in, and part reads one. psychoscrape and youtube_transcript take the same two arguments, and asking again for a result’s size or another part downloads nothing. show_lines (up to 60, on these and on lua) is how many lines of the result’s block the person sees before it scrolls.

fetch("https://blog.rust-lang.org/")
fetch("https://example.com/long-article", count_only=true)
fetch("https://example.com/long-article", part=2)

lua(code)

Executes Lua code in a sandboxed environment. What it prints shows on the page as it prints it (in batches at most four a second), and the whole output comes back to the model when the job ends; the metaprompt asks a job that may run over about 3 seconds to print its progress as it goes. Available standard libraries:

  • string: string.find, string.sub, string.gsub, string.format, etc.
  • table: table.insert, table.remove, table.sort, table.concat
  • math: math.floor, math.ceil, math.random, math.pi, etc.
  • json_decode(s): Parse a JSON string into a Lua table
  • json_encode(t): Serialize a Lua table to JSON
  • http_get(url): Fetch a URL and return the body as a string (uses the Go HTTP client with timeouts)

Example:

local data = http_get("https://api.example.com/data.json")
local parsed = json_decode(data)
for _, item in ipairs(parsed.results) do
    print(item.title .. ": " .. item.score)
end

pin(text)

Pins a short note to the agent’s context that will never be evicted during context window management. Use to preserve key findings across a long research session. Keep pins to 1-2 sentences.

pin("Key finding: the paper by Smith et al. (2026) shows 99.9% error correction rate using surface codes.")

forget(tool_call_id)

Removes a previous tool result from the agent’s context to free up space. Use after extracting what you need from a large fetch result.

forget("call_abc123")

friction(description)

Silently logs an improvement suggestion. These are recorded for the server operator to review. The user never sees them.

friction("No academic search engine configured - adding arXiv would improve research quality")

Double-search trigger UX

The research agent activates when a user searches the same query twice. The UI flow:

  1. First search: normal results displayed
  2. Second search (same query): a research box appears above results with a live SSE stream
  3. The agent’s steps (its send() lines, its code, its tools’ results) appear in the box’s lower part
  4. The eta() timer shows beside the box’s name
  5. The answer appears above the steps as the model writes it (“Stream AI responses” in Settings, on unless turned off), its Markdown drawn as it comes, each [oN] citation numbered by its entry’s first page (the server numbers the pages a run reads, so two entries of one page share a number) and drawn as a source chip, or as that number under “AI citations: Numbers”, with a card of its pages on hover or tap; when complete, the foot offers the pages the answer cites (“5 sources”), copy and download context: the conversation the model was sent (the system prompt, with this server’s environment section named in one line rather than shown, the tools, every message and tool result) and its replies, labelled, with the pages behind each [oN] entry at the end. A kept answer (the same search researched within a day, begun the same way, with the same settings, region, time range and engine weights) is replayed with the download of the run that wrote it, the asker’s own instructions, tapped answers and how the run began as placeholders; a run that fails offers what was sent before it failed.

The SSE endpoint is GET /api/v1/research?q=<query>; the page adds from=, how the run began (dig, double, asked, page or ambient), and without it the agent is told a program asked through the API. It returns events:

  • text — a step line (send(), or the server’s own progress)
  • eta — ETA update from eta()
  • token — a piece of the model’s words as it writes them; aside says the words so far were said on the way to a tool call (the page moves them into the steps), unsay that they were tool calls written as text
  • context — the download: what the model was sent, as Markdown
  • done — final answer, stream ends
  • error — error message, stream ends

Lua sandbox capabilities

The Lua sandbox (mode "lua") provides a safe execution environment:

Allowed:

  • All standard string/table/math operations
  • json_decode() and json_encode() for data processing
  • http_get() for fetching URLs (through Go’s HTTP client with timeout and SSRF protection)
  • print() for output (captured as the tool result)
  • tostring(), tonumber(), type(), pairs(), ipairs(), unpack()

Blocked:

  • File system access (io, os)
  • require(), dofile(), loadfile()
  • debug library
  • Arbitrary package loading
  • Long-running loops (killed by max-runtime-seconds)

On the old “bash mode” warning: earlier revisions of these docs claimed mode "bash" gave the agent shell access on the host and urged running 4got in a container because of it. No bash mode was ever implemented — the agent runs Lua in a sandbox, and mode is only ever checked against "off". Containerising 4got remains sensible practice; it is simply not required by this setting.

Friction feedback system

The friction() tool lets the agent report issues it encounters during research. These are logged to the database and can be reviewed by the server operator.

Common friction reports:

  • Missing engine types (e.g. “no academic engine for arXiv queries”)
  • Poor result quality for specific query types
  • Timeout issues with upstream services
  • Suggestions for new oracle types

Friction logs are stored in the ai_research table and can be queried via the admin panel.

Plugin System

The plugin system supports Lua plugins and MCP tool integration.

Lua plugins

Lua plugins are the primary extension mechanism. Drop a .lua file in the plugins/ directory (relative to the data directory) and it will be loaded at startup.

Hooks

Plugins can register handlers for these hooks:

HookArgumentsReturnWhen
on_search(query, category, params)query string, category string, search params tablemodified query string (or nil to keep original)Before search is dispatched to engines
on_result(result, engine_id)result table, engine ID stringmodified result table, or nil to filter it outAfter each engine returns results, before merging
on_render(html, query, category)HTML string, query, categorymodified HTML stringAfter the results page HTML is generated, before sending to client

Plugin structure

-- plugins/example.lua
-- Plugin metadata
plugin = {
    name = "Example Plugin",
    version = "1.0",
    author = "your name",
    description = "An example plugin"
}

-- Called before search dispatch
function on_search(query, category, params)
    -- Modify query, return nil to keep original
    return nil
end

-- Called for each result from each engine
function on_result(result, engine_id)
    -- Return the result to keep it, nil to filter it out
    return result
end

-- Called after HTML is generated
function on_render(html, query, category)
    -- Inject custom HTML, modify existing HTML, etc.
    return html
end

Available Lua APIs

Plugins have access to the same sandbox as the AI research agent:

  • string, table, math standard libraries
  • json_decode(s) / json_encode(t) for JSON processing
  • http_get(url) for fetching URLs
  • log(message) for logging to the server log
  • config_get(key) for reading plugin-specific config values

Example: Ad domain blocker

-- plugins/block_ads.lua
plugin = {
    name = "Ad Blocker",
    version = "1.0",
    description = "Filters results from known advertising domains"
}

local ad_domains = {
    ["doubleclick.net"] = true,
    ["googleadservices.com"] = true,
    ["facebook.com/ads"] = true,
    ["amazon.com/gp/slredirect"] = true,
    ["taboola.com"] = true,
    ["outbrain.com"] = true,
    ["criteo.com"] = true,
}

-- Extract domain from URL
local function get_domain(url)
    local domain = url:match("https?://([^/]+)")
    if domain then
        domain = domain:gsub("^www%.", "")
        return domain
    end
    return ""
end

function on_result(result, engine_id)
    local domain = get_domain(result.url or "")
    if ad_domains[domain] then
        log("Blocked ad domain: " .. domain)
        return nil  -- filter out
    end
    return result
end

Example: Result enrichment

-- plugins/enrich_github.lua
plugin = {
    name = "GitHub Enricher",
    version = "1.0",
    description = "Adds star count and language to GitHub repo results"
}

function on_result(result, engine_id)
    local url = result.url or ""
    local owner, repo = url:match("github%.com/([^/]+)/([^/]+)")
    if owner and repo then
        -- Fetch repo info from GitHub API
        local api_url = "https://api.github.com/repos/" .. owner .. "/" .. repo
        local data = http_get(api_url)
        if data then
            local info = json_decode(data)
            if info and info.stargazers_count then
                result.snippet = result.snippet ..
                    " [★" .. tostring(info.stargazers_count) ..
                    " | " .. (info.language or "unknown") .. "]"
            end
        end
    end
    return result
end

MCP for AI tools

The AI research agent can be extended with MCP (Model Context Protocol) servers to give it access to additional tools beyond the built-in set.

How MCP integration works

  1. Configure MCP servers in ai-research.kdl (or the ai-research section of your unified KDL config)
  2. At startup, 4got connects to each MCP server and discovers available tools
  3. These tools are added to the AI research agent’s tool list alongside the built-in tools
  4. When the agent calls an MCP tool, 4got proxies the call to the appropriate MCP server

Configuration

// In ai-research.kdl
mcp-server "local-kb" {
    command "python3" "-m" "knowledge_base_mcp"
    env "KB_PATH=/path/to/knowledge-base"
}

mcp-server "calculator" {
    url "http://localhost:3001/mcp"
}

MCP servers can be launched as subprocesses (command) or connected to over HTTP (url).

Example: Local knowledge base MCP server

Create an MCP server that gives the AI agent access to a local knowledge base:

# knowledge_base_mcp.py
import json
import sys
import os
from pathlib import Path

KB_PATH = Path(os.environ.get("KB_PATH", "./kb"))

def search_kb(query):
    """Search local markdown files for relevant content."""
    results = []
    for md_file in KB_PATH.glob("**/*.md"):
        content = md_file.read_text()
        if query.lower() in content.lower():
            # Extract surrounding context
            idx = content.lower().index(query.lower())
            start = max(0, idx - 200)
            end = min(len(content), idx + 200)
            results.append({
                "file": str(md_file.relative_to(KB_PATH)),
                "excerpt": content[start:end]
            })
    return results[:5]

# MCP protocol handler
def handle_request(request):
    if request["method"] == "tools/list":
        return {
            "tools": [{
                "name": "search_knowledge_base",
                "description": "Search the local knowledge base for information",
                "inputSchema": {
                    "type": "object",
                    "properties": {
                        "query": {"type": "string", "description": "Search query"}
                    },
                    "required": ["query"]
                }
            }]
        }
    elif request["method"] == "tools/call":
        tool_name = request["params"]["name"]
        if tool_name == "search_knowledge_base":
            query = request["params"]["arguments"]["query"]
            results = search_kb(query)
            return {"content": [{"type": "text", "text": json.dumps(results, indent=2)}]}
    return {"error": "unknown method"}

# stdio transport
for line in sys.stdin:
    request = json.loads(line)
    response = handle_request(request)
    response["id"] = request.get("id")
    print(json.dumps(response), flush=True)

Example: Giving the AI agent calculator access

If the built-in calculator oracle isn’t sufficient, you could connect a Wolfram Language MCP server:

mcp-server "wolfram-lang" {
    command "wolframscript" "-code" "MCPServer[]"
}

This would let the agent evaluate arbitrary Wolfram Language expressions during research.

Plugin loading order

  1. All .lua files in plugins/ are loaded alphabetically
  2. MCP servers are connected in the order they appear in config
  3. Plugins are loaded after all engines are registered but before the HTTP server starts
  4. Plugin hooks run in load order; the first on_search return value that is non-nil wins

Plugin safety

  • Lua plugins run in the same sandbox as the AI research agent (no file/OS access)
  • http_get() goes through Go’s HTTP client with SSRF protection
  • Plugins that throw errors are logged and disabled, they don’t crash the server
  • MCP servers run as separate processes with their own permissions
  • Plugin execution has a per-call timeout (configurable, default 5 seconds)

Planned but not yet implemented

  • Plugin hot-reloading (SIGHUP or admin endpoint to reload without restart)
  • Per-plugin configuration in KDL
  • Plugin marketplace/registry
  • TypeScript/WASM plugin support
  • Plugin-specific rate limiting
  • Plugin metrics in the admin dashboard

Contributing to 4got

Dev environment setup

  1. Clone the repo and cd into it.
  2. Install Go 1.25+ (the go.mod requires 1.25.0).
  3. Build: cd go-server && CGO_ENABLED=1 go build -o 4got .
  4. Copy data/config.default.kdl to data/config.kdl and set your owner-secret.
  5. Run: cd .. && go-server/4got

CGO is required for the SQLite driver.

Adding a new KDL engine

Generic engines are defined in data/engines.kdl and parsed by go-server/generic_engine.go. See engine-spec.md for the full KDL schema. The fastest workflow is the admin playground at /admin/engines/new (owner-only): fill in the form, test against a live query, then click “Save Engine” to append the KDL block to disk and register it without a restart.

Adding a new oracle

Oracles are instant-answer widgets shown above search results (calculator, unit converter, currency, etc.).

  1. Write your oracle function in a new go-server/oracle_<name>.go. Follow the existing pattern: the function takes a query string (and optionally *http.Request, http.ResponseWriter, Config) and returns *OracleAnswer or nil.
  2. Register it in go-server/oracles.go inside CheckOracles(). Add a call to your function in the appropriate section (local oracles, API oracles, or knowledge oracles). Order matters: the first match in the local oracle section wins.

Running tests

cd go-server && CGO_ENABLED=1 go test ./...

Code style

  • No comments unless the WHY is non-obvious. Do not explain what the code does if it is clear from reading it.
  • AI-generated files get a header: // AI-generated: <model>
  • Keep functions short. If a function needs a comment block explaining it, it should probably be smaller.

PR expectations

  • CGO_ENABLED=1 go build -o /dev/null . must pass.
  • go vet ./... must be clean.
  • Do not introduce new linter warnings.

Changing engines.kdl

The engine config is covered by a golden snapshot (go-server/testdata/engines_golden.json) pinning every engine’s id, categories, result-type and extraction paths. It exists because parseEngineKDL had no tests at all, so a dropped key or a silently-changed category surfaced as an engine going quiet in production rather than as a failing build.

After an intentional config change:

make engines-golden   # regenerate
git diff              # READ the diff — that is the point

If the diff shows more than you meant to change, that’s the snapshot doing its job. Related invariants enforced by the same test file: no duplicate engine IDs (a duplicate silently replaces the earlier engine), and every enabled engine has the fields it needs to return results.