\
entity — en.tɪ.ti \n Something that exists apart from other things, having its own independent existance.
\ Before the year ended a series of eye-opening realizations came to my mind about how agent architectures are deployed and what tools are necessary for them to evolve into fully autonomous entities.
\ What started as 0xEntity (github) — a simple decentralized/open reservoir of seeds for personalities made on top of the Interplanetary File System (IPFS)- ended up containing a whole “Entity OS/BIOS” packed inside a browser. All powered by WebAssembly.
\ These systems, fundamentally tied to the machine, need an unrestricted direct interface with their environment.
WebAssembly And Ai EntitiesDuring the excercise of writing 0xEntity’s agent chat I added a v86 browser-based Alpine Linux virtual machine running over wasm and gave the Ai total control over it — without the hassle of setting up a server with a docker container. All running in the browser.
\ When I first learned about WASM I wasn’t entirely sure where it would take me. But now I can confidently say that this approach is something special. It’s not just a technical marvel; it’s a total game-changer for building systems without the sweaty hassle of traditional server-based infrastructures.
\ For entities, memory is key — they need to remember. This is where vector databases shine, storing and querying data to give them the ability to learn and adapt. What if you could ditch the server altogether? What if the entity memory could live directly within your browser, intelligently and efficiently? That’s exactly what EntityDB does.
EntityDB Basic Usage: Building a Vector Store in Your BrowserInstall with:
npm install @babycommando/entity-db\ And initialize the DB with:
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 }); // Insert data (will be embedded) await db.insert({ text: "This is a sample text to embed", }); // Query (Cosine Similarity) const results = await db.query("Find similar texts based on this query"); console.log(results); // Insert Vector Embeddings Manually await db.insertManualVectors({ text: "Another sample", embedding: [0.1, 0.2, 0.3, …] // your precomputed embedding });\ You can check your developer tools at the Application tab, under the IndexedDB your vector database created and working.
\
\ You can find the complete documentation at the github repo!
The Power of LocalSo, how can this kind of work be done without a server? Enter Transformers.js, a brilliant library built on top of WebAssembly that seamlessly integrates HuggingFace models into the browser. This allow us to transform raw text into vectorized data, making complex queries like searching for recommendations possible.
\ When paired with IndexedDB — the persistent local storage engine already built into browsers, we can make it happen. It provides a place to store large chunks of data within your browser and without requiring an internet connection.
\ The best part? It’s as simple as running a few pieces of code and letting the browser do its thing.
\
\
The Road AheadWhile EntityDB is still in its early stages, I’m excited about where it is headed. The possibilities for in-browser vector databases are endless, from personalized search engines to fully decentralized IPFS intelligent entities. With the power of IndexedDB and Transformers.js, we’re not just storing data; we’re creating smarter agents that can learn, adapt, and grow in real-time.
\ Memory is essential, so as so many other tools that enable the digital world touch the physical one. Making sure that they function locally are crucial for entities — autonomous code that interacts with environments, learns, and makes decisions, relying on efficient data storage and querying to navigate their world.
\ This project is completely free and open source, licensed under the Apache License 2.0. Contributions are super welcome.
\ Give EntityDB a star on github!
All Rights Reserved. Copyright , Central Coast Communications, Inc.