POST
/
v1
/
datastores
/
{datastore_id}
/
search
curl --location 'https://api.llmrails.com/v1/datastores/{datastore_id}/search' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: {token}' \
--data '{
    "text":"What is LLM Rails?",
    "summarize": false
}
'
{
    "results": [
        {
            "text": "Text 1",
            "metadata": {
                "type": "text",
                "url": "",
                "name": "",
                "score": 0.008196721
            }
        },
        {
            "text": "Text 2",
            "metadata": {
                "type": "file",
                "url": "{file_url}",
                "name": "Test File",
                "score": 0.008196721
            }
        },
        {
            "text": "Text 3",
            "metadata": {
                "type": "website",
                "url": "https://llmrails.com/",
                "name": "https://llmrails.com/",
                "score": 0.008064516
            }
        }
    ]
}
curl --location 'https://api.llmrails.com/v1/datastores/{datastore_id}/search' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: {token}' \
--data '{
    "text":"What is LLM Rails?",
    "summarize": false
}
'
{
    "results": [
        {
            "text": "Text 1",
            "metadata": {
                "type": "text",
                "url": "",
                "name": "",
                "score": 0.008196721
            }
        },
        {
            "text": "Text 2",
            "metadata": {
                "type": "file",
                "url": "{file_url}",
                "name": "Test File",
                "score": 0.008196721
            }
        },
        {
            "text": "Text 3",
            "metadata": {
                "type": "website",
                "url": "https://llmrails.com/",
                "name": "https://llmrails.com/",
                "score": 0.008064516
            }
        }
    ]
}

Path Parameters

datastore_id
string
required

Body

application/json
k
integer
default: 5

Number of documents to return

text
string
required

Query to search for

hybrid
boolean
default: true

hybrid search or only vector search

summarize
boolean
default: false

Summarize responses or not

filters
object

Response

200 - application/json
results
object[]
required
summarization
string

Summarization of responses based on given input