Skip to content

feat: raw inbox — provider-agnostic message ingestion with triage + promotion lineage - #39

Merged
pyramation merged 1 commit into
mainfrom
feat/raw-inbox
Jul 28, 2026
Merged

feat: raw inbox — provider-agnostic message ingestion with triage + promotion lineage#39
pyramation merged 1 commit into
mainfrom
feat/raw-inbox

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

Adds a purely-additive raw inbox staging layer so messages from any network (email, Twitter/X, LinkedIn, Discord, Slack, SMS, …) can be dumped raw, triaged, and only then promoted into the curated tables — no existing table is modified.

New blueprint packages/provision/src/schemas/inbox.ts (registered after Staging in provision.ts), mirroring the raw_contacts pattern:

  • raw_messages: provider (required) + external_id/external_thread_id, normalized common shape (sender_handle, sender_display_name, recipients jsonb, subject, body_text, sent_at), full provider payload in raw_data jsonb, and triage fields (triage_status default 'pending', triage_score, triage_notes, labels citext[], ingested_at). No SearchUnified nodes — nothing enters the embedding/RAG pipeline until promoted.
  • raw_message_attachments (HasMany, cascade).
  • BelongsTo FKs: sender_contact_id → contacts (identity matched at triage), promoted_email_id → emails, promoted_conversation_id → conversations (promotion lineage; the curated targets auto-embed via their existing triggers).
  • btree indexes on provider, external_id, external_thread_id, triage_status, sent_at.

Everything else is regenerated, not hand-edited: exported pgpm packages (packages/agentic-db, packages/agentic-db-services — service IDs churn because export ran from a freshly provisioned DB), sdk/schemas/agentic-db.graphql, SDK/CLI (RawMessage, RawMessageAttachment models + commands), and skills references. README gains a Raw inbox bullet; table count 95 → 97.

Verified locally: RLS-stripped export deploys clean to a fresh DB (21 cols on raw_messages, 0 policies); suites green — agentic-db 21/21, orm 36/36, rag 10/10, documents-loader 74/74, cli-e2e 16/16.

Link to Devin session: https://app.devin.ai/sessions/bd82f3b68a6348b6b3527a6a9c399f15
Requested by: @pyramation

@pyramation pyramation self-assigned this Jul 28, 2026
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@pyramation
pyramation merged commit be5bc51 into main Jul 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant