Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
EntityDB is an in-browser vector database wrapping indexedDB and Transformers.js over WebAssembly
| Date | Stars |
|---|---|
| 2026-07-24 | 295 |
| 2026-07-25 | 295 |
| 2026-07-28 | 295 |
| 2026-07-30 | 295 |
| 2026-07-31 | 296 |
| 2026-08-06 | 296 |
Today
— stars today
This week
+1 stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.34%/day
# EntityDB - Decentralized Ai Memory
### Storing Vector Embeddings In The Browser wrapping indexedDB and Transformers.js

## Demo: [See EntityDB in action!](https://entity-db-landing.vercel.app/)
## Overview
**EntityDB** is a powerful, lightweight in-browser database designed for storing and querying vectors. It integrates seamlessly with [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) for persistent storage and [Transformers.js](https://github.com/xenova/transformers) to generate embeddings from text, allowing you to build fast and efficient search systems with state-of-the-art models. Whether you're building search engines, recommendation systems, Ai memory or any app requiring vector similarity, EntityDB has got you covered.
## Installation
To install **EntityDB** in your project, run:
```bash
npm install @babycommando/entity-db
```
```bash
yarn add @babycommando/entity-db
```
```bash
pnpm add @babycommando/entity-db
```
```bash
bun add @babycommando/entity-db
```
## Features
- **In-browser**: Runs entirely in the browser using IndexedDB for local storage.
- **Seamless Integration with Transformers**: Easily generate text embeddings with Hugging Face models via Transformers.js.
- **Cosine Similarity Search**: Efficient querying based on cosine similarity between vectors.
- **Flexible**: Supports both automatic embedding generation and manual insertion of pre-computed embeddings.
- **Lightweight**: No need for a server-side component or complex setup.

## Usage
### Importing the Library
```js
import { EntityDB } from "@babycommando/entity-db";
// Initialize the VectorDB instance
const db = new EntityDB({
vectorPath: "db_name",
model: "Xenova/all-MiniLM-L6-v2", // a HuggingFace embeddings model
});
```
### Inserting Data with Automatic Embedding Generation
You can insert data by simply passing a text field. The library will automatically generate embeddings using the specified transformer model.
```js
await db.insert({
text: "This is a sample text to embed",
});
```
### Inserting Manual Vectors
If you already have precomputed vectors, you can insert them directly into the database.
```js
await db.insertManualVectors({
text: "Another sample",
embedding: [0.1, 0.2, 0.3, ...] // your precomputed embedding
});
```
### Querying (Cosine Similarity)
You can query the database by providing a text, and EntityDB will return the most similar results based on cosine similarity.
```js
const results = await db.query("Find similar texts based on this query");
console.log(results);
```
### Querying Manual Vectors
If you have precomputed vectors and want to query them directly, use the queryManualVectors method.
```js
const queryVector = [0.1, 0.2, 0.3, ...]; // your precomputed query vector
const results = await db.queryManualVectors(queryVector);
console.log(results);
```
### Updating a Vector in the Database
If you need to update an existing vector in the database:
```js
await db.update("1234", {
vector: [0.4, 0.5, 0.6], // Updated vector data
metadata: { name: "Updated Item" }, // Additional updated data
});
```
### Deleting Data
You can delete a vector by its key.
```js
await db.delete(1);
```
---
## Experimental: Binary Vectors
While querying vectors by cosine similarity is already extremely fast, sometimes you want to go faster than light. Binary vectors are simplified versions of dense vectors where each value is turned into either a 0 or a 1 by comparing it to the middle value (median). This makes them smaller to store and faster to compare, which helps when working with a lot of data.
Note that this simplification can reduce the quality of the results because some detailed information in the original dense vector is lost. Use it for very long searches. For example, the set of vectors produced by _all-MiniLM-L6-v2_:
`[ -0Excerpt of 7,449 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:e828a0a62b6ca12c, topic:vector-database, desc:vector database, readme:similarity search
matched fp:e828a0a62b6ca12c, topic:embeddings, readme:text embeddings