Conversations enter. Structured work objects emerge. Relay treats chat as the primary raw material and transforms it into executable, searchable, linkable artifacts through AI extraction and human validation.
The core data flow that makes Relay unique: multi-platform conversations are ingested, decomposed by AI, triaged with human confirmation, and promoted into durable work objects on an AI-native project board.
Provider-abstracted AI pipeline. The AIProvider interface (extract / summarize / classifyIntent) means swapping models is a config change. Factory pattern via createAIProvider.
Relay's fundamental abstraction: typed, durable entities extracted from conversations. Every object maintains provenance, audit history, and relationship links via the polymorphic ObjectLink table.
| Store | Technology | Role | Status |
|---|---|---|---|
| Structured Storage | PostgreSQL + Prisma ORM | Messages, users, channels, work objects, AIExtractions, ObjectLinks | OPERATIONAL |
| Vector Embeddings | pgvector | System state embeddings, semantic search over messages and work objects | OPERATIONAL |
| Knowledge Graph | Neo4j + Graphiti | Cross-channel relationship mapping, entity/episode/pattern surfaces, temporal recall | OPERATIONAL |
| Memory Files | Filesystem | Daily notes, heartbeat state, project tracking files | OPERATIONAL |
| Session Layer | Session API :18890 | Token-scoped sessions bridging into graph and memory surfaces | OPERATIONAL |
| Ingestion Preprocessor | Python :18793 | Deduplication, sanitization, semantic extraction, packaging before Neo4j writes | OPERATIONAL |
| Flow | Path | Status |
|---|---|---|
| Message Ingestion | Discord/Email/Telegram → Unified Pipeline → AIExtraction → Triage Inbox | OPERATIONAL |
| Work Object Promotion | Triage Inbox → Human Confirm → Prisma → Work Object (Task/Decision/etc.) | OPERATIONAL |
| Graph Memory Sync | Work Objects → Session API :18890 → Preprocessor :18793 → Neo4j | OPERATIONAL |
| Knowledge Distillation | Consultation → Pattern Extraction → LearnedPattern → Digest/Reporting | OPERATIONAL |
| Proactive Nudges | Bot → Channel analysis → Contextual intervention → Discord/Telegram | NEEDS WIRING |
| Review Workflow | Review Request → Checklist + SLA → Approval/Reject → Decision Record | IN PROGRESS |
| Dependency Graph | Tasks + Dependencies → DAG construction → Critical Path → Board views | IN PROGRESS |
| Issue | Severity | Detail |
|---|---|---|
| Schema drift: bot.ts vs loop-aware-bot.ts | HIGH | loop-aware-bot.ts uses non-existent Prisma fields. Reconcile or delete one. |
| Pipeline schema mismatch | HIGH | processMessageWithAI creates AIExtraction with wrong field names vs actual Prisma schema. |
| No authentication on triage API | HIGH | No auth middleware on /api/triage. NextAuth in deps but not wired. |
| Hardcoded workspace/project IDs | MED | default-workspace and default-project hardcoded across bot and triage routes. |
| Sequential batch processing | LOW | batchProcessMessages uses sequential await. Needs Promise.allSettled with concurrency limiter. |