Skip to main content
POST
/
agents
/
{agentId}
/
kb
Add Knowledge Base
curl --request POST \
  --url https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "sourceType": "doc",
  "content": "<string>",
  "metadata": {
    "description": "<string>"
  },
  "tags": [
    "<string>"
  ],
  "refreshRate": "never",
  "urls": [
    "<string>"
  ],
  "sitemapUrl": "<string>",
  "maxPages": 123,
  "scrapeContent": true
}
'
{
  "success": true,
  "message": "<string>",
  "data": {}
}

Example: Add Text Document

{
  "name": "Product FAQ",
  "sourceType": "doc",
  "content": "Your product FAQ content here...",
  "metadata": {
    "description": "Frequently asked questions about our product"
  },
  "tags": ["faq", "product"]
}

Example: Add URLs

{
  "name": "Website Pages",
  "sourceType": "url",
  "urls": [
    "https://example.com/about",
    "https://example.com/pricing"
  ],
  "scrapeContent": true,
  "refreshRate": "3d"
}

Example: Crawl Sitemap

{
  "name": "Full Website",
  "sourceType": "sitemap",
  "sitemapUrl": "https://example.com/sitemap.xml",
  "maxPages": 100,
  "scrapeContent": true,
  "refreshRate": "7d"
}
URL and sitemap sources may take time to process. Check document status via GET /agents/{agentId}/kb/{docId}.
Set refreshRate to automatically re-crawl URL sources. Options: 3d, 7d, or never.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

agentId
string
required

The unique identifier of the agent

Body

application/json
name
string
required

Document name/title (required)

sourceType
enum<string>
required

Source type: 'doc' for text, 'url' for webpages, 'sitemap' for crawling

Available options:
doc,
url,
sitemap
content
string

Document text content (required for sourceType 'doc')

metadata
object

Document metadata

tags
string[]

Array of tags for filtering/categorization

refreshRate
enum<string>
default:never

Auto-refresh interval for URL sources

Available options:
3d,
7d,
never
urls
string[]

Array of URLs to process (required when sourceType is 'url')

sitemapUrl
string

URL of the sitemap to crawl (required when sourceType is 'sitemap')

maxPages
integer

Maximum number of pages to process from sitemap

scrapeContent
boolean

Whether to scrape and extract content from URLs

Response

Successful response

success
boolean
required

Indicates if the request was successful

message
string
required

Response message

data
object

Created KB document data