WOLBΛRG

Installation

Install Wolbarg and optional peer packages for PDF, DOCX, OCR, and PostgreSQL.

What is it?

The install guide for the Wolbarg npm package and the optional peer dependencies that unlock document formats and storage backends.

Requirements

  • Node.js 22.5+ (uses built-in node:sqlite)
  • An OpenAI-compatible embedding endpoint (required for remember/recall)
  • An LLM endpoint only if you use compress()

Install

npm install wolbarg
pnpm add wolbarg
yarn add wolbarg
bun add wolbarg

Optional peers

Install only what you need:

npm install pg              # PostgreSQL storage
npm install pdf-parse@1.1.4 # PDF ingest (text-layer PDFs)
npm install mammoth         # DOCX ingest
npm install tesseract.js    # OCR on images

Peers are not bundled

If you call ingest() on PDF or DOCX files, you must install the matching peer in the same app that depends on Wolbarg:

  • pdf-parse for .pdf
  • mammoth for .docx
  • tesseract.js and/or a vision provider for images / scan-only PDFs

Plain text formats (.txt, .md, .csv, .json) need no extra packages. Missing peers throw a configuration error when that format is used — not at import time.

Prefer pinning pdf-parse@1.1.4 for the function API Wolbarg v0.2 tests against.

Verify

import { Wolbarg, sqlite, openaiEmbedding } from "wolbarg";

const ctx = new Wolbarg({
  organization: "demo",
  storage: sqlite(":memory:"),
  embedding: openaiEmbedding({
    apiKey: process.env.OPENAI_API_KEY!,
    model: "text-embedding-3-small",
  }),
});

await ctx.ready();
console.log(ctx.isInitialized); // true
await ctx.close();