Skip to main content

@orion-js/vectors

The vectors module adds vector‐store capabilities to Orionjs with a clean, provider-agnostic interface.
Since AWS S3 Vectors is still in preview, LocalVectorProvider is ideal for development & testing. The S3VectorProvider uses the new @aws-sdk/client-s3vectors client.

Installation

Core Concepts

1. VectorStorageProvider interface

2. VectorStore & Index

  • VectorStore → an S3 Vector bucket (or a folder for local provider).
  • VectorIndex → a searchable index inside the store. You define the dimension & distance metric (cosine / euclidean).

Providers

LocalVectorProvider

File-system implementation – perfect for unit tests & local dev.
  • Stores JSON files on disk (.store.json, .index.json, vectors.json).
  • Supports cosine & euclidean distance.
  • Same API as cloud provider → easy migration.

S3VectorProvider (preview)

It maps operations to the S3 Vectors API:

Example

Testing

LocalVectorProvider is fully covered by unit & integration tests (run with pnpm --filter @orion-js/vectors test). To run S3 tests, set AWS creds & region:

Coming Soon

  • Advanced filtering harnessing S3 Vectors metadata expressions.
  • Binary embedding support once S3 Vectors GA.
  • Additional providers (e.g., Pinecone, Weaviate).