Skip to main content

The problem

Shoppers describe what they want in their own words, like “a waterproof jacket for hiking under $200”, but keyword filters can’t parse intent.

How Ragrails solves it

Pull your product catalog from its API, embed the product descriptions, and let shoppers search or chat in natural language.
  1. Fetch the catalog API (paginated) into a collection.
  2. Retrieve or chat over product descriptions and attributes.
from ragrails import RagRails

rag = RagRails()

rag.ingest(
    api={
        "url": "https://api.shop.example.com/products",
        "title": "Products",
        "pagination": {"type": "page", "param": "page", "size_param": "per_page", "size": 100},
        "max_pages": 50,
    },
    embedding={"provider": "voyage", "model": "voyage-3"},
    storage={"vector_db": "qdrant", "collection": "products", "url": "http://localhost:6333"},
)

embedder = rag.embedder(provider="voyage", model="voyage-3", input_type="query")
hits = rag.retrieve(
    "waterproof hiking jacket under $200",
    embedder=embedder,
    vector_db="qdrant", collection="products", url="http://localhost:6333",
    top_k=10,
)
Refresh the catalog regularly with edit()/delete() so discontinued products drop out of results.

Features used

API ingestion · Pagination · Retrieval