
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
@monoes/memory
Advanced tools
Memory module - JSON pattern store, LanceDB + embeddings backend, and a standalone pure-JS HNSW index; three coexisting paths, not a single unified backend
Persistent memory backends for Monomind agents — SQLite (native or WASM) key-value storage, an optional LanceDB vector backend, a pure-JS HNSW index, JSONL episodic memory, and a chunked knowledge store.
Part of the Monomind ecosystem. The only hard dependency is
sql.js(WASM);better-sqlite3and@lancedb/lancedbare optional and loaded dynamically when installed.
npm install @monoes/memory
# optional: native SQLite and vector search
npm install better-sqlite3 @lancedb/lancedb apache-arrow
| Export | What it does |
|---|---|
UnifiedMemoryService | High-level store/get/search facade backed by LanceDBBackend |
SQLiteBackend / SqlJsBackend | Structured key-value memory (native SQLite or zero-compile WASM) |
LanceDBBackend | Vector memory via @lancedb/lancedb (optional dependency, loaded lazily) |
HNSWIndex | Pure-JS approximate nearest-neighbor index with quantization support |
EpisodicStore | JSON-lines episodic memory — accumulates agent runs into summarized episodes |
chunkDocument, KnowledgeStore, KnowledgeRetriever | Document chunking + retrieval for knowledge bases |
QueryBuilder / query() | Fluent query construction (namespace, tags, threshold, sort) |
CacheManager, TieredCacheManager | LRU caching with size/TTL limits |
createDatabase, getPlatformInfo | Platform-aware provider selection (better-sqlite3 → sql.js → JSON fallback) |
SwarmCheckpointer | Persist/restore swarm agent state snapshots |
MemoryMigrator | Import from SQLite, JSON, or Markdown sources |
PromptVersionStore, ControllerRegistry | Prompt version history; init-level controller registry |
Note: Monomind's live hook/routing hot path uses plain JSON pattern files and keyword-based episodic recall — the vector backends here are opt-in, used when an embedding generator and the optional native dependencies are provided.
import { SQLiteBackend } from '@monoes/memory';
const backend = new SQLiteBackend({ databasePath: './data/memory.db' });
await backend.initialize();
await backend.store({
id: 'mem-1',
key: 'user-preference',
content: 'User prefers dark mode',
type: 'semantic',
namespace: 'preferences',
tags: ['ui'],
});
const entry = await backend.getByKey('preferences', 'user-preference');
import { UnifiedMemoryService } from '@monoes/memory';
// Requires @lancedb/lancedb + apache-arrow installed
const memory = new UnifiedMemoryService({
persistencePath: './data/lancedb',
dimensions: 1536,
embeddingGenerator: async (text) => myEmbedder.embed(text),
});
await memory.initialize();
Or use the standalone pure-JS index directly:
import { HNSWIndex } from '@monoes/memory';
const index = new HNSWIndex({ dimensions: 1536, M: 16, efConstruction: 200, metric: 'cosine' });
await index.addPoint('mem-1', new Float32Array(embedding));
const results = await index.search(queryVector, 10);
// [{ id: 'mem-1', distance: 0.05 }, ...]
import { EpisodicStore } from '@monoes/memory';
const store = new EpisodicStore({ filePath: './data/episodes.jsonl', maxRunsPerEpisode: 20 });
// Accumulates agent runs into episodes, one JSON object per line
import { query } from '@monoes/memory';
const q = query()
.semantic('authentication patterns')
.inNamespace('security')
.withTags(['auth'])
.threshold(0.7)
.limit(20)
.sortByNewest()
.build();
createDatabase() picks the best available provider per platform:
better-sqlite3 (native, fastest) → sql.js (WASM, zero compilation, works
everywhere including Windows without a toolchain) → JSON file fallback. See
docs/CROSS_PLATFORM.md and docs/WINDOWS_SUPPORT.md.
MIT
FAQs
Memory module - JSON pattern store and a SQLite + embeddings backend with a size-gated HNSW ANN fast path built in
The npm package @monoes/memory receives a total of 1,447 weekly downloads. As such, @monoes/memory popularity was classified as popular.
We found that @monoes/memory demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.