Skip to main content
Build a semantic search index in just a few lines of code.

Basic Example

src/index.ts
You now have a working semantic search index. initialize() must run before add, search, or update. Calling it twice is safe because VectoriaDB short-circuits if it is already ready.

Step-by-Step Breakdown

1. Define Metadata Interface

src/types.ts
This ensures type safety for all documents in your index.

2. Create and Initialize

src/setup.ts

3. Add Documents

src/add.ts
src/search.ts

Configuration Options

Next Steps

Adding Documents

Learn about indexing options

Search

Master search queries

Persistence

Persist embeddings between restarts

HNSW Scaling

Scale to large datasets