WOLBΛRG

Example — OCR

Extract text from images with tesseract during ingest.

npm install tesseract.js
import { Wolbarg, sqlite, openaiEmbedding, tesseract } from "wolbarg";

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

await ctx.ingest({
  agent: "ocr",
  source: { path: "./receipt.png" },
});

On this page