> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentfront.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install VectoriaDB in your project

Get VectoriaDB set up in your project.

## Requirements

* **Node.js 18+** (Node.js 22 recommended)
* **npm**, **pnpm**, or **yarn**

## Install

<CodeGroup>
  ```bash npm theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
  npm install vectoriadb
  ```

  ```bash pnpm theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
  pnpm add vectoriadb
  ```

  ```bash yarn theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
  yarn add vectoriadb
  ```
</CodeGroup>

## Peer Dependencies

VectoriaDB uses `@huggingface/transformers` for embedding generation. Install it if you're using semantic search:

<CodeGroup>
  ```bash npm theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
  npm install @huggingface/transformers
  ```

  ```bash pnpm theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
  pnpm add @huggingface/transformers
  ```

  ```bash yarn theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
  yarn add @huggingface/transformers
  ```
</CodeGroup>

<Note>
  If you only need TF-IDF keyword search (`TFIDFVectoria`), you can skip installing `@huggingface/transformers`.
</Note>

## Verify Installation

```ts title="src/verify.ts" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
import { VectoriaDB } from 'vectoriadb';

const db = new VectoriaDB();
console.log('VectoriaDB installed successfully!');
```

## Model Download

On first initialization, VectoriaDB downloads the embedding model (\~22 MB):

```ts title="src/initialize.ts" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
const db = new VectoriaDB({
  cacheDir: './.cache/transformers', // Model cache location
});

await db.initialize(); // Downloads model on first run
```

The model is cached locally and reused on subsequent runs.

### Pre-download Model

For production deployments, pre-download the model during build:

```bash theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
# Pre-download during Docker build
node -e "require('@huggingface/transformers').pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2')"
```

## TypeScript Configuration

VectoriaDB is written in TypeScript and includes type definitions. No additional setup required.

```json title="tsconfig.json" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
{
  "compilerOptions": {
    "moduleResolution": "node",
    "esModuleInterop": true
  }
}
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/vectoriadb/get-started/quickstart">
    Build your first semantic search
  </Card>

  <Card title="Configuration" icon="gear" href="/vectoriadb/api-reference/vectoriadb/constructor">
    Explore configuration options
  </Card>
</CardGroup>
