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:
- 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.
- 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.
- 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.
Basic search
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:
| Tab | What you get |
|---|---|
| Web | General web results |
| Images | Photos, illustrations, stock images |
| Videos | YouTube, Vimeo, PeerTube, Dailymotion, etc. |
| News | Recent articles from wire services and aggregators |
| Music | Tracks from SoundCloud, Bandcamp, Deezer, etc. |
| Science | Academic papers from arXiv, PubMed, Crossref, etc. |
| IT | Code repos, package registries, docs, exploits (Sploitus) |
| Files | Torrents (Pirate Bay, 1337x, Solid Torrents, etc.) |
| Maps | OpenStreetMap and Photon geocoding |
| Social | Reddit, Lemmy, Mastodon, HN, Lobsters |
| Books | Open Library, Gutenberg, Goodreads |
| Q&A | Stack Exchange network (SO, Super User, Unix SE, etc.) |
| Packages | Linux distro packages (Arch, NixOS, Alpine, Void, AUR, Flathub) |
| Weather | The weather card (Open-Meteo, OpenWeatherMap) |
| Lyrics | Genius |
| Marketplace | Listings 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=:
| Value | Window |
|---|---|
day or d | Past 24 hours |
week or w | Past 7 days |
month or m | Past 30 days |
year or y | Past 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.
| Bang | Target |
|---|---|
!g | |
!d or !ddg | DuckDuckGo |
!b | Brave Search |
!w | Wikipedia |
!yt | YouTube |
!gh | GitHub |
!r | |
!so | Stack Overflow |
!a | Amazon |
!imdb | IMDb |
!maps | OpenStreetMap |
!nix | NixOS Packages |
!arch | Arch Linux Packages |
!aur | AUR |
!crates | crates.io |
!npm | npm |
!pypi | PyPI |
!mdn | MDN 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.
| Bang | Engine |
|---|---|
!brave | Brave |
!startpage | Startpage |
!mojeek | Mojeek |
!marginalia | Marginalia |
!wiby | Wiby |
!hackernews or !hn | Hacker News |
!youtube | YouTube |
!soundcloud or !sc | SoundCloud |
!flickr | Flickr |
!pexels | Pexels |
!yandex | Yandex |
!qwant | Qwant |
!bing | Bing |
!baidu | Baidu |
!yahoo | Yahoo |
!wikipedia or !wiki | Wikipedia |
!google | |
!duckduckgo | DuckDuckGo |
Oracle bangs
These redirect to an external instant-answer service.
| Bang | Service |
|---|---|
!wolfram or !wa | Wolfram Alpha Short Answers |
!ddg-ia | DuckDuckGo 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:
- Reads the top search results
- Fetches and analyzes the linked pages
- Runs code in a sandboxed Lua environment if needed
- 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.
Related questions
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.
| Setting | Cookie | What it does |
|---|---|---|
| Safe search | safesearch | 0 none (default), 1 moderate, 2 strict. Moderate and Strict leave out the engines that can’t filter. |
| Your location | home_location | A place name (“Detroit, MI”) for weather and “distance to X”; only the name is looked up |
| Temperature unit | temp_unit | C (default), F or K |
| Distance unit | distance_unit | km (default) or mi |
| Region | region | DuckDuckGo’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 badges | badges | first (default: the engine that ranked the result highest, the rest behind “+N”), always (every engine), multiple (only when >1 engine), never |
| Row badges | badge_onion, badge_i2p, badge_xmr, badge_http, badge_young, badge_fresh, badge_slop, badge_affiliate, badge_offline | The 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 window | hard_window | Maximum ms to wait for engine responses (default 1000) |
| Fanout idle timeout | idle_timeout | Stop 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 age | cache_max_age | Oldest cached copy a search will use, in minutes (default 43200 = 30 days; 0 = always fresh) |
| Priority engine | priority_engine | Engine that must respond before results are shown |
| NSFW banners | nsfw_banners | Show NSFW banners on the landing page |
| Browser history | browser_history | Store search history in browser localStorage |
| Server history | server_history | Store 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 history | recall_expand | Only 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 meaning | char_meaning | When 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 matches | recall_ask_jev | A 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 feed | live_feed | 1: 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 Trending | trend_count | off: your searches never count toward Trending. Offered where the owner counts every logged search (trending-counts "all", the default) |
| Count my searches in Trending | trend_optin | 1: 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 |
| Autocomplete | autocomplete | Enable/disable search suggestions (disable by setting to off) |
| Show scores | show_scores | Show ranking scores next to results |
| Progressive SSE | progressive_sse | Stream results as they arrive via server-sent events |
| Speedtest graph | speedtest_graph | Show engine response time graph |
| Oracles on the All tab | web_oracles | Empty (default): when a search asks for one; never: none |
| Oracles on other tabs | smart_tab_oracles | Empty (default): each tab’s own on every search, and any a search asks for; off: only when a search asks; never: none |
| Oracle configuration | oracles_off, oracles_sometimes | Per oracle: Always (its own tab, every search), Sometimes, or Off |
| Show favicons | show_favicons | Display site favicons next to results |
| Search method | search_method | POST or GET for the search form |
| Bookmarks | bookmark_mode | Enable/disable bookmark saving |
| Show filters | show_filters | The 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 engines | disabled_<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 weights | weight_<engine> | Override ranking weight per engine (higher = more influence) |
| URL rewrites | rewrite_<service>, rewrite_<service>_place, rewrite_archive, rewrite_muted | Frontends for each site and where their link goes (see URL rewriting) |
| Archive links | archive_links | The archive ▾ on results; off leaves it out |
| Show HN discussions | show_hn | Marks 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 languages | known_languages | Languages 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 detection | tracker_detection | Highlight known tracking domains in results |
| Translation privacy | translation_private | Avoid sending translations through third-party APIs |
| Tabs (each tab’s switch) | tab_modes | key=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 tabs | custom_tabs | Tabs 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 stream | ai_stream | On unless turned off (off): the research answer is drawn as it is written; off, it comes whole at the end |
| Research debug | research_debug | The 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 key | apikey_wolframalpha | Personal Wolfram Alpha API key (uses server key if empty) |
Settings can also be set via URL parameters on /settings?nsfw=yes®ion=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).
| Field | Type | Default | Description |
|---|---|---|---|
port | int | 8888 | HTTP listen port |
host | string | “0.0.0.0” | Listen address |
owner-secret | string | “CHANGE_ME” | Admin password. Also used to derive Ed25519 signing keys for session cookies. |
deluxe-secret | string | “” | Legacy cookie-based deluxe tier secret. Leave empty to disable. |
pow-difficulty | int | 17 | The 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-method | string | “GET” | The search form’s method for anyone who hasn’t chosen one (GET or POST). |
default-bookmark-mode | string | “link” | The bookmark button on results for anyone who hasn’t chosen: link (specific link), domain, or off. |
default-audio-play | string | “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-streams | int | 6 | Full audio streams (Settings › Play buttons › Audio) playing at once on this server; a person may have two; past either, 429 |
default-home-button | string | “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-safesearch | int | 0 | Safe search for anyone who hasn’t chosen: 0 none, 1 moderate, 2 strict. |
default-languages | strings | none: required | Known 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-share | bool | true | For 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-detection | bool | false | Tracker 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-relay | bool | false | When 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-hours | int | 720 | How long a captcha solution grants session access |
captcha-bypass-searches | int | 0 | How 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-days | int | 90 | Days 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-bits | int | 8 | How 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-seconds | int | 300 | How long a PoW solution grants session access |
max-searches-per-day | int | 200 | The 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-s | int | 3600 | How long a Wolfram|Alpha answer is kept and shown again instead of asking (0 keeps none) |
wolfram-miss-s | int | 2592000 | How long Wolfram|Alpha’s “no answer” is kept, so the question is not sent again (0 keeps none) |
ddg-answer-s | int | 86400 | The same for a DuckDuckGo instant answer |
ddg-miss-s | int | 604800 | The same for DuckDuckGo’s “no answer” |
new-cookies-per-day | int | 0 | How 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-day | int | 20 | How 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-ms | int | 1000 | Maximum time to wait for engine responses |
fanout-idle-timeout-ms | int | 500 | Stop waiting if no new results arrive within this window |
cache-ttl-web-s | int | 1800 | Cache TTL for web results (seconds) |
cache-ttl-images-s | int | 7200 | Cache TTL for image results |
cache-ttl-news-s | int | 300 | Cache TTL for news results |
cache-max-mb | int | 0 | Delete 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-rows | int | 0 | The same by number of searches; 0 never deletes. |
page-facts-disk-s | int | 31536000 | The 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-mb | int | 1024 | What 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-s | int | 2592000 | How 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-threshold | int | 2 | Minimum access count before a cache entry is eligible for background prefetch |
prefetch-before-expiry-s | int | 60 | Prefetch entries within this many seconds of expiry |
nsfw-landing | bool | false | Show NSFW banners on the landing page |
kv-retention-days | int | 90 | Server-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-group | block | none | Hosts 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-engines | string | “” | 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-url | string | “” | 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-label | string | “ask a follow-up” | The link’s wording |
map-tiles | string, with attribution and attribution-url | OpenStreetMap’s | The 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 |
geocoder | string | “” | 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-days | int | 30 | An agent-made research context untouched this long is forgotten (capped at 365). A person’s own context is forgotten after a year |
data-dir | string | “../data” | Path to the data directory (config files, DB, banners, captcha assets), relative to the working directory (go-server/) |
db-path | string | “../data/4got.db” | Path to the SQLite database |
peers | string[] | [] | Legacy peer URLs (prefer peers.kdl instead) |
peer-secret | string | “” | Shared secret for peer authentication |
engine-break-alerts | bool | false | When 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-url | string | “” | 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-url | string | “” | A URL POSTed each operator event as JSON (type, engine, message, timestamp, severity) |
quotes-mode | string | “all” | Landing page quote visibility: “all”, “deluxe”, “off” |
planner-wait | bool | false | Plan 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-bytes | int | 2097152 | Describe 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-fallback | bool | true | When 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-keys | block | {} | 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-cookieless | bool | false | A 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-difficulty | int | pow-difficulty + 1 | The 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-message | string | “” | The IQ test page’s intro words; empty = “This test is good for a month.” |
version-label | string | “” | Text beside the version on the home page, e.g. “pre-beta”; empty shows none. Its old name, beta-label, is still read |
default-on | string 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-enabled | string list | the two chosen 2026-09-21 | Bundled banners in the home page’s rotation (file names, comma-separated); personal and uploaded banners are not gated |
onion-address | string | “” | This instance’s .onion address, sent as Onion-Location |
server-bio | string | “” | 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-connecting | bool | false | /ami4got says this server welcomes new friends; their Instances pages mark it “open to connecting” |
cache-dir | string | data-dir | Runtime state that cycles: the database, tracker lists, the ToS;DR cache, events.jsonl |
cache-opt-out-groups | string | “all” | Who may bypass the shared cache entirely: “all”, “none”, or group labels (space- or comma-separated) |
memory-limit-mb | int | 0 | The runtime’s soft memory limit; 0 = half the machine’s memory (never under 128) |
log-engine-timings | bool | false | Log one “Engine X: +Nms” line per engine per search (at ~145 engines a search, most of the log) |
disable-wtm | bool | false | Load no WhoTracks.me lists |
api-quotas | string | “” | Limits for keyed APIs, over the registry’s stated ones: "serpapi_google=250/month, typesafe=20000/month" |
proxy-audio | bool | false | Play 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-public | bool | false | Offer 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-dir | string | static/tok | Where tok’s browser build is served from as /static/tok/; a local server names ~/.cache/4got/tok-web |
kv-max-bytes-per-cookie | int | 262144 | Server-side storage per person (profiles, boards, research contexts), in bytes |
locked-sync | bool | true | Keep the ciphertext of “Sync my locked history” for people who turn it on; false keeps none |
locked-sync-mb | int | 20 | That ciphertext’s allowance per sync id, in MB |
qa | block | off | Questions 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-max | int | 200 | In 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-max | int | 50 | In the qa block: the answers one question takes |
report-hide | int | 3 | In the qa block: the people whose reports take a published question or answer off the pages, into the owner’s Held queue |
prefetch-depth-api | int 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-assets | int | 3 | Pages fetched ahead for image, video and music searches |
prefetch-depth-scraped | int | 1 | Pages fetched ahead for scraped engines (1 = none ahead) |
deferred-scheduled-default | int | 3 | Pending scheduled searches per person in no group |
deferred-standing-default | int | 0 | Standing searches per person in no group (0 = none) |
deferred-standing-total | int | 100 | Active standing searches on the whole server |
deferred-min-refresh-min | int | 30 | Fewest minutes between two runs of one standing search |
admission-enforce | bool | false | Admission control acts (sheds load); false = it computes and logs only |
admission-bandwidth-pct | float | 80 | The share of the monthly traffic cap that admission control counts as full |
admission-manual-shed | float | 0 | The operator’s floor for shedding load (0 to 1 and over); 0 = off |
traffic-cap-gb | int | 0 | The provider’s monthly traffic cap in GB; 0 = traffic is counted, with no guardrails |
traffic-iface | string | “” | The network interface metered (“” = every one but loopback) |
traffic-reset-day | int | 1 | The day of the month the provider’s cap resets |
traffic-reset-hhmm | string | “00:00” | The time of day it resets, UTC |
traffic-low-gb-per-day | float | 10 | Below this many GB a day left until the reset, heavy endpoints are throttled |
traffic-critical-gb-per-day | float | 3 | Below this many, heavy endpoints answer 503 |
traffic-throttle-kbps | int | 128 | Heavy endpoints’ bandwidth while throttled, in KB/s |
traffic-user-retention-days | int | 0 | Per-cookie traffic rows: 0 = not stored, -1 = kept forever, N = kept N days |
speech-url | string | “” | An OpenAI-compatible /v1/audio/transcriptions endpoint you run, for the microphone; unset = no microphone |
speech-key | string | “” | Its bearer token (never sent to the page) |
speech-model | string | “whisper-1” | The model name sent to it |
speech-seconds-per-day | int | 1800 | The 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_SECRETFGOT_POW_DIFFICULTY,FGOT_CAPTCHA_HOURS,FGOT_POW_SECONDSFGOT_MAX_SEARCHES,FGOT_FANOUT_HARD_WINDOW_MS,FGOT_FANOUT_IDLE_TIMEOUT_MSFGOT_CACHE_WEB_S,FGOT_CACHE_IMAGES_S,FGOT_CACHE_NEWS_SFGOT_DATA_DIR,FGOT_DB_PATHFGOT_DEFAULT_LANGUAGES(en,es), which a server with no config.kdl needsFGOT_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:
- A dedicated file (e.g.
data/peers.kdl) - A named section inside any
*.kdlfile indata/(e.g. apeers { ... }block insidedata/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.
Per-user cookie settings
Users can customize their experience via cookies set on the /settings page:
| Cookie | Values | Description |
|---|---|---|
safesearch | 0 (default), 1, 2 | Safe search: 0 none, 1 moderate, 2 strict |
temp_unit | C (default), F, K | Temperature unit for the weather card |
distance_unit | km (default), mi | Distance unit for the distance card, and wind speed on the weather card |
home_location | a place name, URL-escaped | Where weather and distances start (“Detroit, MI”) |
region | DuckDuckGo’s region code (us-en, de-de), blank for all | The region engines are asked for, each in its own form (go-server/regions.tsv) |
badges | first (default), always, multiple, never | Engine badge display mode: first shows the best-placed engine and folds the rest behind “+N” |
hard_window | integer ms | Maximum time to wait for engine responses (default 1000) |
idle_timeout | integer ms | Stop waiting if no new results in this window (default 500) |
cache_max_age | integer minutes | Oldest cached copy a search will use (default 43200 = 30 days; 0 = always fresh) |
cache_needs | comma-separated engine IDs | A 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_engine | engine ID or “none” | Engine that must respond before results are shown |
disabled_web, disabled_images, etc. | comma-separated engine IDs | Disable specific engines per category |
weight_<engine> | integer >= 1 | Override 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 “ |
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_languages | comma-separated ISO 639-1 codes | Languages 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_wolframalpha | API key string | Personal Wolfram Alpha API key |
history_enabled | “1” | Older name of server_history; still read, and any Settings save clears it |
autocomplete | “off” to disable | Enable autocomplete suggestions |
bookmark_mode | link (default), domain, off | Bookmark flag on each result: the exact link, the site, or none |
audio_play | full, redirect | How 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_audio | on, off | Play buttons for other sites’ audio (Jev); on for the owner, off for others until they turn it on |
home_button | right (default), left | Where Home sits in the top bar, on every page; the default is config.kdl’s default-home-button |
new_tab | on | Links in the results that leave 4got open in a new tab (off by default) |
kbd | off | Single-key shortcuts (j, k, p, …) and the home page’s type-anywhere off (on by default) |
archive_links | on, off | Show archive links on results |
show_scores | “1” | Show ranking scores next to results |
search_method | GET (default), POST | HTTP method for search form |
tab_modes | key=always|sometimes|never, comma-separated | Each 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
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | No | Same as ID | Human-readable display name shown in engine badges and the settings page. |
categories | string list | Yes | (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-search | string | No | "" | 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-values | strings | No | (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
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
search-url | string | Yes | – | 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). |
method | string | No | "GET" | HTTP method. "GET" or "POST". |
body-template | string | No | "" | POST body template (same placeholders as search-url). Only used when method is "POST". |
{query_path} | placeholder | No | — | 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-param | string | No | "" | 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-query | string | No | "" | 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-param | string | No | "" | 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-values | strings | No | (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-bias | string | No | "" | 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). |
headers | sub-block | No | (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-visit | string | No | "" | 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-between | two strings | No | (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-tag | bool or string | No | false | {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.
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
result-type | string | Yes | – | Set to "html" for CSS-selector-based parsing. |
results-selector | string | Yes (for HTML) | "" | CSS selector for result container elements. Each match becomes one result. |
blocked-if | string | No | "" | 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-selector | string | No | "" | CSS selector (relative to result container) for the title text. |
url-selector | string | No | "" | CSS selector for the URL. Extracts href attribute first; falls back to text content. |
content-selector | string | No | "" | CSS selector for the snippet/description text. |
thumbnail-selector | string | No | "" | 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-thumb | two strings | No | (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-selector | string | No | "" | 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" | repeatable | No | — | 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".
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
result-type | string | Yes | – | Set to "json" for dot-path-based JSON parsing. |
results-path | string | No | "" (top-level array) | Dot-separated path to the results array in the JSON response. Example: "message.items" navigates {"message":{"items":[...]}}. |
empty-is-none | bool | No | false | An 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-path | strings | No | "" | 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-path | string | No | "" | Dot-path to the URL field. |
content-path | string | No | "" | Dot-path to the snippet/description field. |
thumbnail-path | string | No | "" | 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-template | string | No | "" | 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-replace | two strings | No | (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-path | string | No | "" | Dot-path to the full picture’s address, which the Images viewer opens (else image-from-thumb, else the thumbnail). |
video-path | strings | No | (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-path | string | No | "" | Dot-paths to the picture’s size in pixels, for its tile’s shape and resolution badge. |
source-path | string | No | "" | 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. |
source | string | No | "" | Who every picture is from when source-path gives none, e.g. source "OpenMoji". |
graphicon | string | No | "" | 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-size | two ints | No | (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-path | string | No | "" | 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-path | string | No | "" | Dot-path to a video’s view count (a number, or text such as 1.2M views). |
source-link-path | string | No | "" | 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 utm_source=4got&utm_medium=referral, as its API terms ask. |
opened-path | string | No | "" | 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-path | string | No | "" | 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-path | string | No | "" | 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-scale | number | No | 10 | The engine’s maximum rating (5 for star-rating stores, 10 for IMDb/TVmaze). |
attribute "Label" "path" | repeatable | No | — | 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-if | string, repeatable | No | — | 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-field | string | No | "" | 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-if | string, repeatable | No | — | 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-path | string | No | "" | 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-match | strings | No | (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
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
url-prefix | string | No | "" | String prepended to every extracted URL. Use for APIs that return relative paths (e.g. "https://developer.mozilla.org" + /en-US/docs/...). |
url-template | string | No | "" | 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
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
page-size | int | No | 10 | Results per page. Used to compute {offset}. |
paging | bool | No | false | Whether 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-page | int | No | 0 | The page/offset number for the first page. Most APIs use 0 or 1. |
Content processing
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
content-html-to-text | bool | No | false | Strip HTML tags from the content/snippet field before display. Useful for APIs like StackExchange that return HTML in JSON. |
content-markdown | bool | No | false | The 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-content | bool | No | false | A 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-text | strings | No | (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
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
disabled | bool | No | false | If true, the engine is parsed but not registered. Use to temporarily disable an engine without removing its config. |
cache-hours | int | No | (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
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
share | string | No | auto-detected | Controls 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-outbound | bool | No | false | Route 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:
- Reads
data/engines.kdlviaresolveKDLNodes()(kdl_doc.go, which supports both standalone files andengines { ... }sections inside a unified KDL file), parsed by kdl-go as KDL v1. - Turns the
enginenodes into[]GenericEngineConfigviaengineConfigs(), which handles engine blocks, headers sub-blocks, and all property types. - Skips entries with empty ID, no categories, or
disabled true. - Sets defaults:
page-sizedefaults to 10,namedefaults to the ID. - Creates a
GenericEnginestruct (which implements theEngineinterface) for each config and registers it in the global engine registry. - Determines the share policy: explicit
shareattribute wins; otherwise auto-detects based on whether the URL or headers contain API key patterns.
When Search() is called on a GenericEngine:
- Substitutes
{query},{page},{offset},{lang}in the URL template (and body template if POST). - Makes the HTTP request, routing through Tor if
tor-outboundis set. - Records the raw HTML for drift detection (
drift.go). - Dispatches to
parseHTML()(goquery CSS selectors) orparseJSON()(dot-path navigation) based onresult-type. - Returns
[]WebResultwith each result’sEnginefield 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.
- Log in as owner at
/admin/login. - Navigate to
/admin/engines/new. - Fill in the engine identity (ID, display name, categories).
- Set the search URL template with
{query}and{page}placeholders. - Choose HTML or JSON result type and fill in the corresponding selectors/paths.
- Enter a test query and click “Test Engine” – this POSTs to
/admin/engines/test, which creates a temporaryGenericEnginein memory, runs a search, and returns results as JSON displayed in the form. - Iterate on selectors until results look correct.
- Click “Save Engine” to append the generated KDL block to
data/engines.kdland 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:
- Download a ZIM from https://download.kiwix.org/zim/ (
wikipedia_en_simple_all_miniis about 1 GB). kiwix-serve --port 8080 /path/to/wikipedia.zim- Add this block to
data/engines.kdl, withbooks.namematching 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.
| Engine | ID | Categories | Notes |
|---|---|---|---|
| Brave | brave | web, images, news | HTML scraping |
| DuckDuckGo | duckduckgo | web | HTML scraping |
google | web | HTML scraping | |
| Startpage | startpage | web, news, images | HTML scraping; its news and pictures from the data its page hands its script |
| Wikipedia | wikipedia | web | MediaWiki API |
| Mojeek | mojeek | web | HTML scraping |
| Marginalia | marginalia | web | JSON API |
| Wiby | wiby | web | JSON API |
| Swisscows | swisscows | web | Signed JSON API (Bing’s results, so not counted as a general index) |
| Hacker News | hackernews | news | Algolia API |
| YouTube | youtube | videos | HTML scraping |
| SoundCloud | soundcloud | music | JSON API |
| Flickr | flickr | images | its search page’s data; JSON API with a key |
| Pexels | pexels | images | the JSON its own pages ask for; its JSON API with a key when that fails |
| Yandex | yandex | web, images | not registered since 2026-09-27: Yandex answers scripts with a captcha (!yandex redirects to yandex.ru; serpapi_yandex with a key) |
| Qwant | qwant | web, images, news | JSON API |
| Bing | bing | web, images, news, videos | HTML scraping |
| Baidu | baidu | web | HTML scraping |
| Yahoo | yahoo | web, news | HTML scraping |
| YouTube (shorts) | youtube_short | videos | HTML scraping |
| Naver | naver | web | HTML scraping |
| Naver Images | naver_images | images | JSON API |
| Naver Videos | naver_videos | videos | JSON API |
| ChatNoir | chatnoir | web | JSON API; optional key |
| Magnific | magnific | images | JSON API |
| GMX | gmx | web | HTML scraping |
| XMRBazaar | xmrbazaar | marketplace | HTML scraping; asked only on the Marketplace tab |
| Repology | repology | packages | JSON API (an object keyed by project); once a second at most |
| Homebrew | homebrew_pkg | packages | its 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.
| Engine | What 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.
| Engine | ID | Notes |
|---|---|---|
| Kozmonavt | kozmonavt | A directory of sites with its own index |
| Right Dao | right_dao | An independent web index |
| search.ch | searchch | Switzerland’s own index; its click counter unwrapped |
| MDN Web Docs | mdn | JSON API |
| StackExchange | stackexchange | API, Q&A results |
| npm | npm | Package registry |
| Anaconda | anaconda | HTML scraping |
| Arch Wiki | archwiki | REST API |
| Wikidata | wikidata | JSON API |
| Crossref | crossref | Academic DOIs |
| Apple App Store | apple_app_store | iTunes API |
| bpb.de | bpb | German civic education |
| crates.io | crates | Rust packages |
| Docker Hub | docker_hub | |
| GitHub | github | Repo search |
| GitHub Code | github_code | Code search |
| GitHub Issues | github_issues | |
| GitHub Topics | github_topics | |
| GitLab | gitlab | |
| GitLab Snippets | gitlab_snippets | |
| hex.pm | hex | Elixir packages |
| Hugging Face | huggingface | AI models |
| Lemmy | lemmy | Fediverse forums |
| Microsoft Learn | microsoft_learn | |
| mwmbl | mwmbl | Open-source index |
| NVD | nvd | CVE/vulnerability DB |
| OpenAlex | openalex | Academic |
reddit | ||
| tagesschau.de | tagesschau | German news (web+news) |
| Void Linux | voidlinux | |
| Simple Wikipedia | simple_wikipedia | |
| Wikibooks | wikibooks | |
| Wikiquote | wikiquote | |
| Wikisource | wikisource | |
| Wikivoyage | wikivoyage | |
| Wiktionary | wiktionary | |
| Wikimedia Commons | wikicommons | |
| Internet Archive | internet_archive | |
| PubMed | pubmed | |
| RubyGems | rubygems | |
| cdnjs | cdnjs | JS CDN |
| pub.dev | pub_dev | Dart packages |
| CocoaPods | cocoapods | iOS packages |
| TVmaze | tvmaze | TV shows |
| TMDB | tmdb | Movies |
| OpenLibrary Books | openlibrary_search | |
| Photon | photon | Geocoder |
| Alpine Packages | alpine_packages | |
| Flathub | flathub | |
| Snapcraft | snapcraft | |
| YTS | yts | Movie torrents |
| Urban Dictionary | urban_dictionary | |
| Steam | steam | Games |
| eBay | ebay | |
| F-Droid | fdroid | FOSS Android apps |
| Podcast Index | podcast_index | |
| Semantic Scholar | semantic_scholar | Academic |
| Gitea | gitea | |
| lib.rs | lib_rs | Rust crate search |
| Packagist | packagist | PHP packages |
| Stack Overflow Tags | stackoverflow_main | |
| Anaconda Cloud | anaconda_cloud | |
| Hackage | hackage | Haskell packages |
| NuGet | nuget | .NET packages |
| Maven | maven | Java packages |
| Libraries.io | libraries_io | Multi-registry |
| Metacritic | metacritic | |
| Rotten Tomatoes | rotten_tomatoes | |
| Letterboxd | letterboxd | |
| VNDB | vndb | Visual novels |
| PCGamingWiki | pcgamingwiki | |
| IsThereAnyDeal | isthereanydeal | Game prices |
| BoardGameGeek | boardgamegeek | |
| Linguee | linguee | |
| Brave Search API | brave_api | Brave’s paid API; needs a key (Settings › API keys), never asked without one |
| Yep | yep_api | Yep’s own index through its paid API; needs a key of your own (Settings › API keys), never asked without one |
| Gibiru | gibiru | |
| Emojipedia | emojipedia | |
| AlternativeTo | alternativeto | |
| Goodreads | goodreads | |
| IMDB | imdb_search | |
| itch.io | itch_io | Indie games |
| Are.na | are_na | |
| Kickstarter | kickstarter | |
| Product Hunt | product_hunt | |
| IEEE Xplore | ieee | |
| Springer | springer_open | |
| CORE | core | Academic |
| DOAJ | doaj | Open access journals |
| Zenodo | zenodo | Research data |
| ORCID | orcid | |
| Kitsu | kitsu | Anime/manga |
| MyAnimeList | jikan | Via Jikan API |
| RAWG | rawg | Games |
| MangaDex | mangadex | |
| Open Food Facts | openfoodfacts | |
| Etsy | etsy | |
| CPAN | cpan | Perl packages |
| EncycloSearch | encyclosearch | The Encyclosphere’s encyclopedias |
| Wikiversity | wikiversity | |
| Minecraft Wiki | minecraft_wiki | |
| Keenable | keenable | Its own index, keyless |
| Moviepilot | moviepilot | Films and series (German) |
Images (28 engines, 21 listed)
| Engine | ID | Notes |
|---|---|---|
| Frinkiac | frinkiac | The Simpsons’ frames by what is said in them |
| Pixabay | pixabay | Its safe filter on at every level |
| pixiv | pixiv | Illustrations; all ages only at Moderate and Strict |
| Art Institute of Chicago | artic | |
| ArtStation | artstation | POST API |
| Openverse | openverse | CC-licensed |
| Unsplash | unsplash | Its official API; needs a key (Settings › API keys) |
| Wallhaven | wallhaven | |
| Wikimedia Commons | wikicommons_images | |
| Startpagina Images | startpagina_images | Google’s pictures, through Startpagina |
| Library of Congress | loc | Photographs; 15 requests a minute |
pinterest | Pins, each linking its pin | |
| Imgflip | imgflip | Graphicons tab, Formats: its 100 most-captioned meme templates, kept a day |
| OpenMoji | openmoji | Graphicons tab, Text: the open emoji (CC BY-SA 4.0), its catalogue kept a day |
| Emojipedia | emojipedia | Graphicons tab, Text: its emoji, drawn in OpenMoji’s art |
| Wikimedia Commons GIFs | wikicommons_gifs | Graphicons tab, Media: Commons’ animated GIFs, each with its licence |
| Gifbox | gifbox | Graphicons tab, Media: GIFs, each its poster and its clip; needs a key (Settings › API keys), its answers kept a day |
| Danbooru | danbooru | Graphicons tab, Media: anime art by its tags; not at Strict, its general rating at Moderate |
| Safebooru | safebooru | Graphicons tab, Media: its own uploads, not Danbooru’s again; not at Strict, its general rating at Moderate |
| 7TV | seventv | Graphicons tab, Media: emotes; its NSFW filter at Moderate and Strict |
| Emoji.gg | emojigg | Graphicons tab, Media: Discord emoji, its catalogue kept a day, its NSFW category left out |
Videos (19 engines, 13 listed)
| Engine | ID | Notes |
|---|---|---|
| 360 Video | 360search_videos | Chinese video sites |
| Piped | piped | YouTube’s videos through a Piped instance, linked to YouTube |
| Rumble | rumble | |
| Vimeo | vimeo | With the guest token its site hands every visitor |
| BitChute | bitchute | |
| CCC Media | ccc_media | Chaos Computer Club |
| Dailymotion | dailymotion | |
| IMDb | imdb | |
| Internet Archive Video | archive_video | |
| Odysee | odysee | LBRY |
| PeerTube | peertube | Fediverse video |
| Wikimedia Commons Videos | wikicommons_videos | |
| Bilibili | bilibili | Chinese video |
News (8 engines, 4 listed)
| Engine | ID | Notes |
|---|---|---|
| ANSA | ansa | Italy’s news agency, newest first |
| tagesschau.de | tagesschau | German; also in web |
| Wikinews | wikinews | |
| The Guardian | the_guardian | Uses test API key |
Music (11 engines, 10 listed)
| Engine | ID | Notes |
|---|---|---|
| Freesound | freesound | Creative Commons sounds; needs a key |
| Discogs | discogs | |
| Genius | genius | |
| Jamendo | jamendo | CC music |
| Last.fm | lastfm | |
| MusicBrainz | musicbrainz | |
| Radio Browser | radio_browser | Internet radio |
| fyyd | fyyd | Podcasts |
| Deezer | deezer | Tracks; its terms: personal, non-commercial use |
| Mixcloud | mixcloud | DJ mixes and shows |
Science (15 engines, 14 listed)
| Engine | ID | Notes |
|---|---|---|
| Google Scholar | google_scholar | A captcha is a failure, never answered |
| OpenAIRE Datasets | openairedatasets | By title |
| OpenAIRE Publications | openairepublications | By title |
| OSF Preprints | osf | Through SHARE |
| arXiv | arxiv | Academic preprints |
| CORE | core_sci | |
| Crossref | crossref_sci | |
| dblp | dblp | CS papers |
| DOAJ | doaj_sci | Open access |
| OpenAlex | openalex_sci | |
| PubMed | pubmed_sci | |
| Semantic Scholar | semantic_scholar_sci | |
| Zenodo | zenodo_sci | |
| Wikispecies | wikispecies |
IT (25 engines, 24 listed)
| Engine | ID | Notes |
|---|---|---|
| Lobsters | lobste_rs | Its stories |
| sourcehut | sourcehut | Its public projects |
| Codeberg | codeberg | |
| crates.io | crates_io | Rust |
| Docker Hub | docker_hub_it | |
| GitHub Repos | github_repos_it | |
| GitLab | gitlab_it | |
| hex.pm | hex_it | Elixir |
| MDN | mdn_it | |
| npm | npm_search | |
| NuGet | nuget_it | .NET |
| Packagist | packagist_it | PHP |
| pkg.go.dev | pkg_go_dev | Go |
| pub.dev | pub_dev_it | Dart |
| RubyGems | rubygems_it | |
| Sploitus | sploitus | Exploits and proofs of concept, each linking its source |
| Stack Overflow | stackoverflow | |
| ManKier | mankier | Man pages |
| Hoogle | hoogle | Haskell functions by name or type |
| Hugging Face Datasets | huggingface_datasets | |
| Hugging Face Spaces | huggingface_spaces | |
| Baidu Kaifa | baidu_kaifa | Baidu’s search for developers |
| NixOS Wiki | nixos_wiki | |
| Free Software Directory | free_software_directory | The FSF’s, by title |
Files (15 engines, 8 listed)
| Engine | ID | Notes |
|---|---|---|
| BTDigg | btdigg | DHT torrents |
| Library Genesis | libgen | libgen.li |
| 1337x | 1337x_files | |
| Nyaa | nyaa | Anime torrents |
| Pirate Bay | piratebay_files | |
| Solid Torrents | solidtorrents_files | |
| YTS | yts_files | Movie torrents |
| BT4G | bt4g | Torrent names, from its RSS feed |
Social (13 engines, 9 listed)
| Engine | ID | Notes |
|---|---|---|
| Boardreader | boardreader | Forum posts |
| Lobsters | lobsters_social | Their threads |
| Hacker News | hackernews_social | |
| Lemmy | lemmy_social | |
| Mastodon | mastodon_social | A hashtag’s posts (the words searched, joined) |
reddit_social | ||
| WordPress.com Reader | wordpress_reader | Blog posts, newest first |
| Lemmy Communities | lemmy_communities | The most subscribed first |
| Mastodon Accounts | mastodon_accounts | Accounts that let themselves be found |
Books (4 engines)
| Engine | ID | Notes |
|---|---|---|
| Goodreads | goodreads_books | |
| Internet Archive | internet_archive_books | |
| Open Library | openlibrary_books | |
| Project Gutenberg | gutenberg_books |
Q&A (6 engines)
| Engine | ID | Notes |
|---|---|---|
| Ask Ubuntu | askubuntu_qa | |
| Math SE | math_se_qa | |
| Server Fault | serverfault_qa | |
| StackExchange | stackexchange_qa | |
| Super User | superuser_qa | |
| Unix & Linux SE | unix_se_qa |
Packages (19 engines)
| Engine | ID | Notes |
|---|---|---|
| NixOS packages | nixos_packages | nixos-unstable |
| R-universe | cran | CRAN’s and the R community’s packages |
| Alpine Packages | alpine_packages_pkg | |
| Anaconda Cloud | anaconda_cloud | conda packages |
| Arch Wiki | archwiki_packages | |
| AUR | aur | |
| crates.io | crates | Rust packages |
| Docker Hub | docker_hub | container images |
| Flathub | flathub_pkg | |
| Gentoo Wiki | gentoo_wiki | |
| hex.pm | hex | Elixir packages |
| MetaCPAN | metacpan | Perl modules |
| npm | npm | JavaScript packages |
| NuGet | nuget | .NET packages |
| Packagist | packagist | PHP packages |
| pkg.go.dev | pkg_go_dev | Go packages |
| RubyGems | rubygems | Ruby gems |
| Void Linux | void_packages_pkg | |
| CachyOS Packages | cachy_os |
Maps (2 engines)
| Engine | ID | Notes |
|---|---|---|
| OpenStreetMap (Nominatim) | nominatim_maps | |
| Photon Geocoder | photon_maps |
Lyrics (1 engine)
| Engine | ID | Notes |
|---|---|---|
| Genius Lyrics | genius_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.
| Oracle | Permission key | Trigger patterns | What it shows |
|---|---|---|---|
| Calculator | calculator | 2+2, sqrt(16), 15% of 200, sin(1.5), 2^8; calculator or calc alone | Arithmetic, trig, logarithms, percentage calculations; the keypad alone, on any tab |
| Unit Converter | unit_converter | 10 km to miles, 72 fahrenheit to celsius, 5 gallons to liters, 100 fl oz to ml | Length, weight, volume, speed, data storage, cooking units, temperature, force/mass |
| Base Converter | base_converter | 0xff in decimal, 255 in hex, 255 in binary, 0b1010 in decimal, 0o77 in hex | Decimal, hex, binary, octal conversions |
| Color | color | #FF5500, #f50, rgb(255,85,0), hsl(20,100%,50%) | Color swatch with hex/RGB/HSL conversions |
| Private IP | private_ip | Bare IPv4/IPv6 addresses in private ranges (192.168.1.1, 10.0.0.1) | Identifies the private range and offers HTTP/HTTPS links |
| Timezone | timezone | time in tokyo, time in new york, time in UTC+5 | Current time in 70+ cities and IANA timezones |
| UUID | uuid | Any UUID string (e.g. 550e8400-e29b-41d4-a716-446655440000) | Version, variant, and embedded timestamp (v1/v7) |
| Timestamp | timestamp | 10-digit or 13-digit numbers, now, current timestamp, unix timestamp | Converts Unix timestamps to human dates, or shows current timestamp |
| JWT | jwt | Any header.payload.signature JWT token | Decodes header and payload, shows algorithm and expiry |
| CIDR | cidr | 192.168.1.0/24, 10.0.0.0/8 | Network, broadcast, host range, usable hosts, netmask |
| Hash/Base64 | hash | MD5 (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 |
| Cron | cron | 5-field cron expressions like 0 */2 * * 1-5 | Human-readable schedule description with per-field explanation |
| DOI | doi | 10.1000/xyz123 or doi.org/10.1000/xyz123 | Links to publisher (doi.org) and Sci-Hub |
| Timer | timer | timer 5 minutes, timer 30s, countdown 10m, stopwatch | Interactive countdown timer or stopwatch widget |
| Random | random | flip a coin, roll a die, roll 3d20, random 1 to 100 | Coin flip, dice rolls (NdX), random number in range (crypto/rand) |
| Password | password | password, generate password, password 32 chars | Cryptographically random password with copy button (4-256 chars) |
| QR Code | qr | qr https://example.com, qr code hello world | Inline SVG QR code (up to ~271 bytes, versions 1-10) |
| Chmod | chmod | chmod 755, chmod rwxr-xr-x | Numeric-to-symbolic and symbolic-to-numeric conversion with explanation |
| Roman Numeral | roman | XIV in decimal, 42 in roman | Roman numeral to/from decimal conversion (1-3999) |
| Date Arithmetic | date_arithmetic | days between Jan 1 and Dec 31, 30 days from now, days until Christmas, 90 days ago | Day counts, future/past dates, with IFC calendar dates |
| Battery time | battery | my battery went down 15% in half an hour, battery at 60% dropping 15% every 30 minutes, phone charged 20% in 15 min | How 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.
| Oracle | Permission key | Trigger patterns | What it shows | API used |
|---|---|---|---|---|
| Reverse DNS | reverse_dns | rdns 8.8.8.8, reverse dns 1.1.1.1, nslookup 8.8.4.4, ptr <IP> | PTR records for an IP address | System DNS resolver |
| DNS Lookup | dns_dig | example.com, dig example.com, dns example.com | A, AAAA, MX, TXT records | System DNS resolver |
| IP Geolocation | ip_geo | Bare 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, PTR | ipapi.co, system DNS resolver |
| My IP | my_ip | my ip, whats my ip, ip, show my ip | The visitor’s public IP and its country, from the DB-IP list this server keeps (nothing is looked up elsewhere) | none |
| Area codes | area_code | area code 517, what area code is 604, 212 area code, a phone number written as one: (313) 555-0123, +1 415 555 0123 | Where a North American area code is, since when, and the codes that share its area; drawn with the page | none (a table built in from Wikipedia’s list, tools/area_codes.py) |
| Currency | currency | £339.90 to usd, 100 eur in yen, convert 50 dollars to rupees, usd to eur | A converter filled from the search, live as it changes, and the rate over a month, a year and five years | frankfurter.dev; fawazahmed0/exchange-api (jsDelivr CDN) when it cannot answer |
| WHOIS | whois | whois example.com | Domain registrar, creation/expiry dates, nameservers | RDAP (rdap.org) |
| Speedtest | speedtest | speedtest, speed test, internet speed, bandwidth test | Interactive 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 tab | Server’s own /api/v1/speedtest/* endpoints |
| Benchmark | benchmark | benchmark, browser benchmark, system benchmark | JS/DOM/Crypto/Canvas/Memory benchmark with scores; includes speedtest if permitted | Client-side JS + server speedtest |
| Translation | translation | translate hello to french, translate X to Y, hello in spanish, en español hola, auf Deutsch X | Text translation with language detection; words already in the language named are translated into the reader’s | Configured translation backends |
| Auto-translate | translation | (Automatic on non-native-language queries) | Detects foreign language queries and translates to user’s known language | Configured translation backends |
| Map | map | map of paris; on the Maps tab any place: tokyo, directions to berlin | OpenStreetMap tile with links to OSM, Apple, Google, HERE, Bing, OsmAnd, Waze, Yandex Maps | Open-Meteo geocoding (Nominatim for weak matches and qualifiers), as weather + OSM tiles |
| Places | places | On the Maps tab: coffee near lyon, pharmacy in tromso | Up to 8 places nearby: name, kind, address, distance, link | Foursquare, then HERE (with a key), else OpenStreetMap (Nominatim, no key); the place by the cards’ geocoder |
| Wikipedia | wikipedia | Entity-like queries (1-3 capitalized words), who is X, what is X | Infobox card with image, summary, and Wikipedia link | Wikipedia REST API |
| DDG Instant Answers | ddg_ia | (Any query — lowest priority among knowledge oracles) | Abstract, definition, or answer card from DuckDuckGo | DuckDuckGo Instant Answer API |
| Package Version | packages | latest lodash, npm lodash, pypi requests, pip flask version | Latest version with link to registry | npm Registry / PyPI |
| Radio | radio | radio new york, fm tokyo, radio stations in berlin, radio 1950s, old time radio 1938 mystery | Up 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 page | radio-browser.info; archive.org |
| Sports Scores | sports | nfl scores, premier league scores, arsenal score, real madrid next match, when do the celtics play | A 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 zone | TheSportsDB for a team, else ESPN; ESPN for a league |
| SSL Certificate | ssl_cert | ssl example.com, cert example.com, certificate example.com | Certificate issuer, validity dates, SANs, protocol version, cipher suite | Direct TLS connection |
| Earthquake | earthquake | earthquakes, earthquakes today, recent earthquakes, earthquakes in california | Recent significant earthquakes with magnitude, location, depth, and time | USGS Earthquake API |
| Flights | flights | flight UA123, flight status AA456, flights from JFK to LAX | Live flight tracking by callsign; route planning with bearing and distance | OpenSky Network API |
| Recipe | recipe | recipe for pasta, how to make brownies, how to cook risotto | Step-by-step recipe with ingredients, thumbnail, and source link | TheMealDB |
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.
| Oracle | Permission key | Trigger patterns | What it shows | API key config | API used |
|---|---|---|---|---|---|
| Wolfram Alpha | wolfram | (Any query — lowest priority knowledge oracle) | Computational answers, facts, math | wolframalpha "..." | Wolfram Alpha Short Answers API |
| Weather | weather | weather 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 icon | Optional: openweathermap "..." | Open-Meteo (free, always); OpenWeatherMap (if key set, tabbed multi-source) |
| Dictionary | dictionary | define serendipity, meaning of ubiquitous, what does ephemeral mean, urban slang | Multi-source tabbed definitions | Optional: mw_collegiate, mw_thesaurus, mw_learners, mw_medical, mw_spanish, mw_school, mw_elementary, mw_intermediate, mw_intermediate_thesaurus, wordnik | Free Dictionary API + Wiktionary + Urban Dictionary (always); up to 9 Merriam-Webster products + Wordnik (with keys) |
| Stock | stock | $AAPL, TSLA stock, stock price MSFT | Price, change, open/high/low, previous close | Optional: alpha_vantage "...", twelvedata "...", finnhub "..." | Alpha Vantage, Twelve Data, Finnhub (multi-source tabbed if multiple keys) |
| Blockchain lookup | chain | a 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 transaction | Balance, 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 explorer | None | Blockscout (eth.blockscout.com), mempool.space: only what was pasted |
| Callsign | callsign | callsign 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 address | None | callook.info (the FCC’s licences): only the callsign |
| Company identifier (LEI) | lei | an LEI HWUPKR0MPOU8FGXBT394 (its check digits must hold) or lei HWUP…; apple lei number, lei code siemens, siemens ag lei | Legal name, LEI, headquarters, jurisdiction, entity and registration status, renewal date; a link to GLEIF’s record | None | GLEIF (api.gleif.org); Wikidata to find a named company’s LEI: only the LEI or the name |
| Crypto | crypto | $BTC, bitcoin price, price of ethereum, crypto solana | USD/EUR/BTC price, 24h change, market cap | None (free API) | CoinGecko |
| Inflation / CPI | inflation | inflation, cpi, consumer price index, dollar inflation | Annual inflation rate with 12-month sparkline chart | None (free API) | Bureau of Labor Statistics |
| Purchasing Power | inflation | purchasing power of dollar, dollar worth in 1970 | Historical purchasing power table or year-specific comparison | None (free API) | Bureau of Labor Statistics CPI-U data |
| Air Quality | air_quality | air quality in beijing, aqi paris (a place is needed) | AQI value, category, dominant pollutant, color-coded display | Optional: aqicn "..." | Open-Meteo Air Quality (free, always); AQICN (with key, tabbed multi-source) |
| News | news | news about AI, latest news on climate, headlines technology | Multi-source news headlines with thumbnails | Optional: currentsapi "...", newsdata "...", gnews "..." | Google News RSS (free, always); Currents API, Newsdata.io, GNews (with keys, tabbed) |
| Music / Spotify | music | play bohemian rhapsody, listen to radiohead, song despacito, Artist — Track | Spotify embed player with album info and alternative service links | Optional: spotify-client-id "..." + spotify-client-secret "..." | Spotify Web API (with keys); links-only fallback without keys |
| Events | events | concerts 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 music | ticketmaster "..." (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.
| Priority | Oracle | Permission key | API |
|---|---|---|---|
| 0 (highest) | Wikipedia Infobox | wikipedia | Wikipedia REST API (no key) |
| 1 | DDG Instant Answers | ddg_ia | DuckDuckGo IA API (no key) |
| 2 (lowest) | Wolfram Alpha | wolfram | Wolfram 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:
| Tab | Auto-fired oracles |
|---|---|
| Maps | Map + Weather (for the displayed place; none when no place is found), IP Geolocation (a typed address) |
| Music | Music (with forced “play” prefix), Radio |
| Science | Calculator (its keypad, on every search), Unit Converter |
| IT | Your 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 |
| Weather | Weather (with “weather” prefix) |
| Lyrics | Lyrics |
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:
| Tool | Description |
|---|---|
fetch | Fetches and extracts text from URLs; supports depth=2 for same-domain crawling |
psychoscrape | Citation-aware web scraper that extracts structured claims with source attribution |
youtube_transcript | Extracts timestamped transcripts/captions from YouTube videos |
lua | Sandboxed Lua execution environment with HTTP, JSON, math, and string libraries |
send | Shows intermediate findings to the user during research |
eta | Updates the user-facing ETA countdown |
friction | Logs improvement suggestions for the server developer |
pin | Pins a result to the top of the search results |
forget | Removes a result from the search results |
friend_search | Searches 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:
| Service | Config key | Required? |
|---|---|---|
| Wolfram Alpha | api-keys { wolframalpha "..." } | Optional; enables Wolfram oracle |
| DeepL | api-keys { deepl "..." } | Optional; translation backend |
| Freesound | api-keys { freesound "..." } | Required for freesound engine |
| Spotify | api-keys { spotify-client-id / spotify-client-secret } | Optional; enables Spotify embed in music oracle |
| OpenWeatherMap | api-keys { openweathermap "..." } | Optional; adds second weather source |
| Alpha Vantage | api-keys { alpha_vantage "..." } | Optional; stock quotes |
| Twelve Data | api-keys { twelvedata "..." } | Optional; stock quotes |
| Finnhub | api-keys { finnhub "..." } | Optional; stock quotes |
| AQICN | api-keys { aqicn "..." } | Optional; adds second air quality source |
| Currents API | api-keys { currentsapi "..." } | Optional; news oracle source |
| Newsdata.io | api-keys { newsdata "..." } | Optional; news oracle source |
| GNews | api-keys { gnews "..." } | Optional; news oracle source |
| MW Collegiate | api-keys { mw_collegiate "..." } | Optional; dictionary source |
| MW Thesaurus | api-keys { mw_thesaurus "..." } | Optional; dictionary source (synonyms/antonyms) |
| MW Learner’s | api-keys { mw_learners "..." } | Optional; dictionary source |
| MW Medical | api-keys { mw_medical "..." } | Optional; dictionary source |
| MW Spanish | api-keys { mw_spanish "..." } | Optional; bilingual dictionary source |
| MW School | api-keys { mw_school "..." } | Optional; dictionary source |
| MW Elementary | api-keys { mw_elementary "..." } | Optional; dictionary source |
| MW Intermediate | api-keys { mw_intermediate "..." } | Optional; dictionary source |
| MW Int. Thesaurus | api-keys { mw_intermediate_thesaurus "..." } | Optional; dictionary source |
| Wordnik | api-keys { wordnik "..." } | Optional; dictionary source |
| Unsplash | api-keys { unsplash "..." } | Required for the unsplash engine (its official API) |
| The Guardian | Hardcoded test key | None needed |
| Pexels | api-keys { pexels "..." }, or one’s own in Settings › API keys | Optional: 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/)
| File | Lines | Purpose |
|---|---|---|
main.go | 503 | Entry point, config loading, startup sequence |
routes.go | 364 | HTTP route registration table |
handlers_search.go | 455 | Search and landing page handlers |
handlers_settings.go | 281 | Settings page GET/POST |
handlers_auth.go | 280 | Captcha and PoW handlers |
handlers_admin.go | ~200 | Admin log and login |
handlers_api.go | ~150 | JSON API endpoint |
handlers_misc.go | ~100 | About, health, robots |
admin_users.go | 210 | User group management |
engine.go | 483 | Engine interface, types, registry, HTTP client |
generic_engine.go | 453 | KDL-driven engine factory |
engine_brave.go | 377 | Brave scraper |
engine_google.go | 301 | Google scraper |
engine_bing.go | 405 | Bing scraper |
engine_yahoo.go | 351 | Yahoo scraper |
engine_baidu.go | 307 | Baidu scraper |
engine_duckduckgo.go | 230 | DDG scraper |
engine_startpage.go | ~170 | Startpage scraper |
engine_yandex.go | ~170 | Yandex scraper |
engine_qwant.go | ~150 | Qwant API client |
engine_wikipedia.go | ~120 | MediaWiki API |
engine_youtube.go | ~130 | YouTube scraper |
engine_hackernews.go | ~100 | HN Algolia API |
engine_marginalia.go | ~100 | Marginalia API |
engine_mojeek.go | ~100 | Mojeek scraper |
engine_wiby.go | ~80 | Wiby API |
engine_flickr.go | ~80 | Flickr API |
engine_pexels.go | ~80 | Pexels API |
engine_soundcloud.go | ~100 | SoundCloud API |
fanout.go | 988 | Concurrent engine dispatch, scoring, dedup, merge |
cache.go | 346 | In-memory LRU + TTL cache |
peercache.go | 249 | Friend cache query/push |
peers.go | 268 | Peer config loading, failure tracking |
friendproxy.go | 327 | Service proxy between friends |
auth.go | 316 | Ed25519 sessions, PoW verification |
captcha_prerender.go | 688 | Pre-rendered captcha pool (IQ test grid) |
captcha_image.go | 307 | Captcha image compositing |
oracles.go | 893 | Calculator, unit, timezone, base, translate, DDG IA, Wolfram |
oracle_*.go | 50–780 each | One oracle (or a tight family) per file: currency, IP, DNS, dictionary, stock, crypto…; shared caches in oracle_helpers.go |
airesearch.go | 600 | AI agent: the LLM tool loop (RunAIResearch) |
airesearch_*.go | 180–400 each | Its config, environment, LLM client, tools, fetchers, psychoscraper, Lua sandbox |
airesearch_sse.go | 187 | SSE event streaming |
airesearch_cache.go | ~100 | Research result caching |
mcp_client.go | 195 | MCP tool server integration |
translation.go | 614 | Multi-backend translation with routing |
langdetect.go | ~100 | Language detection for auto-translate |
autocomplete.go | 302 | Multi-backend autocomplete merger |
classifier.go | ~100 | Query intent classification |
imageproxy.go | 433 | Image proxy with SSRF protection |
templates.go | 260 | html/template set and shared render helpers |
templates_*.go | 140–570 each | Rendering by page or concern: layout, tabs, results frame, row, results, media, settings, log, history, pages |
db.go | 304 | SQLite schema, logging, queries |
groups.go | 263 | User tier/group loading from KDL |
tiers.go | 222 | Permission checking |
rate_limit.go | 202 | Per-IP rate limiting |
rewrite.go | ~100 | URL hostname rewriting |
instances.go | 288 | Instance browser + ami4got |
plugins.go | 214 | Lua plugin system |
engine_snapshots.go | 52 | Last working and failing response per engine, for health notifications |
sidecar.go | ~100 | Python sidecar integration |
rss.go | ~100 | Atom feed generation |
openapi.go | 530 | OpenAPI 3.0 spec generation |
api_compat.go | ~100 | 4get-compatible API |
api_doc.go | ~100 | Plain-text API docs |
metrics.go | ~100 | Prometheus counters |
counters.go | ~50 | Atomic hit/miss counters |
config_validate.go | 186 | Config validation at startup |
kdl_doc.go | ~200 | The only file that imports kdl-go: node getters, section resolution, syntax errors as file:line:col |
helpers.go | ~80 | Cookie reading, IP extraction |
stubs.go | 199 | Compile-time stubs for optional features |
types.go | ~50 | Shared type definitions |
Python sidecar (python-sidecar/)
| File | Lines | Purpose |
|---|---|---|
server.py | 96 | Flask HTTP server |
google.py | 245 | Google Playwright scraper |
yandex.py | 219 | Yandex Playwright scraper |
qwant.py | 259 | Qwant Playwright scraper |
KDL configs (data/)
| File | Controls |
|---|---|
config.kdl | Main server configuration (port, auth, cache, API keys) |
config.default.kdl | Default config template |
engines.kdl | All 274 generic engine definitions |
peers.kdl / peers.default.kdl | Friend network topology and wait policy |
groups.kdl | User tiers and permissions |
captcha.kdl | Captcha pool sizes and generation cadence |
autocomplete.kdl | Autocomplete backend weights |
translation.kdl | Translation backend priority and rate limits |
instances.kdl | Instance browser entries |
ai-research.kdl / ai-research.default.kdl | AI agent provider, model, access control |
metaprompt.md | AI 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:
- Abuse (bots, scraping, DoS): Automated clients attempting to use the instance as a free search API proxy, or overwhelming it with requests.
- Privacy leakage: Search queries, user IPs, or browsing patterns leaking to upstream engines, result sites, or third parties.
- Server-Side Request Forgery (SSRF): Attackers using the image proxy, service proxy, or AI research agent to access internal network resources.
- Cross-Site Request Forgery (CSRF): Malicious sites submitting forms to the instance on behalf of authenticated users.
- Plugin/extension code execution: Lua plugins or AI research agents executing arbitrary code within the server process.
- 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:
| Tier | How acquired | Capabilities |
|---|---|---|
| Unauthenticated | No cookie | Redirected to PoW or captcha challenge |
| Session (cookie) | Solve PoW or captcha | Search access, settings, history |
| API key | Issued by owner | Programmatic search access via X-API-Key header |
| Deluxe | Group membership | Access to browser-backed engines, banner uploads, AI features |
| Owner | Bearer token matching owner-secret in config | Full 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
- New visitor hits any search endpoint.
- Server checks for a valid
4got_sessioncookie. - If absent, redirects to PoW challenge (or captcha for JavaScript-disabled clients and Tor users).
- PoW solution or captcha answer is verified server-side.
- On success, a session cookie is set with a configurable TTL (
captcha-bypass-hours). - The
4got_seencookie 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 aftercaptcha-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:
EnsureCSRFToken()reads or generates a 32-hex-character token (16 random bytes fromcrypto/rand).- The token is stored in a
csrf_tokencookie (HttpOnly is not set because JavaScript needs to read it for AJAX requests). - Every form includes a hidden
<input name="_csrf">field with the token value. - On POST,
ValidateCSRF()compares the form field (orX-CSRF-Tokenheader for JSON endpoints) against the cookie usingcrypto/subtle.ConstantTimeCompare. - 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 addresspublicIP()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_postwhenlua-networkis 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-Secretheader, this server’speer-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()andclock()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-secretinconfig.kdl) used as aBearertoken for inter-instance API calls. - Mutual configuration: Both instances must list each other in their
peers.kdlconfiguration.
Cache sharing
- Friend instances share search result caches via
/api/v1/cacheGET/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-proxyin config whitelists which services can be proxied.prefer-frienddirectives route specific services through preferred friends, only for the owner and groups withfriend_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.
robotsmeta tag is set tonoindex,nofollowon all pages.
Cookie security
- Session cookies use
SameSite=Laxto 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.jslink 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
- Copy
data/config.default.kdltodata/config.kdlif you haven’t already - Set
owner-secretto a strong random string — this is your admin password:python3 -c "import secrets; print(secrets.token_urlsafe(32))" - Add API keys in the
api-keysblock (all optional):wolframalpha— instant answersdeepl— translation widgetspotify-client-id/spotify-client-secret— music results
- Configure engine groups in
data/groups.kdl(the defaults are sensible) - Start the server and visit
/admin/loginto authenticate as owner - Optionally set
peer-secretand configuredata/peers.kdlfor federated search across multiple instances - Run
./4got --benchfor this machine’s capacity report (see Size it below)
Prerequisites
- Go 1.23+ (the
go.modtargets 1.25 but 1.23+ should work) - SQLite3 development headers (e.g.
libsqlite3-devon Debian,sqlite-devon 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 bannersavifenc(libavif-bin): AVIF banners and captchas for browsers without JPEG XL (else PNG and JPEG)pdftotext(poppler-utils): the text of attached PDFstesseract(tesseract-ocr): the text in an image searched or attachedzbarimg(zbar-tools): QR codes and barcodes in an image searchedpandoc(pandoc): the text of attached DOCX and ODT filesffmpeg(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.
| Lines | Tokens | |
|---|---|---|
| 4got Go (minus tests) | 127,063 | 1,926,507 |
| 4got browser JS and CSS | 24,929 | 528,094 |
| 4got KDL config (engines, groups, translation) | 5,134 | 65,090 |
| 4got HTML templates | 2,063 | 75,558 |
| 4got Python (sidecar, tools) | 2,141 | 29,430 |
| 4got, without tests | 161,330 | 2,624,679 |
| 4got Go tests | 112,181 | 2,092,128 |
| SearXNG Python (minus tests) | 51,364 | 625,301 |
| SearXNG client (TypeScript, LESS) | 5,677 | 51,409 |
| SearXNG settings.yml | 3,458 | 37,017 |
| SearXNG Jinja templates | 2,296 | 50,054 |
| SearXNG, without tests | 62,795 | 763,781 |
| SearXNG tests | 3,761 | 54,328 |
| 4get PHP | 38,092 | 393,526 |
| 4get JS and CSS | 3,896 | 29,340 |
| 4get (no tests) | 41,988 | 422,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).
| HTML | HTML as sent | first visit, as sent | again, as sent | |
|---|---|---|---|---|
| 4got results page | 133.7 KB | 17.7 KB | 575 KB (87 requests) | 19.6 KB |
| DuckDuckGo, the JavaScript page | 19.2 KB | 19.5 KB | 1,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:
- Install
dnscrypt-proxyand point it at trusted DoH/DoT servers (e.g. Quad99.9.9.9, Cloudflare1.1.1.1). - Configure your local resolver (Technitium/Unbound) to forward to
127.0.0.1:5353(dnscrypt-proxy’s default listen port). - 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.
-
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` -
Write
data/bindings.kdlbinding that address (see below). -
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 -
Verify it actually filters, sending a cookie that tries to turn filtering OFF.
-
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.
-
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:
- 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. - 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.
- 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:
- Visit
/admin/log(public) or/admin/health(owner). Suspended engines show a red “suspended” status badge. - Check the server logs for lines like
engine X: error ...orengine X: timeout. - 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:
- Check WAL size:
ls -lh data/4got.db-wal - Force a checkpoint:
sqlite3 data/4got.db 'PRAGMA wal_checkpoint(TRUNCATE);' - 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
- The
-shmfile 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:
- Verify
peer-secretinconfig.kdlmatches on both sides. - Check that the friend’s URL in
peers.kdlis reachable and includes the correct protocol (https://). - Look for TLS certificate errors in logs – self-signed certs need explicit trust.
- Verify the friend instance is running a compatible API version (
/ami4gotreturns 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/cacheand/api/v1/proxyendpoints – ensure they are not blocked. - Permissions: a friend needs no group. It is known by
peer-secret, and its push by itspubkeyin peers.kdl.
Memory usage
Symptoms: The server process consumes more memory than expected, or OOM-kills occur.
Common causes:
- Image proxy cache: In-memory image cache grows with traffic. Configure
max_cache_sizein the image proxy config, or rely on SQLite-backed caching with eviction. - Highlight regex cache: Capped at 10,000 entries, auto-evicts when full. Not usually a problem.
- Peer cache: Cached results from friend instances are held in memory. Large peer networks with high traffic multiply memory usage.
- AI research: The LLM research agent (if enabled) buffers responses. Each concurrent research session uses memory proportional to response length.
- 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
GOGCenvironment variable to control GC aggressiveness (default 100; lower values like 50 trade CPU for less memory). - Reduce
max_cache_sizefor 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/andstatic/into the image. If you modified the directory structure, update the Dockerfile paths. - Verify with
docker exec <container> ls /app/templates/andls /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:8080or setHOST/PORTenvironment variables. - In
docker-compose.yml, verify theportssection 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
/ami4gotas a Docker health check endpoint:HEALTHCHECK CMD curl -sf http://localhost:8080/ami4got || exit 1.
fly.io specific:
- The
fly.tomlmounts 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.comautomatically - 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:
- Peer cache sharing — friends share cached search results, reducing redundant upstream queries
- Service proxy — friends proxy expensive services (translation, Wolfram Alpha, autocomplete) for each other
- Instance discovery — the
/ami4gotendpoint 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
- User searches for “quantum computing”
- 4got sends the cache key to all configured friends simultaneously
- Friends check their local cache and respond with results (or 404 Not Found on a miss)
- 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
- Instance A needs to translate text but has no DeepL API key
- Instance A sends
POST /api/v1/proxyto 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. - Instance B checks its
allow-proxylist, finds “translation” is allowed, performs the translation, and returns the result - 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 APIautocomplete— 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
- The request carries the words in a JSON body, never the URL:
{"q", "safe", "region", "page", "to", "asked_at"}, wheretois 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) andX-Peer-Identity(the asker’s fingerprint), plusX-Peer-Secret. - Unsigned, signed by a key it does not list, addressed (
to) to another server, orasked_atmore than 5 minutes from its clock: 401. A friend withoutrelay true, or one it blocked: 403. - Each friend gets
relay-per-hoursearches an hour (default 60). Past them: 429 withRetry-After. The 200, 429 and 503 answers carryX-4got-Relay-Left, the searches left this hour. - The search passes the lender’s admission gate like a stranger’s. Shedding: 503 with
Retry-After, and the search is not counted. - 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 itsshare "none"engines. - 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.
- The offering friend answers only a friend whose
pubkeyit 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-healthsays 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. - 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. - Accept writes the block to
engines.local.d/<friend>-<id>.kdlin the data dir and loads it at once.--check-configand 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/reloador SIGUSR1). The New engine playground saves there too, asplayground-<id>.kdl: such an engine is not offered to friends (propose it upstream instead). - 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. - 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.
- 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. - 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 whosepubkeypeers.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. - /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
- Restart both instances
- Search on Instance A — check the logs for “cached on 1 friend” in the results
- Visit
/admin/logto 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:
| withheld | why |
|---|---|
entries with user/pass | a 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 field | a 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/prevand/ring/randomredirect to the chosen member, wrapping around the ends, and the redirect carriesReferrer-Policy: no-referrer, so the next site isn’t told which member sent the visitor.fromis the first 8 hex digits of the sha256 of the member’s address, so reorderingdiscovery.kdldoesn’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’scontactis 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:
- 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 tohttps://<the service>/.4got/enter. The entry must be an https address, so a pass never travels in the clear. - 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.
- 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-Namethe same andRemote-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"
}
keyis the friend’s 4got key, from their/doorpage.peopleis 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.urlis 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
- User searches “quantum error correction”
- 4got returns normal search results
- User searches “quantum error correction” again (or clicks the “Research” button)
- 4got starts the AI research agent as a Server-Sent Events (SSE) stream
- The agent fetches top search result URLs, reads them, and synthesizes an answer
- 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
| Field | Description |
|---|---|
enabled | Master switch (true/false) |
mode | Execution mode: "lua" (sandboxed) or "off". A "bash" mode was once documented here but never implemented — only "off" is special-cased. |
provider | LLM provider: “cerebras”, “openrouter”, “ollama”, “openai”, or any OpenAI-compatible endpoint |
model | Model name (provider-specific) |
api-key | API key for the provider |
base-url | Override the API endpoint URL. Defaults are inferred from provider name. |
max-runtime-seconds | Kill 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-seconds | Stop one Lua run after this many seconds; 180 as shipped |
max-tool-iterations | The most tool rounds one job may take. Required while enabled: the server won’t start, and --check-config fails, without it. |
require | Group permission required to use the agent (e.g. “deluxe”). Empty = everyone. |
instructions-require | The 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-require | Who 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-require | Whose 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:
- First search: normal results displayed
- Second search (same query): a research box appears above results with a live SSE stream
- The agent’s steps (its send() lines, its code, its tools’ results) appear in the box’s lower part
- The eta() timer shows beside the box’s name
- 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;asidesays the words so far were said on the way to a tool call (the page moves them into the steps),unsaythat they were tool calls written as textcontext— the download: what the model was sent, as Markdowndone— final answer, stream endserror— 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()andjson_encode()for data processinghttp_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()debuglibrary- 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:
| Hook | Arguments | Return | When |
|---|---|---|---|
on_search(query, category, params) | query string, category string, search params table | modified query string (or nil to keep original) | Before search is dispatched to engines |
on_result(result, engine_id) | result table, engine ID string | modified result table, or nil to filter it out | After each engine returns results, before merging |
on_render(html, query, category) | HTML string, query, category | modified HTML string | After 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 processinghttp_get(url)for fetching URLslog(message)for logging to the server logconfig_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
- Configure MCP servers in
ai-research.kdl(or theai-researchsection of your unified KDL config) - At startup, 4got connects to each MCP server and discovers available tools
- These tools are added to the AI research agent’s tool list alongside the built-in tools
- 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
- All
.luafiles inplugins/are loaded alphabetically - MCP servers are connected in the order they appear in config
- Plugins are loaded after all engines are registered but before the HTTP server starts
- Plugin hooks run in load order; the first
on_searchreturn 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
- Clone the repo and
cdinto it. - Install Go 1.25+ (the
go.modrequires 1.25.0). - Build:
cd go-server && CGO_ENABLED=1 go build -o 4got . - Copy
data/config.default.kdltodata/config.kdland set yourowner-secret. - 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.).
- 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*OracleAnsweror nil. - Register it in
go-server/oracles.goinsideCheckOracles(). 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.