Core Concepts
Understand the architecture and key abstractions
VectorDB
VectorDB is the central service. It defines high-level operations for vector lifecycle management.
| Method | Description |
|---|---|
upsert | Insert or update a single document |
upsertMany | Bulk upsert documents |
search | Nearest-neighbour search with filters |
getById | Fetch by ID (fails with DocumentNotFound) |
delete | Remove entry by ID |
pruneExpired | Clean up documents past their expires_at |
CollectionSchema
The schema for documents stored in the database:
{
id: DocumentId, // Branded string
content: string, // Primary text content
category: string, // Indexable category
tags: string[], // Indexable tags
metadata_json: string, // Arbitrary JSON string
created_at: Date,
expires_at: Date
}QueryFilter
Filters applied during search, list, or deleteWhere:
| Field | Type | Description |
|---|---|---|
category | string | Match by category |
tags | string[] | Match if any tag is present |
activeAt | Date | Only include docs expiring after this date |
Error Types
VectorDBError- General storage failureDocumentNotFound- Entry not found by IDDimensionMismatch- Vector length doesn't match DB config