Spaces:
Running
Running
Sync from felladrin/MiniSearch@a3854eb
Browse files- changelog.md +5 -0
- docs/configuration.md +5 -1
- docs/overview.md +1 -0
- docs/page-content.md +15 -0
- docs/security.md +1 -0
changelog.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
| 2 |
|
| 3 |
Notable changes, grouped by date, most recent first.
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
## 2026-11-22
|
| 6 |
|
| 7 |
- `INTERNAL_OPENAI_COMPATIBLE_API_MODEL` now takes several models, separated by commas, in order of preference. When a model fails before the answer starts, the server moves to the next one, and after the last one it starts the list over once. A server with a single model used to give up on the first error; that model now gets one retry, so a short outage of the upstream no longer fails the answer. `/status` also counts each failed attempt by reason (`inference.attemptFailures`: rate limit, server error, other HTTP error, stall, or other), which tells whether the upstream wants fewer requests, a retry or another model.
|
|
|
|
| 2 |
|
| 3 |
Notable changes, grouped by date, most recent first.
|
| 4 |
|
| 5 |
+
## 2026-11-23
|
| 6 |
+
|
| 7 |
+
- The Docker image now switches on Mojeek in its SearXNG settings. Since the last SearXNG update, the Brave web engine is off by default, which left DuckDuckGo and Google CSE as the only general web engines, and DuckDuckGo often answers a CAPTCHA to servers. Mojeek runs its own index: in a test run it returned 10 results on each of 10 queries, and 7 to 9 of them per query came from no other engine. To keep the old engine set, replace the settings file as described in "Tuning the Search Engines" in `docs/configuration.md`.
|
| 8 |
+
- When SearXNG fails and the fallback search answers through Parallel, the AI answer now grounds on the text Parallel already sent with each result instead of downloading those pages. Parallel picks excerpts that match the query, a median of about 2,500 characters per result (measured over 30 results), and the result's snippet showed only 400 of them. So those answers wait for no page downloads, and they no longer lose the pages that refuse the server (on the public demo, 48% of page reads failed). `/status` counts these pages under `pageReads.servedFromSearchExcerpts`.
|
| 9 |
+
|
| 10 |
## 2026-11-22
|
| 11 |
|
| 12 |
- `INTERNAL_OPENAI_COMPATIBLE_API_MODEL` now takes several models, separated by commas, in order of preference. When a model fails before the answer starts, the server moves to the next one, and after the last one it starts the list over once. A server with a single model used to give up on the first error; that model now gets one retry, so a short outage of the upstream no longer fails the answer. `/status` also counts each failed attempt by reason (`inference.attemptFailures`: rate limit, server error, other HTTP error, stall, or other), which tells whether the upstream wants fewer requests, a retry or another model.
|
docs/configuration.md
CHANGED
|
@@ -284,7 +284,7 @@ client.
|
|
| 284 |
|
| 285 |
## Tuning the Search Engines
|
| 286 |
|
| 287 |
-
The bundled SearXNG instance decides which engines answer a query. MiniSearch ships a thin overlay for it (`searxng-settings.yml`) that declares
|
| 288 |
|
| 289 |
Diagnose before you change anything. `/status` needs no token and publishes `searches.unresponsiveEngines`, each engine classified `blocked`, `timeout` or `other`, and the server log prints the same names through the always-on `debug` in `server/webSearchService.ts`. See [Debugging Configuration](#debugging-configuration). To see the engine set itself, ask SearXNG directly, with the same parameters the app sends:
|
| 290 |
|
|
@@ -384,6 +384,10 @@ Engine choice does not change the privacy posture. SearXNG still makes the reque
|
|
| 384 |
|
| 385 |
None of this reaches MiniSearch's code. The app asks SearXNG for one JSON document and reranks whatever comes back, so nothing in `server/webSearchService.ts` changes when you retune the engines, and the circuit breaker, the retries and the `unresponsive_engines` reporting keep working over the new set.
|
| 386 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 387 |
## Runtime Configuration
|
| 388 |
|
| 389 |
Client-facing configuration (access keys, inference type, internal API settings) is resolved at runtime via the `/api/config` endpoint. The client fetches this endpoint on app initialization, so the published Docker image is fully configurable via environment variables at runtime - no rebuild needed.
|
|
|
|
| 284 |
|
| 285 |
## Tuning the Search Engines
|
| 286 |
|
| 287 |
+
The bundled SearXNG instance decides which engines answer a query. MiniSearch ships a thin overlay for it (`searxng-settings.yml`) that declares three things: the JSON output format that `server/webSearchService.ts` consumes, a `secret_key` that the Dockerfile rewrites with a random value at build time, and Mojeek switched on for text search. Everything else about the engine list comes from the pinned SearXNG build, so read the set from the running instance rather than from this page: the command below shows which engines answered and which came back unresponsive. Whatever that set turns out to be, one engine that is rate-limited or CAPTCHA-challenged from your server's IP thins every result page, because the other engines have to carry the query on their own.
|
| 288 |
|
| 289 |
Diagnose before you change anything. `/status` needs no token and publishes `searches.unresponsiveEngines`, each engine classified `blocked`, `timeout` or `other`, and the server log prints the same names through the always-on `debug` in `server/webSearchService.ts`. See [Debugging Configuration](#debugging-configuration). To see the engine set itself, ask SearXNG directly, with the same parameters the app sends:
|
| 290 |
|
|
|
|
| 384 |
|
| 385 |
None of this reaches MiniSearch's code. The app asks SearXNG for one JSON document and reranks whatever comes back, so nothing in `server/webSearchService.ts` changes when you retune the engines, and the circuit breaker, the retries and the `unresponsive_engines` reporting keep working over the new set.
|
| 386 |
|
| 387 |
+
### Why the image switches Mojeek on
|
| 388 |
+
|
| 389 |
+
Since the SearXNG commit pinned on 2026-11-23, upstream ships the Brave web engine disabled (its result links went through a redirect), which leaves DuckDuckGo and Google CSE as the only general web engines on by default, plus Wikipedia and Wikidata, which added no result in the run below. DuckDuckGo answers a CAPTCHA to many server addresses. On the public instance, in the days before that update, Brave, DuckDuckGo and Google CSE were all blocked at once on 219 of 371 text searches (59%), which sent those searches to the fallback providers. Mojeek runs its own index and is switched on in the bundled overlay. In a run of the image on 2026-11-23 (10 queries, 8 seconds apart, from a residential address), Mojeek returned 10 results on every query, while DuckDuckGo answered a CAPTCHA on 2 of the 10. In a second run of 5 queries, 7 to 9 of Mojeek's results per query came from no other engine. Qwant was tried in the same run and refused the first query with `access denied`, so it stays off.
|
| 390 |
+
|
| 391 |
## Runtime Configuration
|
| 392 |
|
| 393 |
Client-facing configuration (access keys, inference type, internal API settings) is resolved at runtime via the `/api/config` endpoint. The client fetches this endpoint on app initialization, so the published Docker image is fully configurable via environment variables at runtime - no rebuild needed.
|
docs/overview.md
CHANGED
|
@@ -307,6 +307,7 @@ is counted at all (see `docs/page-content.md`):
|
|
| 307 |
| `requested` | number | Nothing; the denominator for the rest |
|
| 308 |
| `read` | number | Nothing; how often the feature contributed anything |
|
| 309 |
| `readRate` | number | Nothing; `read` as a percentage of `requested` |
|
|
|
|
| 310 |
| `averageReadMs` | number | `REQUEST_TIMEOUT_MS`, including the reads that hit it |
|
| 311 |
| `bodiesTruncated` | number | `MAX_RESPONSE_BYTES` |
|
| 312 |
| `excerptKeptRate` | number | `MAX_PAGE_CHARS` and the 0.9 dedup threshold, as the share of pooled passages that survive |
|
|
|
|
| 307 |
| `requested` | number | Nothing; the denominator for the rest |
|
| 308 |
| `read` | number | Nothing; how often the feature contributed anything |
|
| 309 |
| `readRate` | number | Nothing; `read` as a percentage of `requested` |
|
| 310 |
+
| `servedFromSearchExcerpts` | number | Nothing; pages whose text came with the fallback search's results, so no read was made. Outside `requested` |
|
| 311 |
| `averageReadMs` | number | `REQUEST_TIMEOUT_MS`, including the reads that hit it |
|
| 312 |
| `bodiesTruncated` | number | `MAX_RESPONSE_BYTES` |
|
| 313 |
| `excerptKeptRate` | number | `MAX_PAGE_CHARS` and the 0.9 dedup threshold, as the share of pooled passages that survive |
|
docs/page-content.md
CHANGED
|
@@ -38,6 +38,15 @@ and no page is read either way until AI responses are on.
|
|
| 38 |
the same allocation (`client/modules/pageExcerptAllocation.ts`) falls
|
| 39 |
back to running synchronously.
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
The read is started when the text results are in and awaited at the very end of
|
| 42 |
`startTextSearch`, so the AI answer waits for it while the rendered results,
|
| 43 |
the image search, and the history write all carry on.
|
|
@@ -362,6 +371,7 @@ this limit set where it should be", not "who read what":
|
|
| 362 |
| Counter | The question it settles |
|
| 363 |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| 364 |
| `readRate` | Is the feature worth its latency at all |
|
|
|
|
| 365 |
| `averageReadMs` | Is a 6 s deadline generous or stingy |
|
| 366 |
| `skipped.timedOut` | How much is being lost to that deadline |
|
| 367 |
| `skipped.tooLittleText` | Is the 200-character floor discarding real pages, or is the extractor missing their text |
|
|
@@ -380,6 +390,11 @@ from it. The weakest point is an instance nobody else is using, where one search
|
|
| 380 |
moves the numbers on its own; that reveals how many pages were read and how they
|
| 381 |
failed, never which pages or what was asked.
|
| 382 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 383 |
## Failure Behavior
|
| 384 |
|
| 385 |
Every failure degrades to the snippet-only prompt, which is what the answer was
|
|
|
|
| 38 |
the same allocation (`client/modules/pageExcerptAllocation.ts`) falls
|
| 39 |
back to running synchronously.
|
| 40 |
|
| 41 |
+
When SearXNG has failed and the fallback search served the results from
|
| 42 |
+
Parallel, the server already holds query-relevant excerpts for each of them, a
|
| 43 |
+
median of about 2,500 characters against the 400 its snippet keeps.
|
| 44 |
+
`server/searchExcerptStore.ts` keeps that text for five minutes, and
|
| 45 |
+
`fetchPageContents` uses it in place of a read for a URL it holds under the
|
| 46 |
+
same query, so those pages are never requested. The excerpts go through the
|
| 47 |
+
same passage splitting, ranking and selection as a page that was read. Text
|
| 48 |
+
under 200 characters is not used, and that page is read instead.
|
| 49 |
+
|
| 50 |
The read is started when the text results are in and awaited at the very end of
|
| 51 |
`startTextSearch`, so the AI answer waits for it while the rendered results,
|
| 52 |
the image search, and the history write all carry on.
|
|
|
|
| 371 |
| Counter | The question it settles |
|
| 372 |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| 373 |
| `readRate` | Is the feature worth its latency at all |
|
| 374 |
+
| `servedFromSearchExcerpts` | How many reads the fallback's excerpts saved. Kept out of `requested`, so `readRate` still measures the reads that went out |
|
| 375 |
| `averageReadMs` | Is a 6 s deadline generous or stingy |
|
| 376 |
| `skipped.timedOut` | How much is being lost to that deadline |
|
| 377 |
| `skipped.tooLittleText` | Is the 200-character floor discarding real pages, or is the extractor missing their text |
|
|
|
|
| 390 |
moves the numbers on its own; that reveals how many pages were read and how they
|
| 391 |
failed, never which pages or what was asked.
|
| 392 |
|
| 393 |
+
Besides the host breaker, the excerpt store is the one place that holds
|
| 394 |
+
anything from a search: page text, under a SHA-256 of the query and the URL, for five minutes and at most
|
| 395 |
+
500 entries. It keeps no query or URL in clear text, and it answers only a
|
| 396 |
+
caller that sends the same query and URL again, who learns nothing new from it.
|
| 397 |
+
|
| 398 |
## Failure Behavior
|
| 399 |
|
| 400 |
Every failure degrades to the snippet-only prompt, which is what the answer was
|
docs/security.md
CHANGED
|
@@ -95,6 +95,7 @@ The full trust model lives in [`.github/SECURITY.md`](../.github/SECURITY.md) ("
|
|
| 95 |
| `server/searchesSinceLastRestart.ts` | In-memory counters for aggregate search outcomes (text/image search totals, and how often searches came back empty or were fully discarded), plus per-engine failure counts, reported on `/status`; records no query, URL, host, or per-search timestamp, and stores a failure kind classified by `server/webSearchService.ts` rather than SearXNG's reason string |
|
| 96 |
| `server/pageReadsSinceLastRestart.ts` | In-memory aggregate counters for pages read for grounding (outcomes, durations, passage ratios), reported on `/status`; records no query, URL, host, or per-read timestamp |
|
| 97 |
| `server/pageReadHostBreaker.ts` | Per-host circuit breaker for page reads: a host that refused the last three reads is skipped for five minutes, then probed with one read; holds host names in memory only, reset on restart, and reports counts alone |
|
|
|
|
| 98 |
| `server/searchEndpointServerHook.ts` | Proxies text/image search to SearXNG after token verification (via `handleTokenVerification`), and serves fallback text results when SearXNG has failed and `SEARCH_FALLBACK_ENABLED` is on |
|
| 99 |
| `server/fallbackSearchService.ts` | Second text-search source, consulted only after SearXNG has failed: reads `SEARCH_FALLBACK_ENABLED`, `SEARCH_FALLBACK_PROVIDERS` and the per-provider keys at call time, and refuses to start on an unknown provider name or a removed variable; runs the JSON-RPC exchange against `search.parallel.ai` and You.com's MCP endpoint in a random order per search, one after the other until one returns results, under one shared 15-second budget; pauses a provider that answered 429 until its `Retry-After`; and maps the reply into the tuples the SearXNG path produces; records no query |
|
| 100 |
| `server/verifyTokenAndRateLimit.ts` | Verifies the Argon2 token hash and enforces rate limiting (10 requests per 10 seconds, shared by the search, page-content and inference endpoints; a separate 60-per-10-seconds budget for `/thumbnail`) |
|
|
|
|
| 95 |
| `server/searchesSinceLastRestart.ts` | In-memory counters for aggregate search outcomes (text/image search totals, and how often searches came back empty or were fully discarded), plus per-engine failure counts, reported on `/status`; records no query, URL, host, or per-search timestamp, and stores a failure kind classified by `server/webSearchService.ts` rather than SearXNG's reason string |
|
| 96 |
| `server/pageReadsSinceLastRestart.ts` | In-memory aggregate counters for pages read for grounding (outcomes, durations, passage ratios), reported on `/status`; records no query, URL, host, or per-read timestamp |
|
| 97 |
| `server/pageReadHostBreaker.ts` | Per-host circuit breaker for page reads: a host that refused the last three reads is skipped for five minutes, then probed with one read; holds host names in memory only, reset on restart, and reports counts alone |
|
| 98 |
+
| `server/searchExcerptStore.ts` | Holds the excerpts a fallback provider sent with its results for five minutes (at most 500), under a SHA-256 of the query and the URL, so `/page-content` uses them instead of reading those pages; holds no query or URL in clear text |
|
| 99 |
| `server/searchEndpointServerHook.ts` | Proxies text/image search to SearXNG after token verification (via `handleTokenVerification`), and serves fallback text results when SearXNG has failed and `SEARCH_FALLBACK_ENABLED` is on |
|
| 100 |
| `server/fallbackSearchService.ts` | Second text-search source, consulted only after SearXNG has failed: reads `SEARCH_FALLBACK_ENABLED`, `SEARCH_FALLBACK_PROVIDERS` and the per-provider keys at call time, and refuses to start on an unknown provider name or a removed variable; runs the JSON-RPC exchange against `search.parallel.ai` and You.com's MCP endpoint in a random order per search, one after the other until one returns results, under one shared 15-second budget; pauses a provider that answered 429 until its `Retry-After`; and maps the reply into the tuples the SearXNG path produces; records no query |
|
| 101 |
| `server/verifyTokenAndRateLimit.ts` | Verifies the Argon2 token hash and enforces rate limiting (10 requests per 10 seconds, shared by the search, page-content and inference endpoints; a separate 60-per-10-seconds budget for `/thumbnail`) |
|