Skip to main content
POST
/
knowledge-bases
Create Knowledge Base
curl --request POST \
  --url https://api.example.com/knowledge-bases

Request

Content-Type: multipart/form-data
curl -X POST "https://your-instance.agentflow.ai/api/v1/knowledge-bases" \
  -H "Authorization: Bearer $TOKEN" \
  -F "name=Product Docs" \
  -F "description=Product documentation and guides" \
  -F "files=@./product-guide.pdf" \
  -F "files=@./release-notes.md" \
  -F "chunk_size=1200" \
  -F "overlap_percentage=0.15" \
  -F "vector_db_type=pgvector"
FieldTypeRequiredDefaultDescription
namestringyesKB name
filesfile[]yesDocuments to upload
descriptionstringnoWhat the KB contains
tagsstringnoComma-separated tags
chunk_sizeintno1200Target chunk size
overlap_percentagefloatno0.15Overlap between chunks
chunking_strategystringnoautoChunking strategy
vector_db_typestringnopgvectorVector database backend
Use POST /api/v1/knowledge-bases/create-from-url to create a KB by crawling a website.

Response

{
  "message": "Knowledge base 'Product Docs' created successfully",
  "id": "kb_abc123",
  "name": "Product Docs",
  "files_uploaded": 2,
  "status": "completed",
  "configuration": {
    "id": "kb_abc123",
    "name": "Product Docs",
    "description": "Product documentation and guides",
    "chunk_size": 1200,
    "overlap_percentage": 0.15,
    "vector_db_type": "pgvector"
  },
  "source_type": "pdf"
}