Store ports¶
recsys-algo follows a ports-and-adapters style:
modeldefines interfaces (ports) for data access.algorithmconsumes those ports to produce ranked outputs.
This separation makes the engine testable and lets you plug in different storage/backends (Postgres, Redis, object store, in-memory, etc.).
Minimal required ports¶
At minimum, implement:
model.PopularityStore— provides popularity candidatesmodel.TagStore— provides item tags used for filtering/diversity/caps
Optional ports (enable more signals)¶
Depending on which signals/features you want, implement one or more of:
model.ProfileStore— user profile for personalizationmodel.CooccurrenceStore/model.HistoryStore— co-visitationmodel.EmbeddingStore— embedding similaritymodel.CollaborativeStore— ALS/CF similaritymodel.ContentStore— content similarity (tag overlap)model.SessionStore— session sequencesmodel.EventStore— event-based exclusions
If a capability is missing, the engine should treat the signal as unavailable and continue.
Runtime feature disabling¶
To disable a feature at runtime (even if the port exists), return model.ErrFeatureUnavailable from a method.
Read next¶
- End-to-end extension guide: How-to: add a new signal end-to-end
- Ranking & constraints reference: Ranking & constraints reference