RAG Search API

The RAG Search in SearchBlox is used to find passages that are relevant to a user’s query. It is available only when the “Enable for RAG” option is enabled during collection creation.

URL

https://localhost:8443/rest/v2/api/rag-search

Method

GET

params

Below given are the basic parameters to use in RAG Search API

paramdescription
querySearch query.
cnameName of the collection
colCollection ID
searchtypeType of search: keyword, vector, or hybrid.
passagesNumber of results to display in the response (integer value).
v.weightVector weight value (double value).
v.thresholdVector threshold value (double value).

Header

HeaderDescription
X-Correlation-IDA unique identifier that can be sent through the search API request.
The X-Correlation-IDs will be logged in ../webapps/ROOT/logs/query.log and can also be viewed in exported query logs file from SearchBlox Analytics.

Response

The JSON response from SearchBlox by default

Example For RAG Search API

URL with Parameters : https://localhost:8443/rest/v2/api/rag-search?passages=10&public=true&query=tools&searchtype=hybrid&v.threshold=0.7&v.weight=0.2

METHOD : GET

Response :

{
    "query": "tools",
    "end": 10,
    "time": 215.0,
    "result": [
        {
            "no": 1,
            "score": 6.1731944,
            "uid": "b8d31bf6df153a16bb9483a11e180fa4",
            "col": "7",
            "colName": "amazon",
            "passage": "Motivation 25 Industry standard and newly developed design tools, decision-making tools, and rating tools helped to evaluate and benchmark existing and future performance. II. PROJECT DEVELOPMENT PROCESS 3) A variety of tools were used and developed to triangulate to the best answer. Design Tools Decision-Making Tools Rating Tools III.",
            "indexDate": "2024-12-02T14:52:40.214Z",
            "isStructured": false,
            "contentType": "PDF",
            "url": "https://searchblox-downloads.s3.amazonaws.com/testdata/allfileformats/ESBOverviewDeck.pdf"
        },
        {...}
    ],
    "pageSize": 10,
    "vectorWeight": 0.2,
    "searchType": "hybrid",
    "maxScore": 6.1731944,
    "passages": 10,
    "vectorThreshold": 0.7,
    "lastPage": 1,
    "currentPage": 1,
    "hits": 10,
    "start": 1
}
TermsDescription
scoreDouble value out of 10 for the generated result.
uidUnique ID of the URL.
colCollection ID
colNameName of the collection
indexDateDate when the document or URL was indexed.
isStructuredCollections like CSV, Database, and MongoDB are considered structured data, while WEB, Dynamic AUTO, SharePoint Online, and similar collections are unstructured.
contentTypeType or format of the document, such as PDF, HTML, etc.
urlThe indexed URL.