Skip to content

Welcome to Orama!


Orama is an open source, high performance full-text and vector search engine entirely written in TypeScript, with zero dependencies.





Requirements

A JavaScript runtime is the only requirement. Orama has been designed to work on any JS runtime and has no dependencies.

Installation

You can install Orama using npm, yarn or pnpm.

Terminal window
npm install @orama/orama

Or import it directly in a browser module:

index.html
<html>
<body>
<script type="module">
import {
create,
search,
insert,
} from "https://unpkg.com/@orama/orama@latest/dist/index.js";
// ...
</script>
</body>
</html>

Basic usage

import { create, search, insert } from "@orama/orama";
const db = await create({
schema: {
name: "string",
description: "string",
price: "number",
meta: {
rating: "number",
},
},
});
await insert(db, {
name: "Wireless Headphones",
description:
"Experience immersive sound quality with these noise-cancelling wireless headphones.",
price: 99.99,
meta: {
rating: 4.5,
},
});
const searchResult = await search(db, {
term: "headphones",
});
console.log(searchResult.hits.map((hit) => hit.document));

For more information, check out the Usage section.

CommonJS Imports

Orama ships ESM modules by default. This allows us to move faster when providing new features and bug fixes, as well as using the "exports" field in package.json to provide a better developer experience.

CommonJS imports are still supported, but we suggest you to migrate to ESM.

TypeScript

Set moduleResolution in the compilerOptions in your tsconfig.json to be either Node16 or NodeNext.

When importing types, always refer to the standard orama import:

import type { Language } from "@orama/orama";

Community Rewards

Orama Community Rewards

Are you using Orama in production? Have you written an article or made a YouTube video on Orama? Contact us to get some Orama swag in return!