Knowledge Base Types
TypeScript types for knowledge bases in the Docutray Node.js SDK — KnowledgeBase, documents, and semantic-search result models with fields and enums.
These are the TypeScript models returned and accepted by the knowledge-base methods of the Docutray Node.js SDK. A knowledge base stores documents with vector embeddings so you can run semantic search over them — see the Knowledge Bases operation guide for the end-to-end workflow and runnable examples. Every type below is exported from the package, so you can import it directly for fully typed request and response handling:
import type { KnowledgeBase, SearchResult } from 'docutray';All list endpoints return the PaginatedResponse
wrapper described in the shared types, and every method can throw the typed
errors documented in Errors.
KnowledgeBase
A knowledge base definition as returned by the API — its id, name, description,
and metadata such as the embedding model and document count. This is the shape
you receive from client.knowledgeBases.create() and .list().
Prop
Type
KnowledgeBaseDocument
A single document stored inside a knowledge base, including its source content reference and sync status. You add these by uploading files, after which Docutray generates the embeddings used for search.
Prop
Type
SearchResultItem
One match from a semantic-search query, pairing the matched document chunk with a similarity score. Higher scores indicate a closer semantic match to the query.
Prop
Type
SearchResult
The full response from a knowledge-base query — the ordered list of
SearchResultItem matches plus query metadata. Returned by
client.knowledgeBases.search().
Prop
Type
SyncResult
The outcome of a knowledge-base sync operation, reporting how many documents were added, updated, or removed. Use it to confirm a re-index completed before relying on fresh search results.
Prop
Type