Sign In

@memharness/embed

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@memharness/embed

Local, offline-after-download text embeddings for memharness hybrid recall. Lives outside @memharness/core so the storage write path stays model-free (I5).

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

@memharness/embed

Optional local embedding model for memharness hybrid (semantic) recall. Wraps BGE-small (Xenova/bge-small-en-v1.5, 384-dim, ~130MB) via transformers.js. The model is downloaded once from the HuggingFace hub, then runs fully offline: no API key, no per-query network.

This is a separate, optional package so that @memharness/core stays model-free and the default server install stays small. The @memharness/mcp server uses it only when MEMHARNESS_HYBRID=1 and this package is installed.

Use

import { embedDocuments, embedQuery, EMBED_MODEL, EMBED_DIM } from "@memharness/embed";

const [doc] = await embedDocuments(["user: drinks oolong tea"]); // store with setEmbedding
const q = await embedQuery("favorite beverage");                 // pass to recall({ queryVector })

embedQuery prepends the BGE retrieval instruction; embedDocuments does not. Pass setEmbedProgress(fn) before first use to surface model-download progress.

License

Apache-2.0

Keywords

memory

FAQs

Package last updated on 18 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts