New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@memofs/server

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@memofs/server

Self-hostable MemoFS runtime server for Node and Cloudflare Workers deployments.

latest
Source
npmnpm
Version
1.3.0-beta.2
Version published
Weekly downloads
2
-90.48%
Maintainers
1
Weekly downloads
 
Created
Source

@memofs/server

npm version   Status: Beta   npm downloads   CI   Docs   MIT License

Self-hostable MemoFS runtime server for Node and Cloudflare Workers deployments.

What is this?

The OSS-deployable hosted-memory server for MemoFS. Runs the same memory engine MemoFS Cloud runs, over a memory store you bring, with no provider hardcoding. MemoFS Cloud runs this package as its runtime worker; you can run the identical code on your own infra as a single Node process — the only difference is which adapters you inject.

Bring your own blob store, metadata store, embedder, reranker, extractor, and LLM client. No vendor lock-in. No MemoFS Cloud dependency.

Installation

npm install @memofs/server

Requires Node.js >= 22.

Quick Start

import { createHostedRuntime } from "@memofs/server";
import { InMemoryMemoryStore } from "@memofs/core";

const runtime = createHostedRuntime({
  // The only required slot: the memory store (your file replica).
  store: new InMemoryMemoryStore(),
  projectId: "my-project",

  // Optional intelligence slots — each runs its deterministic default
  // when omitted (lexical recall, rule-based extraction, no LLM tier).
  // Inject a provider adapter to upgrade a slot.
  embedder: yourEmbedder,
  reranker: yourReranker,
  extractor: yourExtractor,
  llmClient: yourLlmClient,
});

await runtime.writeMemory({ content: "self-hosted runtime runs the engine" });
const hits = await runtime.recall("self-hosted");

The one required slot: store

A memory runtime needs files to read and write. That is the store — your memory store (the file replica). MemoFS Cloud builds it from Cloudflare R2 + Turso; you build it from whatever you run (S3 + Postgres, GCS + D1, or anything else that implements MemoryStore). There is no default to fall back on.

Deterministic defaults, adapter-enhanced

Every intelligence slot is optional. When you omit one, the runtime runs its deterministic default:

SlotOmitted defaultUpgrade
embedderLexical-only recall (BM25 + fuzzy)Inject for hybrid (vector) recall
rerankerLexical token-overlap rerankerInject for semantic reranking
extractorRule-based graph extractorInject for frontier extraction
llmClientNo LLM tier (regex/deterministic strategist)Inject for LLM-enhanced intelligence

The same runtime works zero-config or fully enhanced. Inject only what you need.

Boundary

This package assembles a MemoFS instance from adapters you provide. It never reads environment variables, never imports an adapter package, and never hardcodes a provider. The store and provider choices belong to you (or to the cloud, when it consumes this same factory).

The HTTP runtime API (JSON-RPC over HTTP)

The same engine is reachable over HTTP — the two-Worker boundary. An OSS self-hoster deploys it as a Node single process; MemoFS Cloud deploys it as the runtime Worker behind a Service Binding. Both run identical code.

Deploy targets

# Node single process (Fly / Railway / VPS) — the bin boots a node:http server.
PORT=8787 node dist/bin/memofs-server.mjs
curl http://127.0.0.1:8787/health # {"ok":true,...}
// Cloudflare Worker — the runtime Worker entry.
import { createRuntimeFetchHandler } from "@memofs/server/worker";

export default {
 fetch: createRuntimeFetchHandler({
 createRuntime: (env) => buildRuntimeFromBindings(env),
 requireAuth: false, // behind a private Service Binding
 }),
};

See examples/server/ for the full self-host deploy guide (the canonical R2-compatible + Turso + OpenAI bundle, auth, and the Worker topology).

The method surface

POST / takes a JSON-RPC 2.0 body. Reads are live today; mutating methods are gated (see below).

MethodWhat it doesStatus
healthLiveness probeLive
recall / contextSemantic recall / task briefingLive
memory.readCore / readNotes / readConversationsRead memory docsLive
memory.listRecent / validateRecent events / integrityLive
graph.listNodes / listEdges / neighbors / pathGraph readsLive
snapshots.listList snapshotsLive
memory.write / recordNote / updateCore / appendConversationMutatingGated (503)
graph.upsertNodes / upsertEdgesMutatingGated (503)
consolidate / snapshots.create / snapshots.restoreMutatingGated (503)

The write-gate (important)

Every mutating method returns 503 until the concurrency layer ships. This is deliberate: concurrent writes to the same project would silently lose data under last-writer-wins, so no write surface is reachable before the serialization layer that makes writes safe exists. The gate is "method rejects," never "method present unsafely."

Reads work fully today. To write memory programmatically before the gate lifts, use the MemoFS client directly in-process.

Status

  • Reads are live — recall, context, memory.readCore, memory.readNotes, memory.readConversations, memory.listRecent, memory.validate, graph.* reads, and snapshots.list all work today.
  • Writes are gated — every mutating method returns 503 until the concurrency layer lands. This prevents silent data loss from concurrent last-writer-wins writes. To write memory programmatically, use the MemoFS client directly in-process.

For a complete list of all available methods, refer to the Full Documentation.

License

MIT

Keywords

memory

FAQs

Package last updated on 16 Aug 2026

Related posts