🐾 feat(library): add 'email' library type #4

Merged
r merged 1 commits from feat/email-library-type into main 2026-07-12 12:20:49 +00:00
Owner

Second companion to the Kairos mail-sync work (with #3, the bucket registry). Kairos will provision a per-user app-managed (workspace) library for synced mail via POST /library/api/workspaces/, and none of the existing types fit correspondence.

  • content_types.py: new email entry in LIBRARY_TYPE_DEFAULTS — entry-level chunking mirroring journal (one message ≈ one entry; 512/32), with embedding/reranker instructions tuned for correspondents, dates, and requests/commitments, and an LLM context prompt that flags quoted-reply text as earlier context rather than the sender's own words.
  • models.py: email added to the Library.library_type neomodel choices.
  • api/serializers.py: email added to LIBRARY_TYPE_CHOICES (workspace create + search filter + library serializer).
  • Tests: EXPECTED_TYPES registry updated; library.tests.test_content_types 24/24 green (run against a sqlite shim — the dev Postgres role here can't create test databases).

forms.py and load_library_types derive from the registry, so no changes there; the compose init sidecar re-runs the seeder on deploy, which picks up the new type automatically.

Independent of #3 — the two merge in any order.

🤖 Generated with Claude Code

Second companion to the Kairos mail-sync work (with #3, the bucket registry). Kairos will provision a per-user app-managed (workspace) library for synced mail via `POST /library/api/workspaces/`, and none of the existing types fit correspondence. - **`content_types.py`**: new `email` entry in `LIBRARY_TYPE_DEFAULTS` — entry-level chunking mirroring `journal` (one message ≈ one entry; 512/32), with embedding/reranker instructions tuned for correspondents, dates, and requests/commitments, and an LLM context prompt that flags quoted-reply text as earlier context rather than the sender's own words. - **`models.py`**: `email` added to the `Library.library_type` neomodel choices. - **`api/serializers.py`**: `email` added to `LIBRARY_TYPE_CHOICES` (workspace create + search filter + library serializer). - **Tests**: `EXPECTED_TYPES` registry updated; `library.tests.test_content_types` 24/24 green (run against a sqlite shim — the dev Postgres role here can't create test databases). `forms.py` and `load_library_types` derive from the registry, so no changes there; the compose `init` sidecar re-runs the seeder on deploy, which picks up the new type automatically. Independent of #3 — the two merge in any order. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
r added 1 commit 2026-07-12 12:03:43 +00:00
Kairos is about to provision per-user app-managed (workspace) libraries for
synced mail, and none of the existing types fit correspondence. New entry in
LIBRARY_TYPE_DEFAULTS mirrors journal's entry-level chunking (one message ≈
one entry) with instructions tuned for email: correspondents, dates,
requests/commitments, and quoted-reply context. Registered in the Library
node choices and the API serializer choice list; forms and
load_library_types derive from the registry, and the compose init sidecar
re-runs the seeder on deploy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
r merged commit 3ae5adebed into main 2026-07-12 12:20:49 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: r/mnemosyne#4