# Wolbarg — Full Documentation
> Complete Markdown export of Wolbarg docs for AI systems. Prefer /llms.txt for a curated index.
Generated from 51 documentation pages.
---
# Architecture
> How Wolbarg subsystems connect — Application, Wolbarg, Storage, Retrieval, Providers, and Database.
URL: /docs/architecture
## What is it? [#what-is-it]
The structural model of Wolbarg: a thin orchestration layer over storage, retrieval, and swappable providers.
## Why does it exist? [#why-does-it-exist]
Understanding the pipeline makes configuration and failure modes predictable.
## How does it work? [#how-does-it-work]
```mermaid
flowchart TD
App[Application / Agents]
Core[Wolbarg facade]
Mem[Memory operations]
Ret[Retrieval pipeline]
Store[Storage provider]
Prov[Providers]
DB[(SQLite or PostgreSQL)]
App --> Core
Core --> Mem
Core --> Ret
Mem --> Store
Ret --> Store
Core --> Prov
Store --> DB
Prov --> Emb[Embedding]
Prov --> Llm[LLM]
Prov --> Kw[BM25 keyword]
Prov --> Rr[Reranker]
Prov --> Ocr[OCR]
Prov --> Vis[Vision]
Prov --> Ch[Chunking]
```
### Application [#application]
Your agents, tools, or server. They hold one `Wolbarg` instance per process / organization and call the public API.
### Wolbarg facade [#wolbarg-facade]
Owns lifecycle (`ready`, `close`), validates options, selects providers, and exposes `remember`, `recall`, `ingest`, `compress`, `forget`, `history`, `stats`, `clear`.
### Memory operations [#memory-operations]
* **remember** — embed + insert + optional keyword index update
* **ingest** — parse → enrich → chunk → batch embed → batch insert
* **compress** — LLM summarize + optional archive
* **forget** — delete by id or filter
### Retrieval pipeline [#retrieval-pipeline]
1. Embed query
2. Vector search (+ optional BM25)
3. Metadata / agent filters
4. Optional MMR
5. Optional rerank
6. Return `RecallResult[]`
### Storage provider [#storage-provider]
Abstracts SQLite vs PostgreSQL: vectors, metadata, history, transactions, migrations.
### Providers [#providers]
Network or local adapters for embeddings, LLM, keyword search, rerank, OCR, vision, chunking, compression. Missing optional providers degrade gracefully or fail cleanly per method.
### Database [#database]
Physical persistence — a SQLite file with WAL / FTS5 / sqlite-vec, or PostgreSQL with JSONB / optional pgvector.
## When should you read this? [#when-should-you-read-this]
Before choosing backends, tuning retrieval, or debugging “why hybrid did nothing” (usually missing `keywordSearch`).
## Related pages [#related-pages]
* [Provider Architecture](/docs/providers)
* [Semantic Search](/docs/search)
* [SQLite Backend](/docs/storage/sqlite)
* [PostgreSQL Backend](/docs/storage/postgresql)
---
# Benchmarks
> Methodology, hardware, metrics, reproducibility, and interpretation of Wolbarg v0.2.1 dual-backend performance results.
URL: /docs/benchmarks
## What is it? [#what-is-it]
How Wolbarg **v0.2.1** measures startup, insert, search, retrieval, hybrid/filters/MMR, ingest, forget, compression, memory, database size, and **push-to-failure concurrency** on **SQLite and PostgreSQL**.
Two suites — do not mix them:
| Suite | Embeddings | What it measures |
| ------------------ | ----------------------------------- | ---------------------------------------------------- |
| **Storage** (mock) | Local mock OpenAI-compatible server | SDK + database ceiling (I/O, indexes, concurrency) |
| **LIVE** | Real providers (OpenAI, etc.) | End-to-end latency including network + provider time |
Interactive charts: [/benchmarks](/benchmarks). Raw downloads: [/benchmarks/benchmark.json](/benchmarks/benchmark.json) · [/benchmarks/benchmark.md](/benchmarks/benchmark.md). Public suite: [`wolbarg-benchmarks`](https://github.com/Atharvmunde11/wolbarg-benchmarks).
The published site artifact is **scale=quick** (corpora **100** and **1k**). Larger scales (10k / 100k) are not in this publish — run the suite locally rather than inventing a curve.
## Why does it exist? [#why-does-it-exist]
Vendor graphs without methodology mislead. These docs explain *what was measured* so you can compare fairly and reproduce locally — especially the difference between **mock stress** and **live API spots**.
## Methodology [#methodology]
### Mock vs LIVE (read this) [#mock-vs-live-read-this]
**Primary stress and push-to-failure concurrency use a local mock OpenAI-compatible embedding/LLM server.** Live OpenAI is **not** used for failure ramps because API **rate limits and quota errors would dominate long before SQLite or PostgreSQL contention**, masking true Wolbarg/storage breaking points.
A separate **LIVE spot suite** (`npm run benchmark:live`) reports real-network latency for representative insert / search / hybrid / ingest / compress / vision paths. It does **not** ramp concurrency to failure.
### Failure criteria (breaking ramps) [#failure-criteria-breaking-ramps]
A concurrency level fails when:
* `errorRate > 1%`, **or**
* `p95 latency > 5s`, **or**
* a hard integrity/exception failure (duplicate IDs, crash, etc.)
Reports record `lastHealthyLevel` and `breakingLevel` with reason (`error_rate` | `p95_sla` | `exception` | `integrity` | `cap`).
### Storage matrix [#storage-matrix]
Every workload runs on:
| Backend | Notes |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| SQLite | Local file + WAL |
| PostgreSQL | **Local Docker only** (`pgvector/pg17` via `benchmark/docker-compose.yml`). Hosted Neon/Supabase/Railway URLs are refused — they measure network RTT, not Wolbarg. |
Start Postgres before dual-backend runs:
```bash
cd benchmark
npm run postgres:up
npm run benchmark:brutal
```
Prefer fresh local Docker numbers over older hosted or misconfigured Postgres runs when comparing backends.
### Modes & scales [#modes--scales]
| Command | Mode | Scale | Failure ramps |
| ---------------------------- | ----------- | ------------- | ---------------- |
| `npm run benchmark` | mock | full | yes |
| `npm run benchmark:quick` | mock | quick | no |
| `npm run benchmark:brutal` | mock | brutal | yes (up to 4096) |
| `npm run benchmark:live` | live | spot | **no** |
| `npm run benchmark:sqlite` | mock brutal | sqlite only | yes |
| `npm run benchmark:postgres` | mock brutal | postgres only | yes |
### Metrics [#metrics]
| Benchmark | What it means |
| ------------------------ | ------------------------------------------------- |
| Startup cold/warm | Time to `ready()` + probe providers |
| Insert ops/sec | Sustained `remember` throughput |
| Search / Retrieval | Semantic recall latency at scale |
| Hybrid / Filters / MMR | v0.2 retrieval feature overhead |
| Ingest / Chunking | Document → chunks → embed → store |
| Forget / Clear | Delete latency + integrity |
| Concurrency baseline | Fixed writer counts on one client |
| **Breaking concurrency** | Write / read / mixed ramps until SLA or hard fail |
| Compression % | Active-set reduction after `compress` |
| DB size | On-disk / relation growth |
| Memory usage | Heap / RSS snapshots |
### Hardware (example) [#hardware-example]
Always read the environment block in the latest `Benchmarks.md` artifact for the run you cite (Node, CPU, RAM, mode, backends, dims).
### Dataset [#dataset]
Synthetic memories with fixed text templates. Mock dims default **384**; live typically **1536** (`text-embedding-3-small`). Labels (`100`, `1000`, `10000`, `100000`) are memory counts.
### Reproducibility [#reproducibility]
```bash
cd benchmark
npm install
cp .env.example .env # set DATABASE_URL for postgres; API keys for --live
npm run benchmark:brutal
# or
npm run benchmark:live
```
Prefer recording: date, SDK version (`wolbarg@0.2.1`), Node version, CPU/RAM, mode (`mock`/`live`), backends, and git SHA.
## Interpretation [#interpretation]
* **Startup ms** — agents open memory without multi-second cold starts
* **Search vs scale** — know when Postgres/pgvector or sharding strategies matter
* **Breaking levels** — last healthy concurrent readers/writers before SLA breach
* **Mock ≠ hosted SaaS** — do not compare mock embed timings to managed GPU indexes
* **Storage (mock) ≠ LIVE** — never mix the two suites in one comparison cell
## Related pages [#related-pages]
* [Performance](/docs/performance)
* [Architecture](/docs/architecture)
* [SQLite](/docs/storage/sqlite) · [PostgreSQL](/docs/storage/postgresql)
* Live page: [/benchmarks](/benchmarks)
* Raw: [/benchmarks/benchmark.json](/benchmarks/benchmark.json) · [/benchmarks/benchmark.md](/benchmarks/benchmark.md)
---
# Chunking
> Pluggable chunking strategies for document ingest — fixed, sentence, paragraph, markdown, heading.
URL: /docs/chunking
## What is it? [#what-is-it]
Replaceable strategies that split extracted document text into embeddable chunks before storage.
## Why does it exist? [#why-does-it-exist]
Embedding quality depends on chunk boundaries. Markdown headings need different splits than prose or logs.
## How does it work? [#how-does-it-work]
```ts
import { createChunkingStrategy } from "wolbarg";
createChunkingStrategy("fixed")
createChunkingStrategy("sentence") // default when no markdown headings
createChunkingStrategy("paragraph")
createChunkingStrategy("markdown") // auto-inferred when headings present
createChunkingStrategy("heading")
```
Per-call options:
```ts
await ctx.ingest({
agent: "docs",
source: { path: "./guide.md" },
chunking: {
strategy: "markdown",
chunkSize: 800,
overlap: 100,
},
});
```
Set a default on the constructor with `chunking: createChunkingStrategy("markdown")`.
## When should it be used? [#when-should-it-be-used]
* `markdown` / `heading` for docs sites and READMEs
* `paragraph` for long articles
* `sentence` for dense prose
* `fixed` for uniform token budgets
## Performance notes [#performance-notes]
* Smaller chunks improve precision, increase storage and recall noise
* Overlap reduces boundary drops for multi-sentence facts
* Batch embedding amortizes network cost during ingest
## Related pages [#related-pages]
* [Document Ingestion](/docs/document-ingestion)
* [Provider Architecture](/docs/providers)
* [Performance](/docs/performance)
---
# Compression Pipeline
> Summarize and archive memories with an optional LLM via compress().
URL: /docs/compression
## What is it? [#what-is-it]
`compress()` uses a configured LLM to summarize selected memories into a compact record and optionally archive the originals.
## Why does it exist? [#why-does-it-exist]
Long agent histories explode context and storage. Compression keeps signal while shrinking volume.
## How does it work? [#how-does-it-work]
Requires `llm` on the constructor (compile-time + runtime):
```ts
import { Wolbarg, sqlite, openaiEmbedding, openaiLlm } from "wolbarg";
const ctx = new Wolbarg({
organization: "my-org",
storage: sqlite("./memory.db"),
embedding: openaiEmbedding({ /* … */ }),
llm: openaiLlm({
apiKey: process.env.OPENAI_API_KEY!,
model: "gpt-4.1-mini",
}),
});
const result = await ctx.compress({
agent: "research",
// filter / ids / strategy options per CompressOptions
});
```
Without `llm`, TypeScript rejects `compress` and runtime throws `ProviderNotConfiguredError`.
## When should it be used? [#when-should-it-be-used]
Periodic maintenance jobs, end-of-session summarization, or when agent history exceeds a token budget.
## Performance notes [#performance-notes]
* Dominated by LLM latency and input size
* Published mock suite shows high reduction ratios — verify on your own texts
* Archive carefully if you need reversible history (`history()` still tracks events)
## Related pages [#related-pages]
* [Provider Architecture](/docs/providers)
* [Example — Compression](/docs/examples/compression)
* [API lifecycle](/docs/api/lifecycle)
---
# Configuration
> Required and optional constructor options for Wolbarg — organization, storage, embedding, and providers.
URL: /docs/configuration
## What is it? [#what-is-it]
The constructor API for `new Wolbarg(options)`. Three options are required; everything else is optional and enables a specific capability.
## Why does it exist? [#why-does-it-exist]
Wolbarg uses constructor dependency injection so you compose only the backends you need — no global config files, no hidden services.
## Required [#required]
| Option | Type | Description |
| -------------- | -------------------------------------- | ---------------------------------------------------------- |
| `organization` | `string` | Namespace isolating memories in a shared database |
| `storage` | `StorageProvider \| StorageConfig` | `sqlite(...)` or `postgres(...)` |
| `embedding` | `EmbeddingProvider \| EmbeddingConfig` | Any OpenAI-compatible embedding factory or custom provider |
## Optional [#optional]
| Option | Enables |
| ---------------- | --------------------------------------------------- |
| `llm` | `compress()` (typed at compile time) |
| `keywordSearch` | Hybrid recall |
| `reranker` | `recall({ rerank: true })` |
| `ocr` / `vision` | Image ingest enrichment |
| `chunking` | Default ingest chunking strategy |
| `compression` | Custom compression provider (overrides llm default) |
| `retrieval` | Default hybrid / MMR / over-fetch settings |
## Full example [#full-example]
```ts
import {
Wolbarg, sqlite, openaiEmbedding, openaiLlm,
bm25, jinaReranker, tesseract, geminiVision,
} from "wolbarg";
const ctx = new Wolbarg({
organization: "my-org",
storage: sqlite("./memory.db"),
embedding: openaiEmbedding({
apiKey: process.env.OPENAI_API_KEY!,
model: "text-embedding-3-small",
}),
llm: openaiLlm({
apiKey: process.env.OPENAI_API_KEY!,
model: "gpt-4.1-mini",
}),
keywordSearch: bm25(),
reranker: jinaReranker({ apiKey: process.env.JINA_API_KEY! }),
ocr: tesseract(),
vision: geminiVision({ apiKey: process.env.GEMINI_API_KEY! }),
retrieval: {
overFetchFactor: 4,
hybrid: { semanticWeight: 0.7, keywordWeight: 0.3 },
},
});
```
## Lazy initialization [#lazy-initialization]
Storage opens and embedding dimensions are probed on the first API call, or when you call `await ctx.ready()`. Optional providers are not probed until used.
## Related pages [#related-pages]
* [Provider Architecture](/docs/providers)
* [SQLite Backend](/docs/storage/sqlite)
* [PostgreSQL Backend](/docs/storage/postgresql)
* [API](/docs/api)
---
# Document Ingestion
> Parse PDF, DOCX, Markdown, and other documents into chunked semantic memories with ingest().
URL: /docs/document-ingestion
## What is it? [#what-is-it]
`ingest()` parses a document, chunks it, embeds each chunk, and stores memories in batch.
## Why does it exist? [#why-does-it-exist]
Agents need grounded knowledge from handbooks, tickets, and product docs — not only free-form `remember()` calls.
## How does it work? [#how-does-it-work]
Pipeline: parse → OCR/vision (if configured) → chunk → embed (batch) → store (batch transaction).
### Sources [#sources]
```ts
source: { path: "./file.pdf" }
source: { buffer: buf, filename: "file.docx" }
source: { text: "# Markdown…" }
```
### Formats [#formats]
| Family | Extensions | Peer required |
| ------ | ----------------------------- | ----------------- |
| Text | `.txt` `.md` `.csv` `.json` | None |
| PDF | `.pdf` | `pdf-parse@1.1.4` |
| DOCX | `.docx` | `mammoth` |
| Images | `.png` `.jpg` `.jpeg` `.webp` | OCR and/or vision |
```bash
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 [#example]
```ts
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? [#when-should-it-be-used]
Knowledge bases, onboarding PDFs, and any offline corpus that should become recallable memory.
## Related pages [#related-pages]
* [Chunking](/docs/chunking)
* [Image Ingestion](/docs/image-ingestion)
* [OCR](/docs/ocr)
* [Example — PDF Memory](/docs/examples/pdf-memory)
* [ingest()](/docs/api/ingest)
---
# FAQ
> Frequently asked questions about Wolbarg installation, providers, storage, and retrieval.
URL: /docs/faq
## What is Wolbarg? [#what-is-wolbarg]
A TypeScript SDK for shared semantic memory across AI agents. It is not an agent framework and not a hosted vector database. See [Getting Started](/docs/getting-started).
## What Node version do I need? [#what-node-version-do-i-need]
Node.js **22.5+** because SQLite uses built-in `node:sqlite`.
## Why did hybrid search do nothing? [#why-did-hybrid-search-do-nothing]
You likely omitted `keywordSearch: bm25()`. Without it, `hybrid: true` falls back to semantic-only. See [Hybrid Search](/docs/hybrid-search).
## Do I need an LLM to use Wolbarg? [#do-i-need-an-llm-to-use-wolbarg]
No. LLM is required only for `compress()`. Remember/recall need storage + embedding.
## Why does PDF ingest fail? [#why-does-pdf-ingest-fail]
Install `pdf-parse@1.1.4` in your app. Scan-only PDFs without a text layer need OCR/vision on images. See [Document Ingestion](/docs/document-ingestion) and [Limitations](/docs/guides/limitations).
## Can I use PostgreSQL? [#can-i-use-postgresql]
Yes — `npm install pg` then `storage: postgres(url)`. See [PostgreSQL Backend](/docs/storage/postgresql).
## How do multiple agents share memory? [#how-do-multiple-agents-share-memory]
One `Wolbarg` instance, different `agent` ids on remember/recall filters. See [Multi-Agent Memory](/docs/guides/shared-memory).
## Where is the full docs dump for AI tools? [#where-is-the-full-docs-dump-for-ai-tools]
* [/llms.txt](/llms.txt) — curated index
* [/llms-full.txt](/llms-full.txt) — full Markdown export
* Append `.md` to any docs URL for that page as Markdown
## Related pages [#related-pages]
* [Getting Started](/docs/getting-started)
* [Installation](/docs/installation)
* [Limitations](/docs/guides/limitations)
---
# Getting Started
> What Wolbarg is, why it exists, and the core philosophy behind its provider architecture.
URL: /docs/getting-started
## What is Wolbarg? [#what-is-wolbarg]
Wolbarg is a TypeScript SDK that gives multiple AI agents a shared, persistent semantic memory. You store facts with `remember()`, retrieve them with `recall()`, optionally ingest documents, and compress memories when you need an LLM summary.
Version **0.2** rebuilds the internals around replaceable providers: storage, embeddings, keyword search, rerankers, OCR, vision, and chunking — while keeping the public API small.
## Why does it exist? [#why-does-it-exist]
Most agent stacks either bolt memory onto a chat transcript or depend on a hosted vector database. Wolbarg sits in between: a local-first (or bring-your-own Postgres) memory layer with explicit providers, ACID writes, and hybrid retrieval.
## Core philosophy [#core-philosophy]
* **Everything is configurable** — swap any provider.
* **Nothing is required unless necessary** — only `organization`, `storage`, and `embedding`.
* **Optional features degrade gracefully** — missing reranker / OCR / keyword search skips that step, no crash.
* **Calling a feature without its provider fails cleanly** — e.g. `compress` without `llm` is a TypeScript error and a runtime `ProviderNotConfiguredError`.
## What's in v0.2 [#whats-in-v02]
* Constructor DI + factory helpers (`sqlite`, `openaiEmbedding`, …)
* SQLite and PostgreSQL storage
* Hybrid recall (semantic + BM25), metadata filters, MMR, rerankers
* Document `ingest` (PDF, DOCX, Markdown, images + optional OCR/vision)
* Pluggable chunking strategies
* Optional LLM compression
## What it is not [#what-it-is-not]
* Not an agent / orchestration framework
* Not a hosted vector database SaaS
* Not a chat UI
## When should you use it? [#when-should-you-use-it]
Use Wolbarg when multiple agents (or one long-running agent) need durable, searchable memory with clear backends and no infrastructure lock-in.
## Related pages [#related-pages]
* [Installation](/docs/installation)
* [Quick Start](/docs/quick-start)
* [Architecture](/docs/architecture)
* [Limitations (v0.2)](/docs/guides/limitations)
* [Migration](/docs/migration)
---
# Hybrid Search
> Combine semantic vectors with BM25 keyword scores for more robust recall.
URL: /docs/hybrid-search
## What is it? [#what-is-it]
Hybrid search fuses semantic similarity with BM25 keyword scores so recall works for both meaning and exact tokens (IDs, product names, error codes).
## Why does it exist? [#why-does-it-exist]
Pure vector search can miss rare tokens. Pure keyword search misses paraphrase. Fusion covers both modes.
## How does it work? [#how-does-it-work]
### Setup [#setup]
```ts
import { bm25 } from "wolbarg";
new Wolbarg({
/* organization, storage, embedding */
keywordSearch: bm25(),
});
```
### Usage [#usage]
```ts
await ctx.recall({
query: "quick brown fox",
hybrid: true,
// or
hybrid: { semanticWeight: 0.7, keywordWeight: 0.3 },
});
```
Scores are normalized then fused. Tune weights for keyword-heavy vs semantic-heavy corpora.
### Fallback [#fallback]
If `keywordSearch` is not configured, hybrid quietly falls back to semantic-only search.
## When should it be used? [#when-should-it-be-used]
Enable hybrid when queries contain proprietary names, codes, or short literal strings mixed with natural language.
## Performance notes [#performance-notes]
* Requires FTS indexing on SQLite (schema v2) or equivalent keyword path
* Keyword index updates happen with remember/ingest/forget
* Slightly higher recall-time cost than semantic-only
## Related pages [#related-pages]
* [Semantic Search](/docs/search)
* [Rerankers](/docs/rerankers)
* [Example — Hybrid Search](/docs/examples/hybrid-search)
* [Provider Architecture](/docs/providers)
---
# Image Ingestion
> Store image-derived text as semantic memory using OCR and vision providers.
URL: /docs/image-ingestion
## What is it? [#what-is-it]
Ingesting `.png`, `.jpg`, `.jpeg`, and `.webp` files so visual content becomes searchable text memories.
## Why does it exist? [#why-does-it-exist]
Screenshots, UI captures, and slide photos often carry the facts agents need. Pure image bytes are not useful for text recall without extraction.
## How does it work? [#how-does-it-work]
Configure `ocr` and/or `vision`, then call `ingest` with an image path or buffer.
```ts
import { tesseract, geminiVision } from "wolbarg";
const ctx = new Wolbarg({
/* organization, storage, embedding */
ocr: tesseract(),
vision: geminiVision({ apiKey: process.env.GEMINI_API_KEY! }),
});
await ctx.ingest({
agent: "vision",
source: { path: "./screenshot.png" },
metadata: { kind: "ui-capture" },
});
```
OCR text, captions, descriptions, and entities are concatenated before chunking. If neither provider is configured, image ingest errors with a clear message unless other text is available.
## When should it be used? [#when-should-it-be-used]
Product screenshots, whiteboard photos, receipts, and charts where text/visual captions matter.
## Related pages [#related-pages]
* [OCR](/docs/ocr)
* [Vision Models](/docs/vision)
* [Example — Image Memory](/docs/examples/image-memory)
* [Document Ingestion](/docs/document-ingestion)
---
# Installation
> Install Wolbarg and optional peer packages for PDF, DOCX, OCR, and PostgreSQL.
URL: /docs/installation
## What is it? [#what-is-it]
The install guide for the `Wolbarg` npm package and the optional peer dependencies that unlock document formats and storage backends.
## Requirements [#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 [#install]
```bash
npm install wolbarg
```
```bash
pnpm add wolbarg
yarn add wolbarg
bun add wolbarg
```
## Optional peers [#optional-peers]
Install only what you need:
```bash
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
```
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 [#verify]
```ts
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();
```
## Related pages [#related-pages]
* [Quick Start](/docs/quick-start)
* [Document Ingestion](/docs/document-ingestion)
* [SQLite Backend](/docs/storage/sqlite)
* [PostgreSQL Backend](/docs/storage/postgresql)
* [Limitations](/docs/guides/limitations)
---
# Metadata Filtering
> Filter recall with meta.eq, contains, comparisons, and AND/OR/NOT boolean trees.
URL: /docs/metadata-filtering
## What is it? [#what-is-it]
Structured filters on memory metadata (and agent scope) applied during `recall()`, `forget()`, and related APIs.
## Why does it exist? [#why-does-it-exist]
Organizations share one store. Filters keep retrieval scoped to a topic, tenant facet, priority, or agent without re-embedding.
## How does it work? [#how-does-it-work]
```ts
import { meta } from "wolbarg";
meta.eq("topic", "billing")
meta.contains("title", "invoice")
meta.gt("score", 10)
meta.gte("score", 10)
meta.lt("score", 100)
meta.lte("score", 100)
meta.between("year", 2020, 2026)
meta.and(filterA, filterB)
meta.or(filterA, filterB)
meta.not(filterA)
```
```ts
await ctx.recall({
query: "pricing",
filter: {
agent: "sales",
metadata: meta.and(
meta.eq("region", "eu"),
meta.gte("priority", 2),
),
},
});
```
Opaque metadata is never validated by the SDK — store any JSON-serializable object and filter on known fields.
## When should it be used? [#when-should-it-be-used]
Always attach meaningful metadata at `remember` / `ingest` time. Prefer filters before raising `topK`.
## Related pages [#related-pages]
* [Semantic Search](/docs/search)
* [Example — Metadata Filtering](/docs/examples/metadata-filtering)
* [Best Practices](/docs/guides/best-practices)
---
# Migration
> Upgrade to Wolbarg 0.3 (rebrand from agentorc) and from 0.1 to 0.2 DI.
URL: /docs/migration
## What is it? [#what-is-it]
Guides for moving to Wolbarg — including the AgentOrc → Wolbarg rebrand (0.3) and the 0.1 → 0.2 constructor changes.
## 0.3 — AgentOrc → Wolbarg [#03--agentorc--wolbarg]
```bash
npm uninstall agentorc
npm install wolbarg
```
```ts
// before
import { AgentOrc } from "agentorc";
const ctx = new AgentOrc({ /* … */ });
// after
import { Wolbarg } from "wolbarg";
const ctx = new Wolbarg({ /* … */ });
```
* Class / options / error: `AgentOrc*` → `Wolbarg*`
* Site: [wolbarg.com](https://wolbarg.com)
* GitHub: [Atharvmunde11/wolbarg](https://github.com/Atharvmunde11/wolbarg)
* Internal meta table: `agentorc_meta` → `wolbarg_meta` (recreate DBs or migrate)
## 0.1 → 0.2 breaking changes [#01--02-breaking-changes]
* `llm` is no longer required to operate the SDK
* Constructor instances without `llm` do not type `compress`
* `stats().llmModel` may be `null`
* Package version is **0.2.x+**
## API mapping (0.1 → 0.2) [#api-mapping-01--02]
```ts
// 0.1
const ctx = new Wolbarg();
await ctx.init({ organization, database, embedding, llm });
// 0.2 (recommended)
const ctx = new Wolbarg({
organization,
storage: sqlite(database.connectionString),
embedding: openaiEmbedding({ /* … */ }),
llm: openaiLlm({ /* … */ }), // optional
});
// 0.2 — init() still works for compatibility
```
## Schema [#schema]
SQLite auto-migrates to schema version 2 (FTS5). Existing databases open without manual steps. Embedding dimension changes still require a fresh DB.
Method names (`remember` / `recall` / …) are unchanged. New optional `recall` fields are additive.
## Upgrade [#upgrade]
```bash
npm install wolbarg@^0.3.0
```
## Related pages [#related-pages]
* [What's New in 0.2](/docs/guides/whats-new)
* [init() Compatibility](/docs/reference/init-compat)
* [Limitations](/docs/guides/limitations)
---
# OCR
> Extract text from images with tesseract.js during Wolbarg ingest.
URL: /docs/ocr
## What is it? [#what-is-it]
Optical character recognition via the `ocr: tesseract()` provider, used during image ingest.
## Why does it exist? [#why-does-it-exist]
Many useful facts live inside pixels (UI text, labels, scanned pages). OCR turns them into embeddable strings.
## How does it work? [#how-does-it-work]
```bash
npm install tesseract.js
```
```ts
import { tesseract } from "wolbarg";
ocr: tesseract()
```
OCR requires installing `tesseract.js` in your app. Scan-only PDFs are not OCR'd as PDFs in v0.2 — convert to images or use a vision provider on image fixtures.
## When should it be used? [#when-should-it-be-used]
Screenshots and photos with readable text where you do not need scene captions. Combine with [Vision Models](/docs/vision) for richer descriptions.
## Related pages [#related-pages]
* [Vision Models](/docs/vision)
* [Image Ingestion](/docs/image-ingestion)
* [Example — OCR](/docs/examples/ocr)
---
# Performance
> Tuning guidance for recall latency, ingest throughput, and storage growth in Wolbarg.
URL: /docs/performance
## What is it? [#what-is-it]
Practical notes on what dominates runtime cost and how to configure Wolbarg for speed vs quality.
## Why does it exist? [#why-does-it-exist]
Most latency is not “SQLite being slow” — it is embedding HTTP calls, rerank APIs, and scanning oversized candidate sets.
## How it works — cost drivers [#how-it-works--cost-drivers]
| Path | Dominated by |
| ---------- | --------------------------------------------- |
| `remember` | Embedding API + single insert |
| `recall` | Query embed + vector scan (+ hybrid + rerank) |
| `ingest` | Parse + N embeddings + batch insert |
| `compress` | LLM tokens |
## Tuning checklist [#tuning-checklist]
1. Call `await ctx.ready()` at startup to fail fast
2. Prefer [metadata filters](/docs/metadata-filtering) before raising `topK`
3. Keep `threshold` slightly above 0 for noisy corpora
4. Use hybrid only when you need exact tokens
5. Reserve rerankers for high-precision paths
6. Pick chunk sizes intentionally ([Chunking](/docs/chunking))
7. Match embedding dimensions to your model and never silently change them mid-database
## When should you use SQLite vs Postgres? [#when-should-you-use-sqlite-vs-postgres]
* **SQLite** — single node, lowest ops overhead
* **PostgreSQL** — multi-instance sharing and central ops
See [Benchmarks](/docs/benchmarks) for methodology and published numbers, and the live charts at [/benchmarks](/benchmarks).
## Related pages [#related-pages]
* [Architecture](/docs/architecture)
* [Benchmarks](/docs/benchmarks)
* [Best Practices](/docs/guides/best-practices)
---
# Provider Architecture
> Embedding, LLM, keyword search, reranker, OCR, vision, and chunking providers in Wolbarg.
URL: /docs/providers
## What is it? [#what-is-it]
Wolbarg treats embeddings, LLMs, keyword search, rerankers, OCR, vision, and chunking as swappable providers. Factories ship for common APIs; custom objects work if they match the interface.
## Why does it exist? [#why-does-it-exist]
Agents already have preferred models and endpoints. The SDK must not hardcode a single cloud vendor.
## Embedding providers [#embedding-providers]
All factories wrap an OpenAI-compatible `/embeddings` HTTP API:
```ts
import {
openaiEmbedding,
ollamaEmbedding,
openRouterEmbedding,
lmStudioEmbedding,
geminiEmbedding,
togetherEmbedding,
vllmEmbedding,
openaiCompatibleEmbedding,
} from "wolbarg";
embedding: openaiEmbedding({
apiKey: process.env.OPENAI_API_KEY!,
model: "text-embedding-3-small",
})
embedding: ollamaEmbedding({
apiKey: "ollama",
model: "nomic-embed-text",
})
```
### Custom embedding provider [#custom-embedding-provider]
```ts
const embedding = {
model: "my-model",
async embed(text: string) {
/* return Float32Array */
},
async validate() {
const v = await this.embed("ping");
return { dimensions: v.length };
},
};
```
Changing embedding dimensionality on an existing database throws at startup — create a new DB file or wipe data first.
## LLM providers [#llm-providers]
```ts
import { openaiLlm, ollamaLlm, openRouterLlm } from "wolbarg";
llm: openaiLlm({
apiKey: process.env.OPENAI_API_KEY!,
model: "gpt-4.1-mini",
})
```
Without `llm`, TypeScript will not allow `compress()`. At runtime you get `ProviderNotConfiguredError`.
## Keyword search [#keyword-search]
```ts
keywordSearch: bm25()
```
Enables [Hybrid Search](/docs/hybrid-search). If omitted, recall stays semantic-only.
## Rerankers [#rerankers]
```ts
import { jinaReranker, cohereReranker, bgeReranker, crossEncoder } from "wolbarg";
reranker: jinaReranker({ apiKey: process.env.JINA_API_KEY! })
```
Pass `rerank: true` on recall. If no reranker is configured, reranking is skipped silently. See [Rerankers](/docs/rerankers).
## OCR and vision [#ocr-and-vision]
```ts
import { tesseract, geminiVision, openaiVision } from "wolbarg";
ocr: tesseract(),
vision: geminiVision({ apiKey: process.env.GEMINI_API_KEY! }),
```
See [OCR](/docs/ocr) and [Vision Models](/docs/vision).
## Chunking [#chunking]
```ts
import { createChunkingStrategy } from "wolbarg";
chunking: createChunkingStrategy("markdown")
```
Strategies: `fixed`, `sentence`, `paragraph`, `markdown`, `heading`. Overridable per `ingest` call.
## When should it be used? [#when-should-it-be-used]
Configure only the providers you exercise. A semantic-only SQLite setup needs organization + storage + embedding. Add LLM for compression, BM25 for hybrid, and OCR/vision for images.
## Related pages [#related-pages]
* [Configuration](/docs/configuration)
* [Hybrid Search](/docs/hybrid-search)
* [Compression Pipeline](/docs/compression)
* [Examples — Providers](/docs/examples/providers)
---
# Quick Start
> Construct Wolbarg, remember facts, and recall them with semantic or hybrid search in minutes.
URL: /docs/quick-start
## What is it? [#what-is-it]
A minimal path from zero to working semantic memory: construct, remember, recall, then optionally hybrid search and document ingest.
## 1. Construct [#1-construct]
```ts
import {
Wolbarg,
sqlite,
openaiEmbedding,
openaiLlm,
bm25,
} from "wolbarg";
const ctx = new Wolbarg({
organization: "my-org",
storage: sqlite("./memory.db"),
embedding: openaiEmbedding({
apiKey: process.env.OPENAI_API_KEY!,
model: "text-embedding-3-small",
}),
// Optional — enables compress()
llm: openaiLlm({
apiKey: process.env.OPENAI_API_KEY!,
model: "gpt-4.1-mini",
}),
// Optional — enables hybrid recall
keywordSearch: bm25(),
});
```
## 2. Remember [#2-remember]
```ts
await ctx.remember({
agent: "research",
content: { text: "Stripe supports recurring invoices." },
metadata: { topic: "billing", source: "docs" },
});
```
## 3. Recall [#3-recall]
```ts
const results = await ctx.recall({
query: "How do recurring invoices work?",
topK: 5,
threshold: 0.3,
filter: { agent: "research" },
});
console.log(results[0]?.content.text, results[0]?.similarity);
```
## 4. Hybrid + filters (optional) [#4-hybrid--filters-optional]
```ts
import { meta } from "wolbarg";
const hits = await ctx.recall({
query: "recurring invoices",
topK: 5,
hybrid: true,
filter: {
agent: "research",
metadata: meta.eq("topic", "billing"),
},
});
```
## 5. Ingest a document (optional) [#5-ingest-a-document-optional]
Markdown / TXT ingest works out of the box. For PDF or DOCX install peers first (`pdf-parse@1.1.4`, `mammoth`). See [Document Ingestion](/docs/document-ingestion).
```bash
npm install pdf-parse@1.1.4 # required for .pdf ingest
npm install mammoth # required for .docx ingest
```
```ts
const result = await ctx.ingest({
agent: "docs",
source: { path: "./guide.md" },
chunking: { strategy: "markdown", chunkSize: 800, overlap: 100 },
});
console.log(result.chunkCount);
```
## When should you use this pattern? [#when-should-you-use-this-pattern]
Start here for every new project. Add hybrid search, rerankers, and ingest only when you need them.
## Related pages [#related-pages]
* [Configuration](/docs/configuration)
* [recall()](/docs/api/recall)
* [ingest()](/docs/api/ingest)
* [Examples](/docs/examples)
---
# Rerankers
> Optional cross-encoder reranking and MMR diversification for recall results.
URL: /docs/rerankers
## What is it? [#what-is-it]
A second-stage ranking step. After vector (and optional hybrid) retrieval, a reranker scores query–document pairs. MMR diversifies the final set to reduce near-duplicates.
## Why does it exist? [#why-does-it-exist]
Bi-encoder retrieval is fast but coarse. Cross-encoders improve precision. MMR improves diversity for agent context windows.
## How does it work? [#how-does-it-work]
### Rerank [#rerank]
```ts
import { jinaReranker, cohereReranker } from "wolbarg";
reranker: jinaReranker({ apiKey: process.env.JINA_API_KEY! })
await ctx.recall({ query: "…", topK: 5, rerank: true });
```
Built-in factories: `jinaReranker`, `cohereReranker`, `bgeReranker`, `crossEncoder`, `openaiReranker`.
`rerank: true` without a configured provider skips reranking — no error.
### MMR [#mmr]
```ts
await ctx.recall({
query: "…",
topK: 5,
mmr: true, // lambda = 0.5
// mmr: { lambda: 0.7 } // higher = more relevance, less diversity
});
```
## When should it be used? [#when-should-it-be-used]
Use rerankers for high-stakes grounding (support answers, code RAG). Use MMR when agents repeatedly get near-duplicate snippets.
## Performance notes [#performance-notes]
* Over-fetch (`retrieval.overFetchFactor`) feeds the reranker more candidates
* Network latency depends on the remote rerank API
* Skip rerank in latency-critical hot paths
## Related pages [#related-pages]
* [Hybrid Search](/docs/hybrid-search)
* [Semantic Search](/docs/search)
* [Example — Rerankers](/docs/examples/rerankers)
---
# Semantic Search
> How Wolbarg embeds queries and retrieves memories by cosine similarity.
URL: /docs/search
## What is it? [#what-is-it]
Semantic search is the default `recall()` path: embed the query, compare against stored memory embeddings, return the top-K closest records.
## Why does it exist? [#why-does-it-exist]
Agents ask questions in natural language. Exact string match fails when vocabulary drifts; vectors catch meaning.
## How does it work? [#how-does-it-work]
1. `embedding.embed(query)` produces a query vector
2. Storage runs nearest-neighbor search (sqlite-vec / pgvector or in-process cosine)
3. Optional filters (`agent`, metadata, archived) shrink the candidate set
4. Results are ranked by similarity and trimmed to `topK`
```ts
const results = await ctx.recall({
query: "How do recurring invoices work?",
topK: 5,
threshold: 0.3,
filter: { agent: "research" },
});
```
## When should it be used? [#when-should-it-be-used]
Always. Semantic search is the baseline. Add [Hybrid Search](/docs/hybrid-search) when exact tokens matter, [Rerankers](/docs/rerankers) when precision matters, and [Metadata Filtering](/docs/metadata-filtering) to scope corpora.
## Performance notes [#performance-notes]
* Latency is dominated by embedding network calls + vector scan size
* Keep `threshold` above 0 for noisy corpora
* Prefer metadata filters before raising `topK`
## Related pages [#related-pages]
* [Hybrid Search](/docs/hybrid-search)
* [recall()](/docs/api/recall)
* [Performance](/docs/performance)
---
# Vision Models
> Caption and describe images with Gemini or OpenAI vision providers during ingest.
URL: /docs/vision
## What is it? [#what-is-it]
Vision providers that produce captions, descriptions, and entities from images, merged into ingest text before chunking.
## Why does it exist? [#why-does-it-exist]
OCR reads glyphs; vision models explain what an image *means* — charts, UI layout, diagrams.
## How does it work? [#how-does-it-work]
```ts
import { geminiVision, openaiVision } from "wolbarg";
vision: geminiVision({ apiKey: process.env.GEMINI_API_KEY! })
// or
vision: openaiVision({ apiKey: process.env.OPENAI_API_KEY! })
```
OCR text, captions, descriptions, and entities are concatenated before chunking. Configure either or both providers.
## When should it be used? [#when-should-it-be-used]
Charts, product photos, and UI screenshots where labels alone are insufficient. Prefer OCR-only for dense text scans to save cost.
## Performance notes [#performance-notes]
* Vision calls dominate ingest latency for images
* Cache originals outside Wolbarg if you re-process often
## Related pages [#related-pages]
* [OCR](/docs/ocr)
* [Image Ingestion](/docs/image-ingestion)
* [Provider Architecture](/docs/providers)
---
# forget()
> Delete memories by id or metadata/agent filter.
URL: /docs/api/forget
## Signature [#signature]
```ts
forget(options: ForgetOptions): Promise
```
## Example [#example]
```ts
await ctx.forget({ id: record.id });
await ctx.forget({ filter: { agent: "research" } });
```
## Related pages [#related-pages]
* [history()](/docs/api/history)
* [Metadata Filtering](/docs/metadata-filtering)
---
# history()
> Read audit events for remember, forget, compress, and related operations.
URL: /docs/api/history
## Signature [#signature]
```ts
history(options?: HistoryOptions): Promise
```
Use history to audit what changed when debugging multi-agent writes or compression jobs.
## Related pages [#related-pages]
* [forget()](/docs/api/forget)
* [Compression Pipeline](/docs/compression)
---
# API Overview
> Index of the Wolbarg public API — Wolbarg class, remember, recall, ingest, forget, history, and lifecycle.
URL: /docs/api
## What is it? [#what-is-it]
The public surface developers call after constructing `Wolbarg`.
## Core entry points [#core-entry-points]
| Page | Method |
| ---------------------------------------- | ------------------------- |
| [Wolbarg](/docs/api/wolbarg) | construct / ready / close |
| [remember()](/docs/api/remember) | Store a memory |
| [recall()](/docs/api/recall) | Semantic / hybrid search |
| [ingest()](/docs/api/ingest) | Document → memories |
| [forget()](/docs/api/forget) | Delete memories |
| [history()](/docs/api/history) | Audit events |
| [stats() / clear()](/docs/api/lifecycle) | Introspection / wipe |
Compression lives under [Compression Pipeline](/docs/compression).
## Generated reference [#generated-reference]
Every exported type and factory is listed under [API Reference](/docs/api/reference).
## Related pages [#related-pages]
* [Configuration](/docs/configuration)
* [Quick Start](/docs/quick-start)
* [Architecture](/docs/architecture)
---
# ingest()
> Parse documents into chunked semantic memories.
URL: /docs/api/ingest
## Signature [#signature]
```ts
ingest(options: IngestOptions): Promise
// source: { path } | { buffer, filename? } | { text }
// chunking?: { strategy, chunkSize, overlap }
// metadata?: Record
```
Pipeline: parse → OCR/vision (if configured) → chunk → embed (batch) → store (batch transaction).
## Dependencies [#dependencies]
PDF and DOCX require peers: `npm install pdf-parse@1.1.4` · `npm install mammoth` · `npm install tesseract.js` for OCR.
## Example [#example]
```ts
await ctx.ingest({
agent: "docs",
source: { path: "./guide.md" },
chunking: { strategy: "markdown", chunkSize: 800, overlap: 100 },
});
```
## Related pages [#related-pages]
* [Document Ingestion](/docs/document-ingestion)
* [Chunking](/docs/chunking)
* [Limitations](/docs/guides/limitations)
---
# stats() / clear()
> Introspection and organization-scoped wipe helpers.
URL: /docs/api/lifecycle
## stats() [#stats]
```ts
const s = await ctx.stats();
// memory counts, models, storage info
```
`llmModel` may be `null` when no LLM is configured.
## clear() [#clear]
```ts
await ctx.clear(); // organization-scoped, destructive
```
## Related pages [#related-pages]
* [Wolbarg](/docs/api/wolbarg)
* [Best Practices](/docs/guides/best-practices)
---
# recall()
> Semantic and hybrid search with filters, thresholds, MMR, and rerank.
URL: /docs/api/recall
## Signature [#signature]
```ts
recall(options: RecallOptions): Promise
```
## Options [#options]
| Field | Default | Description |
| ----------- | ------- | ----------------------------------------- |
| `query` | — | Natural-language query (required) |
| `topK` | `5` | Max results (1–1000) |
| `threshold` | `0` | Minimum cosine similarity |
| `filter` | — | `agent`, `includeArchived`, `metadata` |
| `hybrid` | — | `true` or weights; needs `keywordSearch` |
| `mmr` | — | Diversification; `true` or `{ lambda }` |
| `rerank` | `false` | Uses configured reranker; skips if absent |
## Example [#example]
```ts
import { meta } from "wolbarg";
const hits = await ctx.recall({
query: "billing invoices",
topK: 8,
threshold: 0.25,
hybrid: { semanticWeight: 0.7, keywordWeight: 0.3 },
mmr: { lambda: 0.6 },
rerank: true,
filter: {
agent: "research",
metadata: meta.and(
meta.eq("topic", "billing"),
meta.gte("priority", 1),
),
},
});
```
## Related pages [#related-pages]
* [Semantic Search](/docs/search)
* [Hybrid Search](/docs/hybrid-search)
* [Rerankers](/docs/rerankers)
---
# remember()
> Store a semantic memory with embedding and optional metadata.
URL: /docs/api/remember
## Signature [#signature]
```ts
remember(options: RememberOptions): Promise
interface RememberOptions {
agent: string;
content: { text: string };
metadata?: Record;
}
```
## Example [#example]
```ts
const record = await ctx.remember({
agent: "research",
content: { text: "Acme raised Series B at $50M." },
metadata: { company: "Acme", year: 2024 },
});
```
## Related pages [#related-pages]
* [recall()](/docs/api/recall)
* [Metadata Filtering](/docs/metadata-filtering)
* [Example — Basic Memory](/docs/examples/basic-memory)
---
# Wolbarg
> Lifecycle methods for the Wolbarg class — constructor, ready, close, and init shim.
URL: /docs/api/wolbarg
## Constructor [#constructor]
```ts
new Wolbarg(options) // preferred
new Wolbarg() // then init() for v0.1 compat
```
When `llm` is present, the instance type allows `compress`. Without it, calling `compress` is a compile-time error.
## ready() [#ready]
```ts
await ctx.ready();
```
Opens storage and probes embedding dimensions. Called automatically by other methods; use explicitly to fail fast at startup.
## close() [#close]
```ts
await ctx.close();
```
Idempotent. Releases the database connection.
## init() shim [#init-shim]
```ts
const ctx = new Wolbarg();
await ctx.init({
organization: "my-org",
database: { provider: "sqlite", connectionString: "./memory.db" },
embedding: { baseUrl, apiKey, model },
llm: { baseUrl, apiKey, model }, // optional in v0.2
});
```
Prefer constructor options. See [init() Compatibility](/docs/reference/init-compat).
## Related pages [#related-pages]
* [Configuration](/docs/configuration)
* [remember()](/docs/api/remember)
* [API Overview](/docs/api)
---
# Example — Basic Memory
> Minimal remember and recall with SQLite and OpenAI embeddings.
URL: /docs/examples/basic-memory
## What is it? [#what-is-it]
The smallest working Wolbarg program.
## Example usage [#example-usage]
```ts
import { Wolbarg, sqlite, openaiEmbedding } 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",
}),
});
await ctx.remember({
agent: "assistant",
content: { text: "The deploy window is Fridays at 16:00 UTC." },
});
const hits = await ctx.recall({ query: "when can we deploy?", topK: 3 });
console.log(hits[0]?.content.text);
await ctx.close();
```
## Related pages [#related-pages]
* [Quick Start](/docs/quick-start)
* [remember()](/docs/api/remember)
---
# Example — Compression
> Summarize memories with an LLM via compress().
URL: /docs/examples/compression
```ts
import { Wolbarg, sqlite, openaiEmbedding, openaiLlm } 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",
}),
llm: openaiLlm({
apiKey: process.env.OPENAI_API_KEY!,
model: "gpt-4.1-mini",
}),
});
await ctx.compress({ agent: "research" });
```
## Related pages [#related-pages]
* [Compression Pipeline](/docs/compression)
---
# Example — Hybrid Search
> Enable BM25 keyword search and fuse it with semantic recall.
URL: /docs/examples/hybrid-search
```ts
import { Wolbarg, sqlite, openaiEmbedding, bm25 } 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",
}),
keywordSearch: bm25(),
});
await ctx.remember({
agent: "ops",
content: { text: "Incident INC-2048: Redis failover completed." },
});
const hits = await ctx.recall({
query: "INC-2048 failover",
hybrid: { semanticWeight: 0.6, keywordWeight: 0.4 },
});
```
## Related pages [#related-pages]
* [Hybrid Search](/docs/hybrid-search)
---
# Example — Image Memory
> Ingest a PNG with OCR and vision enrichment.
URL: /docs/examples/image-memory
```bash
npm install tesseract.js
```
```ts
import { Wolbarg, sqlite, openaiEmbedding, tesseract, geminiVision } 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(),
vision: geminiVision({ apiKey: process.env.GEMINI_API_KEY! }),
});
await ctx.ingest({
agent: "vision",
source: { path: "./screenshot.png" },
});
```
## Related pages [#related-pages]
* [Image Ingestion](/docs/image-ingestion)
---
# Examples
> Independent Wolbarg examples — basic memory, hybrid search, storage backends, ingest, and providers.
URL: /docs/examples
## What is it? [#what-is-it]
Small, self-contained examples. Each page stands alone with copy-paste TypeScript.
| Example | Link |
| ------------------ | ------------------------------------------------------- |
| Basic Memory | [basic-memory](/docs/examples/basic-memory) |
| Hybrid Search | [hybrid-search](/docs/examples/hybrid-search) |
| SQLite | [sqlite](/docs/examples/sqlite) |
| PostgreSQL | [postgresql](/docs/examples/postgresql) |
| Image Memory | [image-memory](/docs/examples/image-memory) |
| PDF Memory | [pdf-memory](/docs/examples/pdf-memory) |
| Metadata Filtering | [metadata-filtering](/docs/examples/metadata-filtering) |
| Compression | [compression](/docs/examples/compression) |
| Providers | [providers](/docs/examples/providers) |
| Rerankers | [rerankers](/docs/examples/rerankers) |
| OCR | [ocr](/docs/examples/ocr) |
## Related pages [#related-pages]
* [Quick Start](/docs/quick-start)
* [API Overview](/docs/api)
---
# Example — Metadata Filtering
> Scope recall with meta helpers and agent filters.
URL: /docs/examples/metadata-filtering
```ts
import { meta } from "wolbarg";
await ctx.remember({
agent: "sales",
content: { text: "EU pricing starts at €49/seat." },
metadata: { region: "eu", priority: 3 },
});
const hits = await ctx.recall({
query: "pricing",
filter: {
agent: "sales",
metadata: meta.and(meta.eq("region", "eu"), meta.gte("priority", 2)),
},
});
```
## Related pages [#related-pages]
* [Metadata Filtering](/docs/metadata-filtering)
---
# Example — OCR
> Extract text from images with tesseract during ingest.
URL: /docs/examples/ocr
```bash
npm install tesseract.js
```
```ts
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" },
});
```
## Related pages [#related-pages]
* [OCR](/docs/ocr)
---
# Example — PDF Memory
> Ingest a text-layer PDF into chunked memories.
URL: /docs/examples/pdf-memory
```bash
npm install pdf-parse@1.1.4
```
```ts
import { Wolbarg, sqlite, openaiEmbedding } 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",
}),
});
await ctx.ingest({
agent: "docs",
source: { path: "./handbook.pdf" },
chunking: { strategy: "paragraph", chunkSize: 900, overlap: 100 },
metadata: { collection: "handbook" },
});
```
## Related pages [#related-pages]
* [Document Ingestion](/docs/document-ingestion)
---
# Example — PostgreSQL
> Shared PostgreSQL storage with the pg peer dependency.
URL: /docs/examples/postgresql
```bash
npm install pg
```
```ts
import { Wolbarg, postgres, openaiEmbedding } from "wolbarg";
const ctx = new Wolbarg({
organization: "prod",
storage: postgres({
connectionString: process.env.DATABASE_URL!,
maxPoolSize: 10,
}),
embedding: openaiEmbedding({
apiKey: process.env.OPENAI_API_KEY!,
model: "text-embedding-3-small",
}),
});
await ctx.ready();
```
## Related pages [#related-pages]
* [PostgreSQL Backend](/docs/storage/postgresql)
---
# Example — Providers
> Mix OpenAI embeddings, Ollama LLM, and BM25 keyword search.
URL: /docs/examples/providers
```ts
import {
Wolbarg, sqlite, openaiEmbedding, ollamaLlm, bm25,
} 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",
}),
llm: ollamaLlm({ apiKey: "ollama", model: "llama3.2" }),
keywordSearch: bm25(),
});
```
## Related pages [#related-pages]
* [Provider Architecture](/docs/providers)
---
# Example — Rerankers
> Attach a Jina reranker and enable rerank on recall.
URL: /docs/examples/rerankers
```ts
import { Wolbarg, sqlite, openaiEmbedding, jinaReranker } 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",
}),
reranker: jinaReranker({ apiKey: process.env.JINA_API_KEY! }),
retrieval: { overFetchFactor: 4 },
});
await ctx.recall({ query: "refund policy", topK: 5, rerank: true });
```
## Related pages [#related-pages]
* [Rerankers](/docs/rerankers)
---
# Example — SQLite
> File-backed and in-memory SQLite storage examples.
URL: /docs/examples/sqlite
```ts
import { Wolbarg, sqlite, openaiEmbedding } from "wolbarg";
const file = new Wolbarg({
organization: "demo",
storage: sqlite("./agent-memory.db"),
embedding: openaiEmbedding({
apiKey: process.env.OPENAI_API_KEY!,
model: "text-embedding-3-small",
}),
});
const mem = new Wolbarg({
organization: "tests",
storage: sqlite(":memory:"),
embedding: openaiEmbedding({
apiKey: process.env.OPENAI_API_KEY!,
model: "text-embedding-3-small",
}),
});
```
## Related pages [#related-pages]
* [SQLite Backend](/docs/storage/sqlite)
---
# Best Practices
> Practical guidance for production Wolbarg usage.
URL: /docs/guides/best-practices
## Scope memories [#scope-memories]
Use stable `agent` ids and meaningful metadata keys (`topic`, `source`, `collection`).
## Prefer metadata filters [#prefer-metadata-filters]
Narrow recall with `meta.*` before increasing `topK`. Combine with hybrid search for exact token matches.
## Peers on demand [#peers-on-demand]
Do not install `pg` / `pdf-parse` / `mammoth` / `tesseract.js` unless you need them. If you ingest those formats, peers are **required**.
## Lifecycle [#lifecycle]
* Call `ready()` at process start to fail fast
* Always `close()` on shutdown
* One `Wolbarg` instance per process / org is enough
## Related pages [#related-pages]
* [Performance](/docs/performance)
* [Metadata Filtering](/docs/metadata-filtering)
* [Multi-Agent Memory](/docs/guides/shared-memory)
---
# Limitations (v0.2)
> Honest boundaries of Wolbarg 0.2 — peers, PDF quality, SQLite, and Postgres.
URL: /docs/guides/limitations
## Maturity [#maturity]
Core `remember` / `recall` (semantic + hybrid + metadata filters) on SQLite and PostgreSQL is the most battle-tested path. Document ingest, OCR/vision, and LLM compression are supported but depend on optional packages and external APIs.
## Ingest dependencies (required) [#ingest-dependencies-required]
```bash
npm install pdf-parse@1.1.4 # PDF
npm install mammoth # DOCX
npm install tesseract.js # OCR
npm install pg # PostgreSQL
```
* **.txt / .md / .csv / .json** — built-in
* **.pdf** — `pdf-parse` required; text-layer only unless OCR/vision on images
* **.docx** — `mammoth` required
* **images** — configure `ocr` and/or `vision`
## PDF extraction [#pdf-extraction]
* Scan / camera PDFs with no text layer yield empty extract
* Prefer simple text PDFs or pin `pdf-parse@1.1.4`
## SQLite [#sqlite]
* Uses Node `node:sqlite` (experimental) — Node **22.5+**
* Hybrid BM25 uses FTS5 when available
## PostgreSQL [#postgresql]
* Requires `pg`
* `pgvector` optional; otherwise BYTEA + in-process cosine
## Optional providers [#optional-providers]
* `compress()` needs `llm`
* `hybrid: true` without `keywordSearch` falls back to semantic-only
* `rerank: true` without a reranker skips gracefully
## Not in v0.2 [#not-in-v02]
* No hosted cloud control plane
* No built-in agent framework / chat UI
* No Atlas Search / dedicated vector DB product integration
## Related pages [#related-pages]
* [Installation](/docs/installation)
* [Document Ingestion](/docs/document-ingestion)
* [FAQ](/docs/faq)
---
# Multi-Agent Memory
> Share one Wolbarg instance across concurrent agents with agent-scoped filters.
URL: /docs/guides/shared-memory
## Pattern [#pattern]
```ts
const ctx = new Wolbarg({ /* … */ });
await ctx.remember({ agent: "writer", content: { text: "…" } });
await ctx.remember({ agent: "researcher", content: { text: "…" } });
await ctx.recall({
query: "…",
filter: { agent: "writer" },
});
// Org-wide shared recall — omit agent filter
await ctx.recall({ query: "…" });
```
## Isolation [#isolation]
Organizations isolate tenants in one database file. Agents isolate authors within an organization. Writes serialize via an in-process mutex and ACID transactions.
## Related pages [#related-pages]
* [Architecture](/docs/architecture)
* [Metadata Filtering](/docs/metadata-filtering)
* [Best Practices](/docs/guides/best-practices)
---
# What's New in 0.2
> Highlights of the Wolbarg 0.2 modular provider rewrite and 0.2.1 production hardening.
URL: /docs/guides/whats-new
## Highlights [#highlights]
Wolbarg **0.2** is a modular rewrite around replaceable providers while keeping `remember` / `recall` familiar.
* Constructor DI + factories (`sqlite`, `postgres`, embeddings, LLM, BM25, …)
* SQLite and PostgreSQL storage
* Hybrid recall, metadata filters (`meta.*`), MMR, rerankers
* Document `ingest()` (text, PDF, DOCX, images + OCR/vision)
* Optional `llm` — `compress()` only when configured
## 0.2.1 — production hardening [#021--production-hardening]
**0.2.1** hardens both storage backends for production: WAL-safe SQLite transactions (FTS + semantic writes in one ACID batch), Postgres insert coalescing / COPY / deferred HNSW, FTS archive correctness, org-scoped ANN isolation, and compression bookkeeping aligned with recall. Same API as 0.2.0.
## Ingest & peers [#ingest--peers]
PDF / DOCX / OCR are **not** bundled. Install `pdf-parse`, `mammoth`, `tesseract.js` when needed.
## Upgrade [#upgrade]
```bash
npm install wolbarg@^0.2.1
```
Read [Migration](/docs/migration) and [Limitations](/docs/guides/limitations).
---
# Errors
> Typed error hierarchy for Wolbarg.
URL: /docs/reference/errors
## Hierarchy [#hierarchy]
* `WolbargError` — base
* `ConfigurationError` — bad config
* `ProviderNotConfiguredError` — method needs a missing provider
* `InitializationError` — open / probe failed
* `ValidationError` — bad method arguments
* `DatabaseError` / `EmbeddingError` / `CompressionError`
* `MemoryNotFoundError`
## Related pages [#related-pages]
* [Types](/docs/reference/types)
* [FAQ](/docs/faq)
---
# init() Compatibility
> v0.1 init() API remains supported as a shim.
URL: /docs/reference/init-compat
## Usage [#usage]
```ts
const ctx = new Wolbarg();
await ctx.init({
organization: "my-org",
database: {
provider: "sqlite", // or "postgres"
connectionString: "./memory.db",
},
embedding: {
baseUrl: "https://api.openai.com/v1",
apiKey: process.env.OPENAI_API_KEY!,
model: "text-embedding-3-small",
},
llm: { // optional in 0.2
baseUrl: "https://api.openai.com/v1",
apiKey: process.env.OPENAI_API_KEY!,
model: "gpt-4.1-mini",
},
});
```
## Notes [#notes]
Prefer constructor DI + factories for new code. `init` maps `database` → storage and wires embedding / optional llm the same way.
## Related pages [#related-pages]
* [Migration](/docs/migration)
* [Wolbarg](/docs/api/wolbarg)
---
# Types
> Key public TypeScript types in Wolbarg 0.2.
URL: /docs/reference/types
## Domain [#domain]
```ts
MemoryRecord, MemoryContent, MemoryMetadata
RecallResult, HistoryEvent, HistoryResult
IngestResult, CompressResult, StatsResult
```
## Options [#options]
```ts
WolbargOptions, RememberOptions, RecallOptions
IngestOptions, CompressOptions, ForgetOptions
MemoryFilter, MetadataFilter, HybridConfig, MmrConfig
```
## Providers [#providers]
```ts
StorageProvider, EmbeddingProvider, LlmProvider
KeywordSearchProvider, RerankerProvider
OCRProvider, VisionProvider, ChunkingStrategy
CompressionProvider
```
## Related pages [#related-pages]
* [API Reference](/docs/api/reference)
* [Errors](/docs/reference/errors)
---
# PostgreSQL Backend
> Shared PostgreSQL storage with connection pooling, JSONB metadata, and optional pgvector.
URL: /docs/storage/postgresql
## What is it? [#what-is-it]
A `StorageProvider` implementation backed by PostgreSQL via the optional `pg` peer. Same public API as SQLite.
## Why does it exist? [#why-does-it-exist]
Teams that already run Postgres, or need multi-process / multi-host readers and writers against one database.
## How does it work? [#how-does-it-work]
```bash
npm install pg
```
```ts
import { postgres } from "wolbarg";
storage: postgres(process.env.DATABASE_URL!)
// or
storage: postgres({
connectionString: process.env.DATABASE_URL!,
maxPoolSize: 10,
})
```
Features:
* Connection pooling
* JSONB metadata + GIN index
* pgvector when the extension is available (BYTEA + cosine fallback otherwise)
Install the optional `pg` peer before using `postgres()`.
## API parity [#api-parity]
Both backends implement the same `StorageProvider` contract: insert, batch insert, update, delete, vector search, metadata listing, history, transactions, and migrations. Switch storage by changing one constructor option.
## When should it be used? [#when-should-it-be-used]
Use PostgreSQL when multiple application instances share memory, or when you need central backups and ops. Use SQLite when the agent is single-node and file-based storage is enough.
## Related pages [#related-pages]
* [SQLite Backend](/docs/storage/sqlite)
* [Example — PostgreSQL](/docs/examples/postgresql)
* [Limitations](/docs/guides/limitations)
---
# SQLite Backend
> Local-first SQLite storage with WAL, sqlite-vec vectors, and FTS5 keyword indexing.
URL: /docs/storage/sqlite
## What is it? [#what-is-it]
The default storage backend. Memories live in a single SQLite file (or `:memory:`) using Node's built-in `node:sqlite`.
## Why does it exist? [#why-does-it-exist]
Zero infrastructure for development and most production single-node agents. No Docker, no managed DB — just a file.
## How does it work? [#how-does-it-work]
```ts
import { sqlite } from "wolbarg";
storage: sqlite("./memory.db")
// or
storage: sqlite(":memory:")
```
Uses:
* WAL mode for concurrent readers
* Prepared statements
* sqlite-vec when available (BLOB cosine fallback otherwise)
* FTS5 for keyword indexing (schema v2)
## When should it be used? [#when-should-it-be-used]
Prefer SQLite for local agents, demos, CI, and single-machine services. Move to [PostgreSQL](/docs/storage/postgresql) when you need multi-host access or central ops tooling.
## Performance notes [#performance-notes]
* Cold start is typically single-digit milliseconds in published benchmarks
* Database size scales roughly linearly with memory count (\~2.6 MB / 1k records in mock embedding suites)
* Hybrid BM25 needs `keywordSearch: bm25()` so FTS stays in sync
## Related pages [#related-pages]
* [PostgreSQL Backend](/docs/storage/postgresql)
* [Configuration](/docs/configuration)
* [Example — SQLite](/docs/examples/sqlite)
* [Performance](/docs/performance)
---
# Generated Exports
> Auto-generated catalog of public exports from the Wolbarg package entrypoint.
URL: /docs/api/reference/generated
## What is it? [#what-is-it]
Machine-generated list of every public symbol re-exported from `Wolbarg` (`sdk/src/index.ts`). Prefer curated pages for tutorials; use this page when you need exhaustive symbol coverage for tools and LLMs.
Generated **107** exports.
## Public exports [#public-exports]
### `bgeReranker` [#bgereranker]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `bm25` [#bm25]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `ChatMessage` [#chatmessage]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `Chunk` [#chunk]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `ChunkingOptions` [#chunkingoptions]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `ChunkingStrategy` [#chunkingstrategy]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `ClearOptions` [#clearoptions]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `cohereReranker` [#coherereranker]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `CompressionError` [#compressionerror]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `CompressionProvider` [#compressionprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `CompressOptions` [#compressoptions]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `CompressResult` [#compressresult]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `ConfigurationError` [#configurationerror]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `createChunkingStrategy` [#createchunkingstrategy]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `createCompressionProvider` [#createcompressionprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `createDatabaseProvider` [#createdatabaseprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `createEmbeddingProvider` [#createembeddingprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `createLlmProvider` [#createllmprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `createStorageProvider` [#createstorageprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `crossEncoder` [#crossencoder]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `DatabaseConfig` [#databaseconfig]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `DatabaseError` [#databaseerror]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `DatabaseProvider` [#databaseprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `DatabaseProviderName` [#databaseprovidername]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `EmbeddingConfig` [#embeddingconfig]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `EmbeddingError` [#embeddingerror]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `EmbeddingProvider` [#embeddingprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `FixedChunkingStrategy` [#fixedchunkingstrategy]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `ForgetByFilterOptions` [#forgetbyfilteroptions]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `ForgetByIdOptions` [#forgetbyidoptions]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `ForgetOptions` [#forgetoptions]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `geminiEmbedding` [#geminiembedding]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `geminiVision` [#geminivision]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `HeadingChunkingStrategy` [#headingchunkingstrategy]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `HistoryEvent` [#historyevent]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `HistoryOptions` [#historyoptions]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `HistoryResult` [#historyresult]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `HybridConfig` [#hybridconfig]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `IngestOptions` [#ingestoptions]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `IngestResult` [#ingestresult]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `InitializationError` [#initializationerror]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `InitOptions` [#initoptions]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `jinaReranker` [#jinareranker]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `KeywordDocument` [#keyworddocument]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `KeywordSearchHit` [#keywordsearchhit]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `KeywordSearchProvider` [#keywordsearchprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `LlmCompressionProvider` [#llmcompressionprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `LlmConfig` [#llmconfig]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `LlmProvider` [#llmprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `lmStudioEmbedding` [#lmstudioembedding]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `MarkdownChunkingStrategy` [#markdownchunkingstrategy]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `MemoryContent` [#memorycontent]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `MemoryFilter` [#memoryfilter]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `MemoryMetadata` [#memorymetadata]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `MemoryNotFoundError` [#memorynotfounderror]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `MemoryRecord` [#memoryrecord]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `meta` [#meta]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `MetadataComparison` [#metadatacomparison]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `MetadataFilter` [#metadatafilter]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `MetaFilter` [#metafilter]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `MmrConfig` [#mmrconfig]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `OCRProvider` [#ocrprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `OcrResult` [#ocrresult]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `ollamaEmbedding` [#ollamaembedding]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `ollamaLlm` [#ollamallm]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `openaiCompatibleEmbedding` [#openaicompatibleembedding]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `openaiCompatibleLlm` [#openaicompatiblellm]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `openaiEmbedding` [#openaiembedding]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `openaiLlm` [#openaillm]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `openaiReranker` [#openaireranker]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `openaiVision` [#openaivision]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `openRouterEmbedding` [#openrouterembedding]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `openRouterLlm` [#openrouterllm]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `ParagraphChunkingStrategy` [#paragraphchunkingstrategy]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `postgres` [#postgres]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `postgresConfig` [#postgresconfig]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `PostgresDatabaseConfig` [#postgresdatabaseconfig]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `PostgresStorageProvider` [#postgresstorageprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `ProviderNotConfiguredError` [#providernotconfigurederror]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `RecallOptions` [#recalloptions]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `RecallResult` [#recallresult]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `RememberOptions` [#rememberoptions]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `RerankDocument` [#rerankdocument]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `RerankerProvider` [#rerankerprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `RerankHit` [#rerankhit]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `RetrievalConfig` [#retrievalconfig]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `SentenceChunkingStrategy` [#sentencechunkingstrategy]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `sqlite` [#sqlite]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `sqliteConfig` [#sqliteconfig]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `SqliteDatabaseConfig` [#sqlitedatabaseconfig]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `SqliteDatabaseProvider` [#sqlitedatabaseprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `SqliteStorageProvider` [#sqlitestorageprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `StatsResult` [#statsresult]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `StorageConfig` [#storageconfig]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `StorageProvider` [#storageprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `StorageProviderName` [#storageprovidername]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `tesseract` [#tesseract]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `togetherEmbedding` [#togetherembedding]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `ValidationError` [#validationerror]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `VisionProvider` [#visionprovider]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `VisionResult` [#visionresult]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `vllmEmbedding` [#vllmembedding]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `Wolbarg` [#wolbarg]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `WolbargError` [#wolbargerror]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `WolbargOptions` [#wolbargoptions]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `WolbargOptionsWithLlm` [#wolbargoptionswithllm]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
### `WolbargOptionsWithoutLlm` [#wolbargoptionswithoutllm]
Public export from the `Wolbarg` package. See curated docs for [Wolbarg](/docs/api/wolbarg), [Configuration](/docs/configuration), and [Types](/docs/reference/types).
## Related pages [#related-pages]
* [API Overview](/docs/api)
* [Types](/docs/reference/types)
* [Errors](/docs/reference/errors)
* [Provider Architecture](/docs/providers)
---
# API Reference
> Generated reference for public Wolbarg exports — classes, interfaces, factories, and types.
URL: /docs/api/reference
## What is it? [#what-is-it]
TypeDoc-generated documentation for every public export from the `wolbarg` package.
Generated entries appear beside this page when `npm run docs:api` has been run. Until then, use the curated pages:
* [Wolbarg](/docs/api/wolbarg)
* [remember()](/docs/api/remember)
* [recall()](/docs/api/recall)
* [Types](/docs/reference/types)
* [Errors](/docs/reference/errors)
Regenerate:
```bash
npm run docs:api
```
## Related pages [#related-pages]
* [API Overview](/docs/api)
* [Configuration](/docs/configuration)