CentercodePorygon
DittoPorygonAPI

Universal Data Engine

Queryable data layer for filtering, enrichment, and tokenization

FastReliable

Overview

The UDE makes all platform data queryable through a unified interface. It powers filtering, reporting, segmentation, and AI agent access across the entire platform.

Filtering

Find entities matching criteria with powerful filter operators and nested conditions.

Enrichment

Add fields from any source to lists and exports - user data, devices, resources, insights.

Tokenization

Embed live data in content and emails using {{field.path}} syntax.

Query Contexts

Every query operates in one of three contexts

ContextRoot EntityAvailable AtUse Cases
userUsers enriched with all their dataProgram, ProjectSegmentation, participant lists, audience targeting
insightInsights enriched with submitterProjectTriage, reporting, prioritization
projectProjects enriched with aggregatesProgramProgram dashboard, cross-project comparison

Context determines the root entity. All other data is accessed as enrichment: insight.submitter.devices[].product.name queries insights but accesses submitter device data.

Scope Hierarchy

Data flows DOWN the hierarchy

User Scope(highest)
  • user.* (account, profile)
  • user.devices[].*
  • Aggregates across ALL programs
Program Scope
  • user.* (inherited)
  • program.* (program stats)
  • resources.* (program resources)
Project Scope(lowest)
  • user.*, program.* (inherited)
  • project.* (project stats)
  • insights.* (project insights)

Scope-relative aggregations: user.insightCount at project scope means insights in THIS project. At program scope, it means insights across ALL projects in the program.

Field Sources

SourcePath PatternExamples
ACCOUNTuser.*user.name, user.email
DEVICEuser.devices[].*user.devices[].product.brand
BLOCKresources.{slug}.blocks.{id}resources.nda.blocks.signature
RESOURCE_METAresources.{slug}.*resources.nda.completed, completedAt
INSIGHT_METAinsight.*insight.impactScore, insight.status
USER_METAuser.* (computed)user.insightCount, user.deviceCount

Query Example

User Query with Device Filter

Complex filtering with nested conditions

// UDE Query - Find users who completed NDA and have Apple devices
const query: UDEQuery = {
  context: 'user',
  scope: { projectId: 'proj_123' },
  filters: {
    operator: 'AND',
    conditions: [
      { field: 'resources.nda_survey.completed', operator: 'is_true' },
      {
        field: 'user.devices',
        operator: 'any',
        value: { field: 'product.brand', operator: 'eq', value: 'Apple' },
      },
    ],
  },
  columns: ['user.name', 'user.email', 'resources.nda_survey.completedAt'],
  sort: { field: 'user.name', direction: 'asc' },
  limit: 50,
};

Filter Operators

Operators available by field type

// Filter Operators by Field Type

// Boolean
{ field: 'resources.nda.completed', operator: 'is_true' }

// Text
{ field: 'user.name', operator: 'contains', value: 'John' }

// Number
{ field: 'user.insightCount', operator: 'gte', value: 5 }

// Date
{ field: 'resources.nda.completedAt', operator: 'within_last', value: { count: 7, unit: 'days' } }

// Select
{ field: 'insight.status', operator: 'is_any_of', value: ['open', 'in_progress'] }

// Array (devices, tags)
{ field: 'user.devices', operator: 'any', value: { field: 'product.brand', operator: 'eq', value: 'Apple' } }

Token Resolution

Personalized Content

Embed live data in templates

// Token Resolution - Personalize content with live data
const template = `
  Hello {{user.name}},

  Your device: {{user.devices[0].product.name}}
  Completed NDA: {{resources.nda_survey.completedAt}}
`;

const resolved = await resolveTokens(template, {
  userId: 'user_123',
  projectId: 'proj_123',
});
// "Hello John Doe, Your device: iPhone 17 Pro, Completed NDA: 2024-01-15"

AI Direction Tips

When directing AI agents to work with UDE:

  1. Reference context: 'Query in user context' or 'Use insight context for triage'
  2. Specify field paths: 'Filter by resources.nda.completed' or 'Include user.devices[].product.brand'
  3. Mention operators: 'Use any operator to match any device with brand Apple'
  4. For tokens: 'Resolve {{user.name}} in the email template'
  5. Reference the ude skill: 'Load ude/QUERIES.md for filter patterns'

Related

Block Definitions

UDE config for blocks

Scope Model

User, program, project isolation

Form System

Block architecture