{"id":13534690,"url":"https://github.com/oramasearch/orama","last_synced_at":"2025-05-12T03:37:43.861Z","repository":{"id":37078568,"uuid":"490677825","full_name":"oramasearch/orama","owner":"oramasearch","description":"🌌  A complete search engine and RAG pipeline in your browser, server or edge network with support for full-text, vector, and hybrid search in less than 2kb.","archived":false,"fork":false,"pushed_at":"2025-04-29T02:56:31.000Z","size":129374,"stargazers_count":9353,"open_issues_count":49,"forks_count":335,"subscribers_count":44,"default_branch":"main","last_synced_at":"2025-05-10T00:53:22.611Z","etag":null,"topics":["algiorithm","data-structures","full-text","javascript","node","search","search-algorithm","search-engine","typescript","typo-tolerance","vector","vector-database","vector-database-embedding","vector-search","vector-search-engine"],"latest_commit_sha":null,"homepage":"https://docs.orama.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oramasearch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":null},"created_at":"2022-05-10T12:01:50.000Z","updated_at":"2025-05-09T23:10:46.000Z","dependencies_parsed_at":"2023-12-13T18:25:05.846Z","dependency_job_id":"57bd5cf2-cc5b-498b-b303-316be653e92d","html_url":"https://github.com/oramasearch/orama","commit_stats":{"total_commits":892,"total_committers":96,"mean_commits":9.291666666666666,"dds":0.4742152466367713,"last_synced_commit":"28614db83a604b1f42be285f914ad83b105325ac"},"previous_names":["lyrasearch/lyra","askorama/orama","oramasearch/orama"],"tags_count":152,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oramasearch%2Forama","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oramasearch%2Forama/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oramasearch%2Forama/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oramasearch%2Forama/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oramasearch","download_url":"https://codeload.github.com/oramasearch/orama/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253347028,"owners_count":21894279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algiorithm","data-structures","full-text","javascript","node","search","search-algorithm","search-engine","typescript","typo-tolerance","vector","vector-database","vector-database-embedding","vector-search","vector-search-engine"],"created_at":"2024-08-01T08:00:35.212Z","updated_at":"2025-05-12T03:37:43.835Z","avatar_url":"https://github.com/oramasearch.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/oramasearch/orama/refs/heads/main/misc/readme/orama-readme-hero-dark.png#gh-dark-mode-only\" /\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/oramasearch/orama/refs/heads/main/misc/readme/orama-readme-hero-light.png#gh-light-mode-only\" /\u003e\n\u003c/p\u003e\n\n[![Tests](https://github.com/oramasearch/orama/actions/workflows/turbo.yml/badge.svg)](https://github.com/oramasearch/orama/actions/workflows/turbo.yml)\n\nIf you need more info, help, or want to provide general feedback on Orama, join the [Orama Slack channel](https://orama.to/slack)\n\n# Highlighted features\n\n- [Full-Text search](https://docs.orama.com/open-source/usage/search/introduction)\n- [Vector Search](https://docs.orama.com/open-source/usage/search/vector-search)\n- [Hybrid Search](https://docs.orama.com/open-source/usage/search/hybrid-search)\n- [GenAI Chat Sessions](https://docs.orama.com/open-source/usage/answer-engine/introduction)\n- [Search Filters](https://docs.orama.com/open-source/usage/search/filters)\n- [Geosearch](https://docs.orama.com/open-source/usage/search/geosearch)\n- [Facets](https://docs.orama.com/open-source/usage/search/facets)\n- [Fields Boosting](https://docs.orama.com/open-source/usage/search/fields-boosting)\n- [Typo Tolerance](https://docs.orama.com/open-source/usage/search/introduction#typo-tolerance)\n- [Exact Match](https://docs.orama.com/open-source/usage/search/introduction#exact-match)\n- [BM25](https://docs.orama.com/open-source/usage/search/bm25-algorithm)\n- [Stemming and tokenization in 30 languages](https://docs.orama.com/open-source/text-analysis/stemming)\n- [Plugin System](https://docs.orama.com/open-source/plugins/introduction)\n\n# Installation\n\nYou can install Orama using `npm`, `yarn`, `pnpm`, `bun`:\n\n```sh\nnpm i @orama/orama\n```\n\nOr import it directly in a browser module:\n\n```html\n\u003chtml\u003e\n  \u003cbody\u003e\n    \u003cscript type=\"module\"\u003e\n      import { create, insert, search } from 'https://cdn.jsdelivr.net/npm/@orama/orama@latest/+esm'\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nWith Deno, you can just use the same CDN URL or use npm specifiers:\n\n```js\nimport { create, search, insert } from 'npm:@orama/orama'\n```\n\nRead the complete documentation at [https://docs.orama.com](https://docs.orama.com).\n\n# Orama Features\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/oramasearch/orama/refs/heads/main/misc/readme/features-dark.png#gh-dark-mode-only\" /\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/oramasearch/orama/refs/heads/main/misc/readme/features-light.png#gh-light-mode-only\" /\u003e\n\u003c/p\u003e\n\n# Usage\n\nOrama is quite simple to use. The first thing to do is to create a new database\ninstance and set an indexing schema:\n\n```js\nimport { create, insert, remove, search, searchVector } from '@orama/orama'\n\nconst db = create({\n  schema: {\n    name: 'string',\n    description: 'string',\n    price: 'number',\n    embedding: 'vector[1536]', // Vector size must be expressed during schema initialization\n    meta: {\n      rating: 'number',\n    },\n  },\n})\n\ninsert(db, {\n  name: 'Noise cancelling headphones',\n  description: 'Best noise cancelling headphones on the market',\n  price: 99.99,\n  embedding: [0.2432, 0.9431, 0.5322, 0.4234, ...],\n  meta: {\n    rating: 4.5\n  }\n})\n\nconst results = search(db, {\n  term: 'Best headphones'\n})\n\n// {\n//   elapsed: {\n//     raw: 21492,\n//     formatted: '21μs',\n//   },\n//   hits: [\n//     {\n//       id: '41013877-56',\n//       score: 0.925085832971998432,\n//       document: {\n//         name: 'Noise cancelling headphones',\n//         description: 'Best noise cancelling headphones on the market',\n//         price: 99.99,\n//         embedding: [0.2432, 0.9431, 0.5322, 0.4234, ...],\n//         meta: {\n//           rating: 4.5\n//         }\n//       }\n//     }\n//   ],\n//   count: 1\n// }\n```\n\nOrama currently supports 10 different data types:\n\n| Type             | Description                                                                 | Example                                                                     |\n| ---------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- |\n| `string`         | A string of characters.                                                     | `'Hello world'`                                                             |\n| `number`         | A numeric value, either float or integer.                                   | `42`                                                                        |\n| `boolean`        | A boolean value.                                                            | `true`                                                                      |\n| `enum`           | An enum value.                                                              | `'drama'`                                                                   |\n| `geopoint`       | A geopoint value.                                                           | `{ lat: 40.7128, lon: 74.0060 }`                                            |\n| `string[]`       | An array of strings.                                                        | `['red', 'green', 'blue']`                                                  |\n| `number[]`       | An array of numbers.                                                        | `[42, 91, 28.5]`                                                            |\n| `boolean[]`      | An array of booleans.                                                       | `[true, false, false]`                                                      |\n| `enum[]`         | An array of enums.                                                          | `['comedy', 'action', 'romance']`                                           |\n| `vector[\u003csize\u003e]` | A vector of numbers to perform vector search on.                            | `[0.403, 0.192, 0.830]`                                                     |\n\n# Vector and Hybrid Search Support\n\nOrama supports both vector and hybrid search by just setting `mode: 'vector'` when performing search.\n\nTo perform this kind of search, you'll need to provide [text embeddings](https://en.wikipedia.org/wiki/Word_embedding) at search time:\n\n```js\nimport { create, insertMultiple, search } from '@orama/orama'\n\nconst db = create({\n  schema: {\n    title: 'string',\n    embedding: 'vector[5]', // we are using a 5-dimensional vector.\n  },\n});\n\ninsertMultiple(db, [\n  { title: 'The Prestige', embedding: [0.938293, 0.284951, 0.348264, 0.948276, 0.56472] },\n  { title: 'Barbie', embedding: [0.192839, 0.028471, 0.284738, 0.937463, 0.092827] },\n  { title: 'Oppenheimer', embedding: [0.827391, 0.927381, 0.001982, 0.983821, 0.294841] },\n])\n\nconst results = search(db, {\n  // Search mode. Can be 'vector', 'hybrid', or 'fulltext'\n  mode: 'vector',\n  vector: {\n    // The vector (text embedding) to use for search\n    value: [0.938292, 0.284961, 0.248264, 0.748276, 0.26472],\n    // The schema property where Orama should compare embeddings\n    property: 'embedding',\n  },\n  // Minimum similarity to determine a match. Defaults to `0.8`\n  similarity: 0.85,\n  // Defaults to `false`. Setting to 'true' will return the embeddings in the response (which can be very large).\n  includeVectors: true,\n})\n```\n\nHave trouble generating embeddings for vector and hybrid search? Try our `@orama/plugin-embeddings` plugin!\n\n```js\nimport { create } from '@orama/orama'\nimport { pluginEmbeddings } from '@orama/plugin-embeddings'\nimport '@tensorflow/tfjs-node' // Or any other appropriate TensorflowJS backend, like @tensorflow/tfjs-backend-webgl\n\nconst plugin = await pluginEmbeddings({\n  embeddings: {\n    // Schema property used to store generated embeddings\n    defaultProperty: 'embeddings',\n    onInsert: {\n      // Generate embeddings at insert-time\n      generate: true,\n      // properties to use for generating embeddings at insert time.\n      // Will be concatenated to generate a unique embedding.\n      properties: ['description'],\n      verbose: true,\n    }\n  }\n})\n\nconst db = create({\n  schema: {\n    description: 'string',\n    // Orama generates 512-dimensions vectors.\n    // When using @orama/plugin-embeddings, set the property where you want to store embeddings as `vector[512]`.\n    embeddings: 'vector[512]'\n  },\n  plugins: [plugin]\n})\n\n// Orama will generate and store embeddings at insert-time!\nawait insert(db, { description: 'Classroom Headphones Bulk 5 Pack, Student On Ear Color Varieties' })\nawait insert(db, { description: 'Kids Wired Headphones for School Students K-12' })\nawait insert(db, { description: 'Kids Headphones Bulk 5-Pack for K-12 School' })\nawait insert(db, { description: 'Bose QuietComfort Bluetooth Headphones' })\n\n// Orama will also generate and use embeddings at search time when search mode is set to \"vector\" or \"hybrid\"!\nconst searchResults = await search(db, {\n  term: 'Headphones for 12th grade students',\n  mode: 'vector',\n  similarity: 0.75,\n})\n```\n\nWant to use OpenAI embedding models? Use our [Secure Proxy](https://docs.orama.com/open-source/plugins/plugin-secure-proxy) plugin to call OpenAI from the client-side securely.\n\n# RAG and Chat Experiences with Orama\n\nSince `v3.0.0`, Orama allows you to create your own ChatGPT/Perplexity/SearchGPT-like experience. You will need to call the OpenAI APIs, so we strongly recommend using the [Secure Proxy Plugin](https://docs.orama.com/open-source/plugins/plugin-secure-proxy) to do that securely from your client side. It's free!\n\n```js\nimport { create, insert } from '@orama/orama'\nimport { pluginSecureProxy } from '@orama/plugin-secure-proxy'\n\nconst secureProxy = await pluginSecureProxy({\n  apiKey: 'my-api-key',\n  defaultProperty: 'embeddings',\n  models: {\n    // The chat model to use to generate the chat answer\n    chat: 'openai/gpt-4o-mini'\n  }\n})\n\nconst db = create({\n  schema: {\n    name: 'string'\n  },\n  plugins: [secureProxy]\n})\n\ninsert(db, { name: 'John Doe' })\ninsert(db, { name: 'Jane Doe' })\n\nconst session = new AnswerSession(db, {\n  // Customize the prompt for the system\n  systemPrompt: 'You will get a name as context, please provide a greeting message',\n  events: {\n    // Log all state changes. Useful to reactively update a UI on a new message chunk, sources, etc.\n    onStateChange: console.log,\n  }\n})\n\nconst response = await session.ask({\n  term: 'john'\n})\n\nconsole.log(response) // Hello, John Doe! How are you doing?\n```\n\nRead the complete documentation [here](https://docs.orama.com/open-source/usage/answer-engine/introduction).\n\n# Official Docs\n\nRead the complete documentation at [https://docs.orama.com/open-source](https://docs.orama.com/open-source).\n\n# Official Orama Plugins\n\n- [Plugin Embeddings](https://docs.orama.com/open-source/plugins/plugin-embeddings)\n- [Plugin Secure Proxy](https://docs.orama.com/open-source/plugins/plugin-secure-proxy)\n- [Plugin Analytics](https://docs.orama.com/open-source/plugins/plugin-analytics)\n- [Plugin Data Persistence](https://docs.orama.com/open-source/plugins/plugin-data-persistence)\n- [Plugin QPS](https://docs.orama.com/open-source/plugins/plugin-qps)\n- [Plugin PT15](https://docs.orama.com/open-source/plugins/plugin-pt15)\n- [Plugin Vitepress](https://docs.orama.com/open-source/plugins/plugin-vitepress)\n- [Plugin Docusaurus](https://docs.orama.com/open-source/plugins/plugin-docusaurus)\n- [Plugin Astro](https://docs.orama.com/open-source/plugins/plugin-astro)\n- [Plugin Nextra](https://docs.orama.com/open-source/plugins/plugin-nextra)\n\nWrite your own plugin: [https://docs.orama.com/open-source/plugins/writing-your-own-plugins](https://docs.orama.com/open-source/plugins/writing-your-own-plugins)\n\n# License\n\nOrama is licensed under the [Apache 2.0](/LICENSE.md) license.\n","funding_links":[],"categories":["Vector Database Engines","Search","TypeScript","数据搜索引擎","Extensions"],"sub_categories":["Refs","网络服务_其他","Utilities"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foramasearch%2Forama","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foramasearch%2Forama","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foramasearch%2Forama/lists"}