Skip to content

Knowledge Base (Vector Search)

Upload documents and search them with natural language queries. SaaS Maker automatically chunks your content, generates embeddings, and stores them for fast vector similarity search.

  1. Create an index to organize documents by topic
  2. Upload documents — content is automatically chunked and embedded
  3. Search with natural language queries to find relevant chunks

Each project is locked to a single embedding model after its first index creation. Use GET /v1/indexes/models to list available models.

ModelProviderDimensionsNotes
voyage-4-largeVoyage AI1024Best quality, multilingual
voyage-4Voyage AI1024General purpose
voyage-4-liteVoyage AI1024Fast and cheap
voyage-code-3Voyage AI1024Code-optimized
gemini-embedding-001Google3072100+ languages
@cf/baai/bge-base-en-v1.5Cloudflare768Fast English (free)
@cf/baai/bge-large-en-v1.5Cloudflare1024Quality English (free)
@cf/baai/bge-m3Cloudflare1024Multilingual (free)
GET /v1/indexes/models

Auth: None

POST /v1/indexes

Auth: API Key

Terminal window
curl -X POST https://saasmaker-api.sarthakagrawal927.workers.dev/v1/indexes \
-H "Content-Type: application/json" \
-H "X-Project-Key: pk_abc123" \
-d '{
"name": "help-docs",
"embedding_model": "@cf/baai/bge-base-en-v1.5"
}'
FieldTypeRequiredDescription
namestringYesIndex name (unique per project)
embedding_modelstringOn first useRequired on the first index creation to lock the project model
external_idstringNoOptional external identifier
GET /v1/indexes

Auth: API Key

POST /v1/indexes/:indexId/documents

Auth: API Key

Terminal window
curl -X POST https://saasmaker-api.sarthakagrawal927.workers.dev/v1/indexes/idx_123/documents \
-H "Content-Type: application/json" \
-H "X-Project-Key: pk_abc123" \
-d '{
"content": "SaaS Maker is a backend-as-a-service platform for SaaS apps...",
"metadata": { "source": "docs", "page": "intro" }
}'
FieldTypeRequiredDescription
contentstringYesDocument text (max 100KB)
metadataobjectNoArbitrary key-value metadata

Response:

{
"id": "doc_abc",
"index_id": "idx_123",
"chunks_created": 4,
"created_at": "2025-01-01T00:00:00Z"
}
GET /v1/indexes/:indexId/documents?page=1

Auth: API Key

POST /v1/indexes/:indexId/search

Auth: API Key

Terminal window
curl -X POST https://saasmaker-api.sarthakagrawal927.workers.dev/v1/indexes/idx_123/search \
-H "Content-Type: application/json" \
-H "X-Project-Key: pk_abc123" \
-d '{
"query": "how do I collect feedback?",
"top_k": 5
}'
FieldTypeRequiredDescription
querystringYesNatural language search query
top_knumberNoNumber of results (default 5, max 20)

Response:

{
"results": [
{
"document_id": "doc_abc",
"chunk_content": "Use the feedback endpoint to collect bugs and feature requests...",
"score": 0.92,
"metadata": { "source": "docs", "page": "feedback" }
}
]
}
DELETE /v1/indexes/:indexId/documents/:docId

Auth: API Key

Deleting a document also deletes all its chunks.

DELETE /v1/indexes/:indexId

Auth: API Key