Skip to content
FacebookYouTubeX (Twitter)

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

  • 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 https://api.pingstreams.com/v3/:project_id/kb/namespace/all

Allows to list all the knowledge bases of a project. Returns at least the default knowledge base.

  • project_id string - The Project Id is a unique code assigned to your project when you create it in Pingstreams.
  • Authorization string - Authorization token. Basic Auth or JWT
[
  {
    "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"
  }
]
curl -v -X GET -u user@example.com:password \
  https://api.pingstreams.com/v3/63ad512e70d5ed0012ad6286/kb/namespace/all
POST https://api.pingstreams.com/v3/:project_id/kb/namespace

Allows to create a new knowledge base for a project.

  • project_id string - The Project Id is a unique code assigned to your project when you create it in Pingstreams.
  • Authorization string - Authorization token. Basic Auth or JWT
  • name string - The name of the knowledge base.
{
  "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"
}
curl -v -X POST -u user@example.com:password \
  -d '{"name": "Products"}' \
  https://api.pingstreams.com/v3/63ad512e70d5ed0012ad6286/kb/namespace
PUT https://api.pingstreams.com/v3/:project_id/kb/namespace/:id

Allows to update a knowledge base info and preview settings.

  • 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
  • Authorization string - Authorization token. Basic Auth or JWT
  • name string - The name of the knowledge base.
  • preview_settings object - The AI settings for the knowledge base settings.
{
  "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"
}
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/6675a1b3c08d0b00141c415b
DELETE https://api.pingstreams.com/v3/:project_id/kb/namespace/:id

Allows to delete the whole knowledge base or it’s contents only.

  • 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
  • contents_only boolean - (Optional) if TRUE will be deleted only the contents
  • Authorization string - Authorization token. Basic Auth or JWT
{
  "success": true,
  "message": "Namespace deleted succesfully"
}
curl -v -X DELETE -u user@example.com:password \
  https://api.pingstreams.com/v3/63ad512e70d5ed0012ad6286/kb/namespace/6675a1b3c08d0b00141c415b