Repository navigation
v3.25.0
This release contains huge changes under Gramps Web API's hood which make it slimmer, faster, and more secure.
At the core of the changes is the decision to remove a feature: semantic search, introduced almost exactly 2 years ago in v2.5, powered the first incarnation of the Gramps Web AI assistant, allowing it to search for Gramps objects by the meaning of a query, instead of a matching search term. But it also required significantly more server resources and increased the size of our Docker images. A re-evaluation of this feature revealed that the improvements to the AI assistant's architecture and of the underlying large language models allow dropping semantic search without making the AI assistant less powerful.
The Docker image is now less than half its former size, about 750 MB to download instead of 1.95 GB. Besides PyTorch and the embedding model, it no longer contains compilers and build tools, and only installs the AI providers Gramps Web supports. With the default 8 web workers and 2 Celery workers, an idle instance now uses about 0.6 GB of memory, down from 1.8 GB in 3.24, or 5.2 GB with semantic search. Part of this is because the web workers now share memory. Under real traffic the saving is smaller, but on a production instance with 4 workers it was still about 0.8 GB.
In addition to slimming down Gramps Web API, removing semantic search allowed us to rebuild the full-text search feature (which is still available!) from scratch, without depending on an external library. The new implementation is more efficient, with even the slowest queries taking about 0.2 seconds on a tree with 110,000 objects. It also closes some gaps in which, for instance, a family could be found by the name of a private member. It was tested extensively against a simple brute-force search on both SQLite and PostgreSQL.
Similarly, what users without permission to view private records, such as guests, can see was previously determined by a privacy filter taken over from Gramps desktop, which was made for exports rather than for a web server. It is now replaced by a new access layer written for Gramps Web, which is simpler to test, stricter in a few corner cases, and 2–7 times faster for guests on large trees. Together with the new search index, it lays the groundwork for finer-grained permissions in the future.
With 39 pull requests by 6 contributors, this is one of our biggest releases yet. A huge thank you to everyone who helped make it happen! 🎉
Search
- New search index. "birth" no longer matches every person, and "microfilm" finds
scanned_microfilm.png(#1089). - Types in your language. Standard types are found by their translated names, so "Taufe" finds baptisms in the German interface (#1128).
- Semantic search is removed (#1088).
New features
- Deleting in the background. Deleting many objects by handle can run as a background task, as a first step towards bulk operations on list views (#1131).
- AI assistant. The assistant answers only from the tree instead of from general knowledge, and links to missing or private objects in its answers are replaced by their text. The new option
LLM_MAX_OUTPUT_TOKENSlimits the length of a response, for model servers without a limit of their own (#1094).
Performance
- Filtering lists takes seconds instead of minutes on large trees (#1107)
- Lists are sorted and paged in SQL, making the people and events lists about 4–7 times faster on large trees (#1110)
- Faster queries for guests, by @dsblank (#1113)
- The web workers share the app's memory (gunicorn
--preload) (#1126) - Smaller base image (#1123) with only the supported AI providers (#1124)
- Task progress is kept in the result backend instead of the user database, which makes tasks much faster on slow disks, by @jon99nelson-svg (#1118)
- Faster undo history on large databases (#1090, #1093)
Security and privacy
- Owners can no longer modify or delete users with a higher role, such as the site admin (#1132)
- Changing a password or disabling a user ends that user's other sessions, by @jon99nelson-svg (#1129)
- Registration and password changes are refused while local authentication is disabled, by @giang17 (#1103)
- Media archives only contain files inside the media folder (#1111)
- Estimates of whether a person is probably alive no longer use private records for guests (#1101)
- New access layer for users without permission to view private records (#1107)
Fixes and improvements
- Failed imports report the reason, and GEDCOM 7 files are detected reliably (#1120)
- Cousins by birth are no longer reported as step-cousins in trees with heavy pedigree collapse, by @dsblank (#1127)
- The anniversary calendar feed handles living people and recurring events correctly, by @elig-45 (#1086)
- Fixed the DNA match side when the person is an ancestor of the match, by @pcc0x (#1100), and DNA match ancestor profiles are returned as a flat list (#1102)
- Report options are validated correctly for users who can't view private records, by @pcc0x (#1099)
- 404 or 422 instead of 500 for private people and media files (#1084, #1122 by @jon99nelson-svg)
- Addon filter rules are translated, and filter rules from plugins are always available, by @giang17 (#1081, #1092)
- Compressed frontend files are cached by the browser, by @giang17 (#1121)
- The stored full name is kept when the OpenID Connect provider sends no name (#1091)
- Undo history is only written when a transaction is committed (#1095)
- Check & repair no longer crashes on a stray key (#1085)
- Thumbnails work for TIFFs whose XMP metadata is not stored as bytes (#1114)
- Gunicorn receives SIGTERM and shuts down cleanly (#1098), and database connections are closed even if closing fails (#1117), by @jon99nelson-svg
Notes for administrators
With the standard Docker setup, no action is needed. The user database is migrated on start, and each tree's search index is rebuilt in the background the first time it is opened. Until the rebuild is done, search results may be incomplete.
You only need to act in these cases:
- Custom entrypoint: run
python3 -m gramps_webapi --config <config> user migrate(#1129). - PostgreSQL older than 12: upgrade it, as the search index needs PostgreSQL 12 or newer (#1089).
- Cohere, Hugging Face or xAI models: switch to another provider. Hugging Face models remain usable through its OpenAI-compatible endpoint (#1124).
Optional:
- Remove
VECTOR_EMBEDDING_MODEL,VECTOR_EMBEDDING_BASE_URLandVECTOR_EMBEDDING_API_KEYfrom your configuration, as they are ignored (#1088). - To free disk space on SQLite, delete
search_index.dbbefore upgrading, as it is rebuilt anyway. The unusedsemantic_index_metadatatable can also be dropped (#1088). - If you override the gunicorn command, add
--preloadto save memory (#1126).
Changes for API clients
- Search. The
semanticparameter of the search endpoints is accepted but ignored (#1088). - Query endpoint. Selected values have their proper types on SQL backends:
privateistrue/falseinstead of1/0, and on PostgreSQL numbers and booleans are no longer strings (#1113). - Password change. Changing one's own password returns a new token pair with status 201, and refreshing a token of an ended session returns 403 (#1129).
- Lists without a
sortparameter are sorted by Gramps ID (#1107).
New Contributors
Full Changelog: v3.24.0...v3.25.0