RAG Search API

The RAG Search was introduced to look for passages that are relevant to the requested query. It is only available on enabling the “Enable for RAG” switch during the 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
searchtypecan be keyword/vector/hybrid
passagesNumber of results to display on response. Integer value/Numbers
v.weightvector weight in double value.
v.thresholdvector threshold in 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 on when the document/url was indexed.
isStructuredCollections like CSV, Database, MongoDB are of structured data and other Collections like WEB, Dynamic AUTO, SharepointOnline and others are considered as unstructured. For example if it is stored in any table or can be stored in databases, they are considered as structured else not.
contentTypeType/Format of the document like PDF, HTML and so on.
urlindexed url