# @batalabs/virlow-memory

Embedding and similarity primitives behind [Virlow](https://virlow.com)
memories: a pinned local embedding model, cosine ranking, and the two-tier
dedupe thresholds.

The embedder is a separate entry point so consumers that only need vector maths
do not pull in `@huggingface/transformers`:

```ts
import { cosineSimilarity, findSimilar, DEDUPE_UPDATE_THRESHOLD } from '@batalabs/virlow-memory';
import { createEmbedder } from '@batalabs/virlow-memory/embedder';
```

Dedupe is two-tier by design: at or above `DEDUPE_UPDATE_THRESHOLD` (0.9) a
memory is the same memory and is updated in place; between
`DEDUPE_REPORT_THRESHOLD` (0.7) and that, it is stored and the caller is told
what it resembles.

Published from [batalabs/virlow-app](https://git.typelets.com/batalabs/virlow-app).
