All Products
Search
Document Center

:Engine architecture overview

Last Updated:Apr 01, 2026

The PAI-Rec engine is a Go-based framework for building online recommendation services. It provides a complete, configurable pipeline—from retrieval through filtering and sorting—so you can ship a production-ready recommendation service without building infrastructure from scratch, or extend it with custom logic when your use case requires it.

Overall architecture

架构图

System architecture and deployment

无标题-2025-11-03-1642

How it works

The PAI-Rec engine processes each recommendation request through a sequential pipeline:

  1. Receive the request — The built-in Go HTTP server accepts incoming requests on registered routes, eliminating the need to wire up a separate REST server.

  2. Load features — The engine fetches user and item features from one or more configured data sources: FeatureDB, Hologres, Redis, Tablestore, or DataHub/Kafka. FeatureStore coordinates feature management and keeps data consistent across sources.

  3. Retrieve candidates — Predefined retrieval policies fetch a candidate set of items matching the request context.

  4. Filter candidates — Filtering policies remove ineligible items from the candidate set.

  5. Sort candidates — Sorting policies rank the filtered candidates. For model-based ranking, the engine calls EAS to run inference online.

  6. Return results — The ranked list is returned via the RESTful API response.

The recommendation flow is fully described through configuration. Adjust retrieval sources, filtering rules, and sorting strategies without changing code. For logic outside the built-in policies, use the extension points to inject custom operations at any stage.

Overall flow of the recommendation service

5967AD78-2A82-47E9-AFF0-C4B6B4AF8E55

Built-in features

6B6D0F87-EDAD-464B-8420-BED758F11B10

The PAI-Rec engine ships with the following capabilities:

CapabilityDescription
Go HTTP serverHandles incoming requests with built-in route registration. No separate web framework needed.
Recommendation pipelineEnd-to-end pipeline with predefined retrieval, filtering, and sorting policies.
EAS integrationBuilt-in access to EAS for online model inference during the sorting stage.
Multi-source data loadingLoads features from FeatureDB, Hologres, Redis, Tablestore, and DataHub/Kafka in a single pipeline run.
FeatureStore supportImproves feature management and ensures data consistency across sources.
Configuration-driven flowDefines the full recommendation flow in configuration files—no code changes required for pipeline adjustments.
Lightweight A/B testingBuilt-in platform for traffic splitting and experiment management.
Extension pointsHooks at each pipeline stage for custom retrieval, filtering, or sorting logic.

Key concepts

TermDescription
PipelineThe ordered sequence of stages (retrieval → filtering → sorting) that transforms a request into a ranked result list.
RetrievalThe stage that fetches a candidate item set from configured data sources based on the request context.
FilteringThe stage that removes ineligible candidates before scoring.
SortingThe stage that ranks filtered candidates, optionally using EAS for model-based scoring.
EAS (Elastic Algorithm Service)The Alibaba Cloud service that hosts and serves ML models online. PAI-Rec calls EAS during the sorting stage for real-time inference.
FeatureStoreThe feature management layer that coordinates feature reads across multiple data sources and enforces data consistency.
Extension pointsNamed hooks in the pipeline where you can register custom logic without modifying the core framework.
A/B testing platformThe built-in experiment layer that splits traffic across pipeline configurations and measures impact per variant.