Knowledge Base API
Manage contents for your chatbot instant replies using our RAG engine. Populate your KBs using your own contents (URLs, sitemaps, pdfs, docx, text or FAQs). Our semantic engine will help you provide the best answers based on user questions using advanced Semantic indexing and the OpenAI generative AI. More info
The Knowledge Base model
Section titled “The Knowledge Base model”Properties
Section titled “Properties”- id
String- The unique identifier for the knowledge base which is given by Pingstreams. - name
String- The knowledge base name. - id_project
String- The unique identifier of the project - preview_settings
Object- The settings for the knowledge base preview - default
Boolean- Specify if the knowledge base is the default one
Get all knowledge bases
Section titled “Get all knowledge bases”GET https://api.pingstreams.com/v3/:project_id/kb/namespace/allAllows to list all the knowledge bases of a project. Returns at least the default knowledge base.
Path Parameters
Section titled “Path Parameters”- project_id
string- The Project Id is a unique code assigned to your project when you create it in Pingstreams.
Headers
Section titled “Headers”- Authorization
string- Authorization token. Basic Auth or JWT
Response
Section titled “Response”[
{
"default": true,
"id_project": "63ad512e70d5ed0012ad6286",
"id": "63ad512e70d5ed0012ad6286",
"name": "Customer Support",
"preview_settings": {
"model": "gpt-3.5-turbo",
"max_tokens": 128,
"temperature": 0.7,
"top_k": 4,
"context": "You are an awesome AI Assistant."
},
"createdAt": "2024-06-20T13:49:04.006Z",
"updatedAt": "2024-06-21T10:52:55.235Z"
},
{
"default": false,
"id_project": "63ad512e70d5ed0012ad6286",
"id": "66755b6b9fee7f001357bc7f",
"name": "Sales",
"preview_settings": {
"model": "gpt-3.5-turbo",
"max_tokens": 128,
"temperature": 0.7,
"top_k": 4,
"context": "You are an awesome AI Assistant."
},
"createdAt": "2024-06-21T10:52:27.111Z",
"updatedAt": "2024-06-21T10:52:27.111Z"
}
]Example
Section titled “Example”curl -v -X GET -u user@example.com:password \
https://api.pingstreams.com/v3/63ad512e70d5ed0012ad6286/kb/namespace/allCreate new knowledge base
Section titled “Create new knowledge base”POST https://api.pingstreams.com/v3/:project_id/kb/namespaceAllows to create a new knowledge base for a project.
Path Parameters
Section titled “Path Parameters”- project_id
string- The Project Id is a unique code assigned to your project when you create it in Pingstreams.
Headers
Section titled “Headers”- Authorization
string- Authorization token. Basic Auth or JWT
Request Body
Section titled “Request Body”- name
string- The name of the knowledge base.
Response
Section titled “Response”{
"default": false,
"id_project": "63ad512e70d5ed0012ad6286",
"id": "6675a1b3c08d0b00141c415b",
"name": "Products",
"preview_settings": {
"model": "gpt-3.5-turbo",
"max_tokens": 128,
"temperature": 0.7,
"top_k": 4,
"context": "You are an awesome AI Assistant."
},
"createdAt": "2024-06-21T15:52:19.036Z",
"updatedAt": "2024-06-21T15:52:19.036Z"
}Example
Section titled “Example”curl -v -X POST -u user@example.com:password \
-d '{"name": "Products"}' \
https://api.pingstreams.com/v3/63ad512e70d5ed0012ad6286/kb/namespaceUpdate a knowledge base
Section titled “Update a knowledge base”PUT https://api.pingstreams.com/v3/:project_id/kb/namespace/:idAllows to update a knowledge base info and preview settings.
Path Parameters
Section titled “Path Parameters”- project_id
string- The Project Id is a unique code assigned to your project when you create it in Pingstreams. - id
string- The unique identifier for the knowledge base
Headers
Section titled “Headers”- Authorization
string- Authorization token. Basic Auth or JWT
Request Body
Section titled “Request Body”- name
string- The name of the knowledge base. - preview_settings
object- The AI settings for the knowledge base settings.
Response
Section titled “Response”{
"default": false,
"id_project": "63ad512e70d5ed0012ad6286",
"id": "6675a1b3c08d0b00141c415b",
"name": "New Products",
"preview_settings": {
"model": "gpt-4o",
"max_tokens": 256,
"temperature": 0.5,
"top_k": 5,
"context": "Custom context."
},
"createdAt": "2024-06-21T15:52:19.036Z",
"updatedAt": "2024-06-24T08:37:32.313Z"
}Example
Section titled “Example”curl -v -X PUT -u user@example.com:password \
-d '{"name": "New Products", "preview_settings": { "model": "gpt-4o", "max_tokens": 256, "temperature": 0.5, "top_k": 5,"context": "Custom context." }}' \
https://api.pingstreams.com/v3/63ad512e70d5ed0012ad6286/kb/namespace/6675a1b3c08d0b00141c415bDelete a knowledge base
Section titled “Delete a knowledge base”DELETE https://api.pingstreams.com/v3/:project_id/kb/namespace/:idAllows to delete the whole knowledge base or it’s contents only.
Path Parameters
Section titled “Path Parameters”- project_id
string- The Project Id is a unique code assigned to your project when you create it in Pingstreams. - id
string- The unique identifier for the knowledge base
Query Parameters
Section titled “Query Parameters”- contents_only
boolean- (Optional) if TRUE will be deleted only the contents
Headers
Section titled “Headers”- Authorization
string- Authorization token. Basic Auth or JWT
Response
Section titled “Response”{
"success": true,
"message": "Namespace deleted succesfully"
}Example
Section titled “Example”curl -v -X DELETE -u user@example.com:password \
https://api.pingstreams.com/v3/63ad512e70d5ed0012ad6286/kb/namespace/6675a1b3c08d0b00141c415b