SegOps AIDocs

Segments Overview

Segments are named, rule-based audiences. Once computed, membership is available at millisecond latency via the delivery API.

What Are Segments?#

A segment defines a population of users who satisfy a set of behavioral conditions. For example: “users who placed more than 3 orders in the last 90 days and haven't visited in 30 days.”

When you compute a segment, SegOps runs a query over your entire event history in the analytics warehouse and stores the matching user IDs in the segment_memberships table. Those IDs can then be queried at runtime for personalization, feature flags, or activation.

Three Ways to Create a Segment#

Segment Types#

The segment_type field controls how the segment was created and how it is displayed in the UI:

  • rule — manually defined conditions via the visual rule builder or API.
  • ai — the AI builder generated the definition from a natural language prompt.
  • lookalike — audience expansion from a seed segment (roadmap feature).
Note
All segment types ultimately produce the same JSON DSL and can be freely edited in the rule builder or via the API regardless of how they were created.

Segment Lifecycle#

A segment moves through these states:

DraftSegment created but never computed. No membership data exists yet.
ComputingA Celery compute task is running. Do not trigger another compute until this completes.
ComputedMembership is current. The UI shows member count and last computed timestamp.

Versioning#

Every time you save a segment definition, SegOps creates a version snapshot. This means you can always view the definition that was in effect during any past compute, which is useful for auditing why a user was or wasn't in a segment at a point in time.

Access the version history in the UI via the History panel on any segment detail page, or via the API at GET /api/segments/<id>/versions/.

Learn More#