# Orama

> JavaScript search engine with full-text, vector, and hybrid search that runs anywhere

- Category: Retrieval & Knowledge (RAG) / Vector Databases
- Language: JavaScript
- Repository: https://github.com/oramasearch/orama
- Website: https://orama.com
- Canonical page: https://ai-tldr.dev/tools/orama/

## In short

Orama is a search engine written in JavaScript. You define a schema, insert documents, and query them with full-text, vector, or hybrid search. It sits in the Vector Databases category of the Retrieval & Knowledge (RAG) tools and is open-source, written in JavaScript. To get started: install Orama.

## Overview

Orama is a search engine written in JavaScript. You define a schema, insert documents, and query them with full-text, vector, or hybrid search. The same code runs in the browser, on the edge, or on a server, so you can keep search close to where your data already lives.

It fits the vector-database category by storing embeddings directly in the index. You declare a vector field with a fixed size in the schema, insert documents with their embeddings, then search by passing a query vector and a similarity threshold. Full-text search uses BM25, and hybrid search combines both signals in one query.

It suits front-end and full-stack developers who want in-app or in-page search without standing up a separate search service. Extra features like filters, facets, geosearch, typo tolerance, and stemming in 30 languages cover common search needs out of the box.

## What it does

- Full-text search backed by BM25 ranking, with typo tolerance and exact match
- Vector and hybrid search by setting mode to 'vector' or 'hybrid' at query time
- Schema-typed documents with 10 field types, including vector[<size>], geopoint, and enum
- Runs in the browser, on the edge, on a server, or in Deno from the same package
- Filters, facets, field boosting, geosearch, and result pinning for merchandising
- Stemming and tokenization in 30 languages, plus a plugin system

## Getting started

Install the package, create a database with a schema, insert documents, then search.

1. Install Orama

   Install with your package manager of choice (npm, yarn, pnpm, or bun). You can also import it directly in a browser module or in Deno via CDN.

```bash
npm i @orama/orama
```

2. Create a database and set a schema

   Create an instance and declare the fields you want to index. Vector size must be set in the schema.

```js
import { create, insert, search } from '@orama/orama'

const db = create({
  schema: {
    name: 'string',
    description: 'string',
    price: 'number',
  },
})
```

3. Insert and search documents

   Add a document, then run a full-text query with a search term.

```js
insert(db, {
  name: 'Noise cancelling headphones',
  description: 'Best noise cancelling headphones on the market',
  price: 99.99,
})

const results = search(db, {
  term: 'Best headphones',
})
```

4. Run a vector search

   Add a vector field to the schema, then search by passing a query vector, the property to compare against, and a minimum similarity.

```js
const results = search(db, {
  mode: 'vector',
  vector: {
    value: [0.938292, 0.284961, 0.248264, 0.748276, 0.26472],
    property: 'embedding',
  },
  similarity: 0.85,
})
```

## When to use it

- Add in-page search to a docs site or web app that runs entirely in the browser
- Build semantic or hybrid search over a product catalog using stored embeddings
- Run search on the edge or in serverless functions without a separate search service
- Power faceted, filtered product search with field boosting and result pinning
