Skip to main content

1. Install and set up

pip install "ragrails[voyage,qdrant]"
docker run -p 6333:6333 qdrant/qdrant

2. Ingest the API

from ragrails import RagRails

rag = RagRails()

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

3. Query

result = rag.query(
    "Which products are available?",
    embedding={"provider": "voyage", "model": "voyage-3"},
    retrieval={"vector_db": "qdrant", "collection": "products", "url": "http://localhost:6333", "top_k": 5},
)