curl --request POST \
--url https://api.pawa-ai.com/v1/store/knowledge-base/semantic-retrieval \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"knowledge_base_id": "kb-f9d817f5-46c2-49b2-b07f-f3db8df0887a",
"question_asked_by_user": "What is the purpose of this knowledge base?"
}
'{
"finalRelevantChunk": [
"Hello Pawa AI, I am the final relevant chunk you need"
],
"filteredResults": [
{
"id": 63,
"knowledgeBaseId": 7,
"documentName": "131.3-Visa-Requirements-Schengen-2021-05 (1) (1).pdf",
"chunk": "and for the whole period of staying in the Schengen area. In order to have a flexible travel schedule it is suggested to issue the Insurance for a few days longer than the planned travel time...",
"distance": 0.7506968916261936
},
{
"id": 76,
"knowledgeBaseId": 7,
"documentName": "131.3-Visa-Requirements-Schengen-2021-05 (1) (1).pdf",
"chunk": "plan agreed with the clinic. Medical health documentation issued by the applicant’s country of residence...",
"distance": 0.7515738980069386
}
]
}This endpoint used to retrieve the relevant chunks of the knowledge base based on the user question in the Pawa AI Platform.
curl --request POST \
--url https://api.pawa-ai.com/v1/store/knowledge-base/semantic-retrieval \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"knowledge_base_id": "kb-f9d817f5-46c2-49b2-b07f-f3db8df0887a",
"question_asked_by_user": "What is the purpose of this knowledge base?"
}
'{
"finalRelevantChunk": [
"Hello Pawa AI, I am the final relevant chunk you need"
],
"filteredResults": [
{
"id": 63,
"knowledgeBaseId": 7,
"documentName": "131.3-Visa-Requirements-Schengen-2021-05 (1) (1).pdf",
"chunk": "and for the whole period of staying in the Schengen area. In order to have a flexible travel schedule it is suggested to issue the Insurance for a few days longer than the planned travel time...",
"distance": 0.7506968916261936
},
{
"id": 76,
"knowledgeBaseId": 7,
"documentName": "131.3-Visa-Requirements-Schengen-2021-05 (1) (1).pdf",
"chunk": "plan agreed with the clinic. Medical health documentation issued by the applicant’s country of residence...",
"distance": 0.7515738980069386
}
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The knowledge_base_reference_id of the knowledge base to perform the RAG if the question asked relates to the purpose of the knowledge_base_tool provided.
The question asked by the user to perform the RAG.
Relevant chunks retrieved successfully
Final relevant chunk based on the user query.
[
"Hello Pawa AI, I am the final relevant chunk you need"
]Filtered results based on the relevance of the chunks to the user query.
Show child attributes
63
7
"131.3-Visa-Requirements-Schengen-2021-05 (1) (1).pdf"
"and for the whole period of staying in the Schengen area..."
0.7506968916261936
[
{
"id": 63,
"knowledgeBaseId": 7,
"documentName": "131.3-Visa-Requirements-Schengen-2021-05 (1) (1).pdf",
"chunk": "and for the whole period of staying in the Schengen area. In order to have a flexible travel schedule it is suggested to issue the Insurance for a few days longer than the planned travel time...",
"distance": 0.7506968916261936
},
{
"id": 76,
"knowledgeBaseId": 7,
"documentName": "131.3-Visa-Requirements-Schengen-2021-05 (1) (1).pdf",
"chunk": "plan agreed with the clinic. Medical health documentation issued by the applicant’s country of residence...",
"distance": 0.7515738980069386
}
]