Skip to content

Feature: an email's body is searchable nowhere #3015

Closed

Description

@Israeltheminer

An email's body reaches no index. A conversation is searchable by subject only, and message content is searchable nowhere.

Why it matters

The context that explains an attachment usually lives in the covering email, not in the attachment. A CV named for its author says nothing about the role it was sent for; the email saying "applying for the field sales agent role" does. Today that sentence is invisible to every retrieval leg, so a question about what came in for a role can only match a document whose own text happens to use those words.

Observed on a live deployment: two CVs in the corpus, one findable by role because its own text repeats the job title, the other not findable at all despite being indexed and in scope.

Status quo

  • convex/conversations/search_for_chat.ts matches textFields: ['subject'], with its own comment noting message bodies are not searched.
  • No path indexes message bodies into the corpus. Only Document Hub files and, since feat(platform): index an emailed attachment for its conversation #3012, mail attachments.
  • indexDocument already accepts text directly, so a body needs no blob.
  • lib/knowledge/html-to-text.ts exists and should be reused rather than duplicated.

The obstacle

Every corpus ref resolves through fileMetadata.by_storageId in filterRetrievableRagFileIds. A message has no fileMetadata row, so a message hit would be denied outright. Indexing bodies therefore needs a new ref class and a new branch in that gate, deciding a message by its conversation's live assignment — the same predicate attachments use.

Shape

  1. Message-scoped corpus refs: the ref format and the gate branch, with nothing indexed. Mechanism first, no behaviour change — the same sequencing feat(platform): scope a corpus row to its conversation #3011 used before feat(platform): index an emailed attachment for its conversation #3012.
  2. Index bodies on ingest, together with the erasure cascade. governance/erasure.ts counts ragDocumentsRemoved and has a fileMetadata category; a new corpus class without a cascade means an erasure request leaves message text behind, so the two must land together.

Constraints

Open questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featpriority: highservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions