@memofs/adapter-workers-ai
v1.3.0-beta.2
Published
Cloudflare Workers AI extractor adapter for MemoFS.
Maintainers
Readme
@memofs/adapter-workers-ai
Cloudflare Workers AI extractor adapter for MemoFS.
What is this?
Cloudflare Workers AI frontier extractor adapter for MemoFS. Implements
core's provider-neutral Extractor contract against a Cloudflare Workers AI
binding (env.AI), extracting subject–predicate–object facts into the memory
graph.
Installation
npm install @memofs/adapter-workers-aiRequires Node.js >= 22.
Peer dependency: @cloudflare/workers-types (for the Ai binding type).
Quick Start
import { createWorkersAiExtractor } from "@memofs/adapter-workers-ai";
const extractor = createWorkersAiExtractor({ ai: env.AI });
// Pass it to the MemoFS runtime:
// new MemoFS({ store, projectId, mode: "local", extractor, ... })Resilience
The adapter parses the model's output defensively: malformed JSON, missing
fields, or unknown relation types are dropped (never thrown). A failed
extraction returns an empty { nodes, edges }, so the write fan-out stays
resilient — and the rule-based extractor remains available as the fallback when
no Ai binding is configured.
Boundary
This package owns the Workers AI extractor adapter implementation. It does not
own the MemoFS core Extractor contract, other adapters, or the Workers AI
service itself.
Contributing
See our central Contributing Guide and development scripts for details on formatting, linting, and testing within the monorepo.
License
MIT
