WOLBΛRG

Document Ingestion

Parse PDF, DOCX, Markdown, and other documents into chunked semantic memories with ingest().

What is it?

ingest() parses a document, chunks it, embeds each chunk, and stores memories in batch.

Why does it exist?

Agents need grounded knowledge from handbooks, tickets, and product docs — not only free-form remember() calls.

How does it work?

Pipeline: parse → OCR/vision (if configured) → chunk → embed (batch) → store (batch transaction).

Sources

source: { path: "./file.pdf" }
source: { buffer: buf, filename: "file.docx" }
source: { text: "# Markdown…" }

Formats

FamilyExtensionsPeer required
Text.txt .md .csv .jsonNone
PDF.pdfpdf-parse@1.1.4
DOCX.docxmammoth
Images.png .jpg .jpeg .webpOCR and/or vision
npm install pdf-parse@1.1.4   # required for .pdf
npm install mammoth           # required for .docx

Peers are not bundled with Wolbarg. Missing peers throw when that format is used.

Example

const result = await ctx.ingest({
  agent: "docs",
  source: { path: "./handbook.pdf" },
  chunking: { strategy: "paragraph", chunkSize: 1000, overlap: 120 },
  metadata: { collection: "handbook" },
});
console.log(result.chunkCount);

When should it be used?

Knowledge bases, onboarding PDFs, and any offline corpus that should become recallable memory.