The business facts
Store names, prices, stock and availability in rows. A stable product ID connects those fields to every retrieval result.
Define your schemaRecommendations
Combine similarity, product relationships and business rules to build a shortlist your application can explain.
From a product to a shortlist
Retrieve candidates through the vector and graph APIs, fetch their product rows, then apply your ranking. The example changes the application recipe while keeping eligibility fixed.
Sample ordering set by the application. No live query or measured scores.
Your application coordinates these requests. This is not a single cross-model query or a shared-snapshot guarantee.
See retrieval patternsPrepare the catalog
Store names, prices, stock and availability in rows. A stable product ID connects those fields to every retrieval result.
Define your schemaGenerate embeddings with your chosen model. Keep the dimensions and distance metric consistent across product writes and queries.
Configure vectorsDeclare accessory or category relations using record references. Your application decides which connections contribute useful candidates.
Model relationshipsEligibility before ranking
Use SQL to check retrieved IDs against the fields that determine whether a product can be shown. Keep merchandising rules separate from similarity scores.
Vector metadata filters use exact equality and behave differently by index. IVF-PQ does not apply them; check the index contract before relying on a filter.
Read filtering behaviourSELECT id, name
FROM shop.products
WHERE id IN ($1, $2, $3)
AND in_stock = true
AND price_cents <= $4
LIMIT 12;Bind candidate IDs and the budget through the request's params array.
Keep the experience current
Row, vector and full-text updates are separate calls. Update the affected representations when a product changes, and track any stage that needs retrying.
Change business fields and declared relationship references.
Replace embeddings or search entries when their source content changes.
Retry failed stages and recheck purchase availability in the application.
Build and evaluate
Compare recipes on representative products. Track eligible result coverage, relevance and latency across the entire application flow. Keep a curated fallback when too few candidates survive.
Build with OriginChainDB