Realtime Channel Message Indexing
Context
The channel-message-ingest Inngest function exists and indexes messages to Typesense’s channel_messages collection. The channel-message-classify function follows up with topic/urgency classification. But nobody emits channel/message.received events, so the pipeline never fires.
- Slack messages enter via the gateway daemon’s bot connection → processed as gateway prompts, never indexed
- Front emails enter via webhook →
front/message.received→front-notify.ts→ gateway notification, never indexed - The
slack_messagesTypesense collection has 265 docs from a one-time backfill;channel_messagescollection doesn’t exist yet - The gateway context gathering (ADR-0235) queries these collections but they’re stale/empty
Decision
Wire both realtime feeds to emit channel/message.received Inngest events so messages are indexed as they flow in.
Slack Path
In packages/gateway/src/channels/slack.ts, after processing each message, fire channel/message.received via HTTP POST to the Inngest event API. Includes: channelType=slack, channelId, channelName, userId, userName, text, timestamp.
Front Path
Add a new Inngest function front-message-index that triggers on front/message.received and emits channel/message.received with channelType=email, mapping Front conversation fields to the channel message schema.
What happens downstream
channel-message-ingestcreates/ensures thechannel_messagescollection, upserts the documentchannel-message-classify(triggered bychannel/message.classify.requested) runs LLM classification for topics/urgency- Gateway context gathering (ADR-0235) queries
channel_messagesfor recent activity
Consequences
- All Slack messages and Front emails indexed in realtime to Typesense
- Gateway can answer “what’s important” with actual conversation content
- Classification pipeline provides topic extraction and urgency tagging
- Existing
slack_messagescollection (backfill) continues as-is;channel_messagesis the live feed