Repository navigation
Evidence Lab v1.6.4 — Team templates for Brief, citation check, summary editing and a hardened pipeline
Evidence Lab v1.6.4 is a team release for Brief. Templates now carry the research prompt, voice & tone profile and length for each heading and for the brief as a whole, and templates and voice & tone profiles can be shared with people and groups, so a team lead can give a team one complete, consistent starting point. Administrators also get a citation check that fact-checks a finished brief, sentence by sentence, against the sources it cites, and an All Briefs view of every brief in the system, and they can now edit and regenerate document summaries in the Documents Library, one at a time or many in a queue, with a new single prompt summary mode alongside map reduce, and export a page of the Documents Library to Excel. Top-level headings are now written as short introductions to their sub-headings, and two saving bugs are fixed: a section could finish on screen but not be saved, and opening then closing a brief could duplicate it. Under the hood the API stops serialising itself: a slow request no longer holds the event loop, so the rest of the application keeps responding while it runs. The pipeline is hardened against the three failure modes that stopped a 13,000-document refresh on a 48 GB machine: it waits as long as a throttled model provider asks, stops itself before a full data disk turns every remaining document into a failure, and kills a parser worker that balloons past a memory cap instead of letting one document take the machine down; scanned reports are now actually OCR'd rather than slipping past the fallback; and in the Documents Library, sorting by a column works again, a wide table shows scroll chevrons, and the list loads once instead of twice. Evaluation runs now start from the search page's own defaults and record the configuration they ran with, so a run reproduces what users see and two runs can be compared, and Heatmapper query cells on a Google Vertex combo load again instead of failing on one oversized reranking request.
Brief
- Templates keep prompts, not just headings. Each heading can carry a research prompt (the guidance typed in a section's Research panel), a voice & tone profile and a length target, and a template keeps a whole-brief prompt, default voice and default length. Save as Template carries all of these from the brief, behind an Include prompts and settings switch; the template editor gains a Prompt control per heading and templates can now be edited; starting a brief from a template fills in the brief prompt, voice and length in the New brief dialog and starts each section with its heading's prompt, voice and length (#504)
- Share templates and voice & tone profiles with a person (by email) or a group (by name), as briefs are shared. Sharing is use-only and live: recipients find them in their Templates and Voice & tone tabs, marked Shared by the owner, and in every picker; they can use them or Copy them into their own editable copy, while only the owner edits, deletes or shares the original, and owner edits reach recipients (#504)
- Voices go with a shared template. Sharing a template also shares the voice & tone profiles it uses that its owner owns, with the same people and groups, and a voice added to a shared template later reaches them too. Voices owned by someone else are not passed on, and stopping a template share leaves its voices shared (#504)
- A brief, section or template that names a voice the user can no longer see (unshared or deleted) shows it as Unavailable voice & tone profile, and the Research panel says the section is written without a voice, instead of dropping it silently (#504)
- Fixed a brief's whole-brief prompt not being saved: it applied to research only until the brief was reopened, and could carry over into the next brief. It is now saved with the brief (#504)
- Fixed the Share dialog's suggestions being clipped at the dialog's edge, so a group lower in the list could be seen but not picked. Choosing a suggestion now shares with it straight away, and the arrow keys and Enter pick one (#504)
- Brief Central cards share one layout: a details line, a full-width Open Brief or Use Template, and equal-width Edit / Share / Copy / Delete beneath (Delete replaces the ×) (#504)
- All Briefs (Admin). Administrators get a new Brief Central tab listing every brief in the system with its owner's name and email, and a search box that filters by brief name or user. Open Brief opens any brief read-only and Copy puts a copy in the administrator's own Saved Briefs. Administrators still cannot edit, share or delete other people's briefs, and opening or copying a brief they neither own nor were sent is recorded in the audit log (
brief_admin_viewed,brief_admin_copied) (#509) - Top-level headings are written as introductions. A heading with sub-headings is now written as one short introduction to them (about 120 words by default, never longer than the brief's own length): no headings of its own, and none of the findings that belong under its sub-headings. A whole-brief run writes the sub-sections first so the introduction can point to them. An introduction that still comes back with headings is researched again once; if it still has them it is kept, with a warning on the section and a note in its Log. This applies to Research, AI Regenerate, AI Get Updates and AI Edit (#506)
- Fixed a researched section sometimes showing on screen but not being saved: a save requested while the saved-brief list was refreshing, or behind a failed save, was dropped (#507)
- Fixed opening a brief and closing it again sometimes leaving a duplicate in Saved Briefs, or writing one brief's content into another opened straight after. Every save now goes to its own brief, and opening a brief no longer saves it when nothing has changed (#508)
- Copy a brief shared with you. Shared with me cards gain Copy, which puts a private, editable copy in your own Saved Briefs; anyone who can open a brief (its owner, a person or group it is shared with, or an administrator) can copy it. Shared with me and All Briefs (Admin) cards now share one layout: Open Brief then Copy, with only the details line differing (#525)
- Choose where Word export links point. Under the References grouping checkboxes, Word links to offers Source document (the default: each document's own PDF or report page) or Evidence Lab (its copy in Evidence Lab); both open at the cited page. A document with no address of its own now links to its copy in Evidence Lab, instead of a link that opened the Search page; this also applies to the search results export (#526)
Document summaries
- Edit or regenerate a summary in the app. Clicking a summary in the Documents Library opens it; administrators get Edit and Regenerate with AI, choosing the mode, which sections' text to summarise (each with its size) and the prompt. The new summary opens for review and nothing is saved until Save (#523)
- Regenerate many at once. Tick documents (ticks are kept across pages) and Regenerate summaries (N): the documents are queued and run one at a time, each saved as soon as it is ready, with per-document progress, failures listed with their reason, and Stop (#523)
- Single prompt mode.
summarize.modecan bemap_reduce(the default, as before) orsingle_prompt, which sends all the chosen text to the model in one call. The prompt is counted in tokens by the model first and stops with both numbers if it is larger thansummarize.single_prompt_context_window(default 1,048,576, Gemini 2.5 Flash's input limit); models that cannot count their tokens exactly (Hugging Face) cannot be used for it. A whole 1.7M-character report measured 546k Gemini tokens and summarised in one call (#523) - Provenance. Every summary shows how, when and by whom it was made, for example Written by the pipeline · … or Regenerated with AI (single prompt) by a.person@example.org · …, in the table and the open summary (#523)
- Team defaults for the mode, sections and prompt, on a new Document Summaries tab in Group Settings; they apply only to summaries made in the app, never to the pipeline (#523)
- Saves are recorded in the audit log (
document_summary_updated), and reprocessing keeps a summary set in the app unless you choose to replace it (#523) - The summary prompt is now its own file,
prompts/summary_instructions.j2, shared by the pipeline and the app; the pipeline's prompts are unchanged byte for byte (#523)
Admin
- Choose how many documents a page shows in the Documents Library: Per page beside the page buttons offers 5, 10 (the default), 50 or 100, and is kept in the link (
page_size). Changing it reloads the table even on the first page (#524) - Export to Excel in the Documents Library exports the page on screen, in its sort and filter order, so Per page decides how many rows. It holds what the table only links to or previews: the whole AI summary, the table of contents, the full document record as JSON, and a column per tag taxonomy with each tag's code, name and the model's reason. Status logs, the processing timeline and chunks are left out, and cells are cut at Excel's 32,767-character limit. The table now lines up with the Documents Library heading (#531)
- The UI starts on the model combo
config.jsonmarks as the default ("default": trueinui_model_combos), as the API, MCP and A2A already did; before, it started on whichever combo came first in the file. With no combo marked, it still starts on the first (#530) - Group Settings is split into tabs (Search Settings, Content Settings, Search AI Summary, Brief, Document Summaries, Features & Tabs, Appearance) instead of one long page; Save Settings saves every tab. The search-results "AI Summary" section is renamed Search AI Summary (#523)
- Sorting the Documents Library works again. Clicking a column header updated the sort state and nothing happened, because the hook that reloads the list did not count the sort field or direction among its inputs. A new ordering now reloads from page 1, as a new filter does (#540)
- Scroll chevrons on the Documents Library table. The table is 2,180 px wide with no cue that it scrolls sideways: a right chevron now sits at the vertical middle of the visible table whenever it overflows, a left one appears once you have scrolled, each click moves 80% of the visible width, and both disappear when there is nothing further that way. They are real buttons in the brand colours, so they work from the keyboard (#540)
- The Documents Library loaded its list twice on every visit (three times in development): the title-search debounce fired 500 ms after mount even though nothing had been typed. It now fires only when the search text actually changes (#541)
Evaluation
-
Added a Brief citation check to the admin Evaluation Harness, on a new Testing (Brief) tab. For every cited sentence of a brief, an LLM judge (the summarisation model of the selected combo) sees the sentence and the exact excerpts it cites and rules supported, partially supported, unsupported or cannot assess, quoting the words it relied on; each quote is then verified against the excerpt, and anything not fully supported is flagged. The result page has summary tiles, a filterable passages table with drill-down to the judge's reasoning and the cited excerpts, citation links into the document preview, and Download Excel with the review workbook. This replaces the citation fidelity notebook for reviewers (#503)
-
In the citation check's results, the section filter and passage search sit at the same height as the result toggles, each passage row shows a caret and a tooltip to say it opens, and a cited source's title is left-aligned like the excerpt beneath it (#529)
-
Administrators can check every brief in Admin → Testing (Brief), not only their own and ones shared with them; the scope toggle becomes All / Mine / Shared with me / Other users, and the Owner column identifies whose brief it is (#522)
-
Evaluation runs start from the search page's defaults. AI-summary evaluations could fail cases that pass on the Search page for the same query: the harness started from the bare
/searchroute defaults (dense weight 0.5, no minimum chunk size, no field boosts, the combo's temperature) while the UI starts from its own defaults before applying a group's settings, and the combo'srerank_model_page_sizewas not carried into the run. A backend twin of the frontend defaults now sits under every run (system defaults, then combo, then group, then the case's own parameters), a test parses the TypeScript literal so the two cannot drift, and the rerank cap is applied. Pass rates of existing experiments will shift (#533) -
A reranker outage is a warning, not a content failure. When the Vertex reranker was transiently unavailable the search fell back to the unranked order with only a log line, so a short outage read as consecutive failures; the fallback is now recorded as a warning on the case, shown in the row and the expanded case, and the case is still judged (#533)
-
Every run records its configuration. Each run stores the resolved models, group and settings it executed with (
test_runs.config); the run card shows a one-line headline (combo · group · summary model · reranker) and how many settings changed since the previous run, and expands to list everything grouped into Models, Group, Search and Summary with the changes highlighted. Older runs show "Configuration not recorded" (#533)
API & Performance
- Heatmapper query cells load again on Google Vertex. A query-mode cell is the largest request the app makes (only the column filter,
limit=1000, 5,000 chunks with wide search) and the production Google Vertex combo sets norerank_model_page_size, so every candidate went to the Vertex Ranking API in one request, which Google rejected, and the grid reported "N of M grid cells failed to load". The shared Vertex reranker now scores documents in slices ofVERTEX_RERANK_BATCH_SIZE(200 by default; the API's ceiling is 1,000), never sends a record with empty content, and logs a rejected batch's size before raising. Up to 200 candidates the request is unchanged, so the Search tab, Assistant, Brief, MCP and A2A send what they sent before (#534) - The API no longer stalls every request behind a slow one. It runs a single uvicorn worker, and twelve routes performed their Postgres and Qdrant work directly on the event loop, so one expensive request held the whole process: with eight heavy requests in flight a trivial request took about 4 seconds and only one completed at all; it now takes about 125 ms and the API keeps serving throughout. Routes with nothing to await are declared
defso FastAPI runs them in its threadpool, the rest hand their blocking section torun_in_threadpool(), and a test fails the build if anasyncroute goes back to calling a synchronous client inline (#527) - Serving a PDF streams it instead of reading the whole file into memory on the event loop, and a missing file no longer reports the server path it looked in (#527)
- The Postgres connection pool is now thread-safe and sized for concurrency. It used psycopg2's
SimpleConnectionPool, documented as unusable across threads, fixed at one kept connection and five in total — which both capped concurrent queries at five and closed every returned connection past the first, reconnecting per request under load. It is now aThreadedConnectionPoolsized byPOSTGRES_POOL_MIN/POSTGRES_POOL_MAX(#527) - A hosted reranker no longer runs one search at a time. The limit that protects local reranking — which loads a model into the API process — also covered the Azure Foundry and Google Vertex calls, which are ordinary HTTP requests, so deployments reranking remotely served reranked searches strictly one after another. Hosted rerankers now have their own limit,
MAX_CONCURRENT_REMOTE_RERANKS(#527) - Fixed
docker-compose.ymlpinningMAX_CONCURRENT_SEARCHESto the old default of 2. A composeenvironment:entry overridesenv_file, so the pinned value reached every container and changing the default in the application had no effect for anyone running through compose. The entry is removed rather than updated — the service already reads.env— so the application holds the only copy of the default, and tests now fail if the application,.env.exampleand a compose file disagree about any of these settings (#528) MAX_CONCURRENT_SEARCHESnow defaults to 8 rather than 2, the async database pool is sized from the environment, andPRELOAD_RERANK_MODELlets a deployment that reranks through a hosted service stop holding a local reranker in memory for the life of the process (#527)
Pipeline
- A throttled model call now waits as long as the provider asks. The LLM retry wrapper allowed 3 attempts with 1 s then 2 s of backoff — about three seconds of patience — and ignored the
Retry-Afterheader that Azure sends with HTTP 429, so a transient throttle became a permanently failed document: on one run 76% of calls were throttled and 0 of 44 documents completed. It now honoursRetry-After(andretry-after-ms), backs off exponentially with jitter so many workers throttled at once do not re-collide, and allows 5 attempts by default;LLM_MAX_RETRIES,LLM_RETRY_BASE_DELAY_SECONDSandLLM_RETRY_MAX_DELAY_SECONDSraise the budget for bulk ingestion, where a throttled call should slow the run down rather than drop a document (#535) - One Postgres pool per process.
PostgresClientis built in six places inside one pipeline worker and each built its own pool, so the idle floor was six timesPOSTGRES_POOL_MINper process: a--workers 7run held 64–68 connections, exhausted a stockmax_connections=100server and failed documents withtoo many clients already. Pools are now shared per process and data source (keyed by pid, so a forked Celery child never reuses its parent's sockets); the same run holds 32 (#536) - The run stops itself when the data disk fills. Before, every remaining document failed one by one with
No space left on deviceand was markedparse_failedas if the document were bad — 30 were, before anyone noticed the disk was at 100%. Free space at the data directory is now checked before the workers start and after every document, and the run stops belowPIPELINE_MIN_FREE_DISK_MB(5 GB by default); a worker that actually hits ENOSPC stops it immediately. The CLI exits with status 2 and names the path and the recovery command (#537) - A worker that balloons past a memory cap is killed and its document failed, and the run continues. Measured: one 237-page PDF drove a worker from ~5 GB to 42 GB inside the parser, silent in the log, while an ordinary 190-page document peaked at 5.8 GB; seven such workers kernel-panicked a 48 GB machine twice in a day. The orchestrator now measures every worker every 5 s using the figure Activity Monitor shows (
phys_footprinton macOS, where RSS understates a ballooning worker 17-fold; RSS on Linux), and abovePIPELINE_MAX_WORKER_MEMORY_MB(12 GB by default) fails that document with the measured figure in the reason and kills the worker. Each worker's process title shows the document it is on, sopstells you what a large worker is doing (#539) - Scanned reports are now actually OCR'd. The OCR fallback retried a parse only when it yielded fewer than 10 words in total; a scan with a text cover page parses to a few hundred words across many pages, cleared that floor and summarised to nothing (measured: 80 pages → 208 words). It now also retries below
ocr_fallback_min_words_per_page(25 by default; real documents run to hundreds per page). On the same batch, 99 of 115 retries produced real text, 74 of them over 5,000 words. Also fixed: the config dict handed to a parse subprocess carriedocr_fallbackbut the constructor did not accept it, so with the fallback on every subprocess parse would have died on construction (#543)
Models
- The Hugging Face models move to Qwen3 235B. The Huggingface combo, the World Bank and UN Mandates data sources and the demo's Hugging Face option now use
Qwen/Qwen3-235B-A22B-Instruct-2507through the scaleway provider, in place of Qwen2.5-72B. novita stopped serving Qwen2.5-72B, and the one remaining provider the app can reach allowed only two requests at once and, in the demo, took 1 to 4 minutes per summary call and then failed to return a readable response. On scaleway, Qwen3 235B answered a short request in under a second and handled 12 requests at once (#532) - Fixed the
inference_providerset on a Hugging Face model being ignored, so Hugging Face chose the provider itself and moved to another when the configured one stopped serving the model. The configured provider is now always used, and a provider that stops serving the model fails with its own error (#532) - The UN Humanitarian Evaluation Reports data source summarises and tags with
gpt-4.1-minion Azure Foundry, the model of the default Azure Foundry combo (#532) - The demo makes the combo for the provider it set up the default, so search, the research assistant, MCP and A2A all use a provider the demo user has keys for (#532)
Documentation
- A new admin page, Performance & Scaling, covering the settings that control how much work the API does at once, the connection pools and the reranker preload: what each one defaults to, how to budget pool sizes against the database server's
max_connections, how to tell a stalled API from a merely busy one, and why adding uvicorn workers multiplies every rate limit rather than speeding things up (#528) - The Brief guide covers prompts in templates, sharing templates and voices, the signed-in New brief dialog and the section and whole-brief AI tools (AI Edit, AI Get Updates, the Log with Keep/Reject Edits, AI Regenerate All, Stop). The docs viewer now gives level-4 headings ids, so in-page links to them resolve (#504)
- The Brief guide explains introductions and their settings (#506, #510) and the All Briefs tab, and the user administration guide covers administrators' access to every brief and its audit events (#509)
- The Brief guide covers copying shared briefs (#525) and where Word links point (#526); the system monitoring page covers the page size (#524) and Excel export (#531)
- The pipeline configuration page explains how to choose the combo users start on, and that hiding the Models picker is a branding change rather than a setting (#530)
- The pipeline configuration page explains
inference_provider, and the architecture diagrams name Qwen3 235B (#532) - A new admin page, Document Summaries, with screenshots; the pipeline configuration, group settings, system monitoring and README pages cover summary modes, the tabs and the new settings (#523)
- The Performance & Scaling page gains LLM rate limits and retries (the retry variables, the bulk-ingestion profile, and why retries cannot rescue a run whose
--workers×llm_workersexceeds the deployment's quota) and a connection budget that counts processes: a--workers Nrun is N + 1 processes holding pools alongside the API (#535, #536) - The pipeline configuration page covers stopping when the data disk fills, capping a worker's memory, the per-page OCR threshold, and the difference between the
ocr_fallbacksetting and the--ocr-fallbackflag, whose collector also re-queues every failed document (#537, #539, #543) - The Evaluation Harness page describes the defaults a run starts from, the reranker warning and the run configuration panel (#533); the Performance & Scaling page and
.env.examplecoverVERTEX_RERANK_BATCH_SIZE(#534)
Dependencies
- CI uses
actions/upload-artifactv7 for the coverage and SBOM uploads (#521) - CI's integration tests run the pipeline on Azure Foundry instead of a shared Hugging Face provider that was refusing parallel requests, and Demo E2E now runs on both the Azure and the Hugging Face demo options (#532)
- fastembed 0.8.1 (#515), watchdog 4.0.2 (#512), types-requests 2.33.0 (#516), yaml 2.9.1 (#520), @playwright/test 1.63.0 (#519), @typescript-eslint/parser 8.70.1 (#518), @testing-library/dom 10.4.2 (#517), @types/node 25.9.8 (#514)
torch,torchvision,numpyandrequests-toolbelthad no version inrequirements.txt, so every fresh install took whatever was newest (a host venv had drifted five minor versions of torch from the image). They are pinned to what the image resolves —torch==2.14.1,torchvision==0.29.1,numpy==2.3.5,requests-toolbelt==1.0.0— andpsutil==7.2.2is pinned now that the pipeline depends on it directly (#538, #539)- langchain-google-vertexai 3.2.4 or later (#513)
Upgrade Notes
- Database migrations apply automatically on deploy. This release adds
0034_add_brief_citation_checks(the citation check's results) and0035_share_templates_voices(two share tables, and prompt, voice and length columns onbrief_templates). Two further migrations both revise0035:0036_add_test_run_config(#533) and0036_convert_brief_citations;0037_merge_heads_1_6_4joins them into one head, since with two headsalembic upgrade headrefused to run and the API container could not start. A unit test now fails the build if the migration graph ever has more than one head again. - New optional
config.jsonsettingapplication.brief.introductions, withtarget_words(the default introduction length) andheading_retries(how many times an introduction that comes back with headings is re-run); see the repositoryconfig.json. Deployments that keep their ownconfig.json(for example the WFP config repository) need no change: if the setting or either value is left out, 120 words and 1 re-run are used. A value that is present but not a whole number in range stops the UI at startup with an error naming it (#506, #510) config.json: Hugging Face model change. Theqwen2.5-72b-instructentry insupported_llmsis replaced byqwen3-235b-instruct(Qwen/Qwen3-235B-A22B-Instruct-2507, providerscaleway). A deployment that keeps its ownconfig.jsonand uses the Hugging Face combo or Qwen2.5-72B in a data source should make the same change: novita no longer serves Qwen2.5-72B, and withinference_providernow honoured a dead provider fails rather than being swapped silently. Deployments on Azure Foundry or Google Vertex are unaffected (#532)- New optional
summarizesettings per data source:mode(map_reduceby default),single_prompt_context_window(1,048,576 tokens by default) andsection_types(every section type by default). Existing configs need no change (#523) - Document summary changes need no migration: team defaults live in the groups' existing
search_settingsand the summary's provenance in each document's existingsys_data(#523) - New optional environment variables, all with defaults that preserve current behaviour — see
.env.example:POSTGRES_POOL_MIN(4) andPOSTGRES_POOL_MAX(16) — the synchronous Postgres pool, per data source. It raises rather than queueing when empty, soPOSTGRES_POOL_MAXmust cover the request concurrency the API serves, andPOSTGRES_POOL_MAXx (data sources in use) must stay under the server'smax_connections.AUTH_DB_POOL_SIZE(10) andAUTH_DB_MAX_OVERFLOW(20) — the async database pool, which queues rather than failing.MAX_CONCURRENT_REMOTE_RERANKS(8) — concurrent hosted-reranker calls, separate from the local limit.PRELOAD_RERANK_MODEL(true) — set it tofalsewhere reranking is done by a hosted service, so a local reranker is not held in memory for the life of the process.
- Changed default:
MAX_CONCURRENT_SEARCHESis now 8, previously 2 (and.env.examplepreviously suggested 10; all three now agree). Lower it for deployments that run embedding or reranking models inside the API process. - Do not raise the uvicorn worker count to go faster. Both rate limiters keep their counters in process memory, so N workers multiply every configured limit by N, including the authentication brute-force limit. Shared storage for that state is a prerequisite (#527).
- More new optional environment variables, all with defaults — see
.env.example:LLM_MAX_RETRIES(5),LLM_RETRY_BASE_DELAY_SECONDS(1),LLM_RETRY_MAX_DELAY_SECONDS(30) — the LLM retry budget; a 429'sRetry-Afteris always honoured, clamped to the max delay. Raise them for bulk ingestion (#535)PIPELINE_MIN_FREE_DISK_MB(5120) — the run stops below this much free space at the data directory;0turns the floor off (#537)PIPELINE_MAX_WORKER_MEMORY_MB(12288) — a pipeline worker above this is killed and its document failed;0turns the cap off; parallel runs only (#539)VERTEX_RERANK_BATCH_SIZE(200) — how many documents one Google Vertex ranking request carries; a value that is not a whole number from 1 to 1000 stops the API at start (#534)
POSTGRES_POOL_MIN/POSTGRES_POOL_MAXnow mean what they say. There is one pool per process per data source, so the budget isPOSTGRES_POOL_MAX× data sources × processes talking to the database; a--workers Npipeline run is N + 1 processes beside the API. Previously each client object held its own pool, so the real floor was several timesPOSTGRES_POOL_MIN(#536)- New optional
pipeline.parsesettingocr_fallback_min_words_per_page(25). Withocr_fallback, a parse under this many words per page is retried with OCR;0keeps only the absolute 10-word floor (#543) - After a run that stopped on a full disk or killed a worker for memory, re-queue the interrupted documents with
scripts/pipeline/reset_failed_statuses.py --data-source <name> --include-stuck(#537, #539) - No new Python or npm dependencies (the versions above are updates and
psutilwas already installed transitively). Rebuild theapi,pipelineanduiimages. - Existing templates keep working and simply have no prompts; open one with Edit to add them.