DocumentationNeurondB Documentation

Feature Store

Create Feature Store

Register features, apply transformations, and serve consistent features for training and inference.

Initialize Feature Store

Create feature store

-- Create feature store for user features
SELECT neurondb.create_feature_store(
    'user_features',     -- Store name
    'users',             -- Entity table
    'user_id'            -- Entity key column
) as store_id;

Register Features

Register feature definitions including raw features and engineered features.

Register features

-- Register raw features
SELECT neurondb.register_feature(
    1,                   -- store_id
    'total_spent',       -- feature name
    'numeric',           -- data type
    'total_spent'        -- SQL expression
) as feature_id;

-- Register engineered features
SELECT neurondb.register_feature(
    1,
    'avg_transaction_value',
    'numeric',
    'total_spent / NULLIF(num_transactions, 0)'
) as feature_id;

Serve Features

Retrieve features for training or inference.

Serve features

SELECT neurondb.serve_features(
    'user_features',     -- Store name
    ARRAY[1, 2, 3],      -- Entity IDs
    ARRAY['total_spent', 'avg_transaction_value']  -- Feature names
) as features;

Next Steps