wolbarg 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +88 -0
- package/LICENSE +21 -0
- package/README.md +121 -0
- package/dist/index.cjs +4547 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1149 -0
- package/dist/index.d.ts +1149 -0
- package/dist/index.js +4470 -0
- package/dist/index.js.map +1 -0
- package/package.json +116 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
7
|
+
|
|
8
|
+
## [0.3.0] — 2026-07-16
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **Rebrand** — product renamed from AgentOrc / `agentorc` to **Wolbarg** / `wolbarg`
|
|
13
|
+
- **API** — `AgentOrc` → `Wolbarg`, `AgentOrcOptions` → `WolbargOptions`, `AgentOrcError` → `WolbargError`
|
|
14
|
+
- **Links** — docs and homepage now at [wolbarg.com](https://wolbarg.com); GitHub at [Atharvmunde11/wolbarg](https://github.com/Atharvmunde11/wolbarg)
|
|
15
|
+
- **Schema** — internal meta table renamed `agentorc_meta` → `wolbarg_meta` (new databases only; recreate or migrate existing DBs)
|
|
16
|
+
|
|
17
|
+
### Migration
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm uninstall agentorc
|
|
21
|
+
npm install wolbarg
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { Wolbarg, sqlite, openaiEmbedding } from "wolbarg";
|
|
26
|
+
const ctx = new Wolbarg({ /* same options shape */ });
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## [0.2.1] — 2026-07-15
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
33
|
+
- **SQLite production hardening** — WAL-safe pragmas, prepared statements, crash-safe batch inserts, and FTS5 kept in the same ACID transaction as semantic writes
|
|
34
|
+
- **PostgreSQL production hardening** — named prepared statements, concurrent insert coalescing / unnest batches, COPY for large ingest, org-scoped ANN with adaptive overfetch, deferred HNSW build
|
|
35
|
+
- **FTS correctness** — archived memories removed from FTS so hybrid/keyword search never returns archived rows; rebuild path when FTS diverges
|
|
36
|
+
- **Multi-tenant isolation** — organization filters enforced on ANN / HNSW query paths so tenants cannot leak across shared Postgres instances
|
|
37
|
+
- **HNSW lifecycle** — index created lazily before first KNN (keeps bulk inserts fast); soft org reset does not drop unrelated indexes incorrectly
|
|
38
|
+
- **Compression correctness** — active-set reduction and archive bookkeeping aligned with recall filters
|
|
39
|
+
- **Vector index paths** — SQLite blob vector index initialization and overfetch handling fixed for recall correctness
|
|
40
|
+
|
|
41
|
+
### Improved
|
|
42
|
+
|
|
43
|
+
- **Performance** — batched transactions (SQLite), insert coalescing (Postgres), adaptive overfetch for filtered ANN
|
|
44
|
+
- **Benchmark suite** — dual-backend mock stress + separate LIVE spot suite; clearer methodology separating storage latency from embedding-provider latency
|
|
45
|
+
- **Docs / website** — v0.2.1 release notes, dual-backend benchmark page with SQLite and PostgreSQL sections
|
|
46
|
+
|
|
47
|
+
### Notes
|
|
48
|
+
|
|
49
|
+
- Storage benchmarks use mock embeddings to isolate SDK + database performance
|
|
50
|
+
- LIVE spot benchmarks use real embedding providers for end-to-end latency — these are separate suites; do not mix the numbers
|
|
51
|
+
- Node.js **22.5+** still required
|
|
52
|
+
|
|
53
|
+
## [0.2.0] — 2026-07-14
|
|
54
|
+
|
|
55
|
+
### Added
|
|
56
|
+
|
|
57
|
+
- Constructor dependency injection with factory helpers (`sqlite`, `postgres`, `openaiEmbedding`, `openaiLlm`, `bm25`, …)
|
|
58
|
+
- PostgreSQL storage provider (`pg` peer) with optional pgvector
|
|
59
|
+
- Document `ingest()` for TXT/MD/CSV/JSON, PDF (`pdf-parse`), DOCX (`mammoth`), and images (OCR/vision)
|
|
60
|
+
- Hybrid recall (semantic + BM25), metadata filters (`meta.*`), MMR, pluggable rerankers
|
|
61
|
+
- Pluggable chunking strategies and optional vision / OCR providers
|
|
62
|
+
- Website docs for v0.2 including Limitations and What’s New
|
|
63
|
+
- Dual-backend (SQLite + Postgres) test harness
|
|
64
|
+
|
|
65
|
+
### Changed
|
|
66
|
+
|
|
67
|
+
- LLM / `compress()` is optional (typed `Wolbarg<true>` when configured)
|
|
68
|
+
- Schema migrates to v2; storage moved behind `StorageProvider`
|
|
69
|
+
- Prefer constructor DI; `init()` remains as a compatibility shim
|
|
70
|
+
|
|
71
|
+
### Fixed
|
|
72
|
+
|
|
73
|
+
- Clearer configuration errors when optional ingest peers are missing
|
|
74
|
+
- PDF parser compatibility with `pdf-parse` v1 function API and v2 `PDFParse` class
|
|
75
|
+
|
|
76
|
+
### Notes / limitations
|
|
77
|
+
|
|
78
|
+
- PDF/DOCX/OCR require optional peers installed in the consumer app (not bundled)
|
|
79
|
+
- Scan/image-only PDFs need OCR/vision or a text-layer PDF
|
|
80
|
+
- Node `node:sqlite` is experimental; Node.js **22.5+** required
|
|
81
|
+
|
|
82
|
+
## [0.1.1] — previous
|
|
83
|
+
|
|
84
|
+
- Initial npm release path (pre–modular storage / ingest)
|
|
85
|
+
|
|
86
|
+
[0.2.1]: https://github.com/Atharvmunde11/wolbarg/releases/tag/v0.2.1
|
|
87
|
+
[0.2.0]: https://github.com/Atharvmunde11/wolbarg/releases/tag/v0.2.0
|
|
88
|
+
[0.1.1]: https://www.npmjs.com/package/wolbarg/v/0.1.1
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Wolbarg
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Wolbarg
|
|
2
|
+
|
|
3
|
+
**Modular, provider-agnostic semantic memory for AI agents (v0.3.0).**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/wolbarg)
|
|
6
|
+
[](./LICENSE)
|
|
7
|
+
[](https://wolbarg.com)
|
|
8
|
+
[](https://wolbarg.com/benchmarks)
|
|
9
|
+
|
|
10
|
+
## Benchmarks
|
|
11
|
+
|
|
12
|
+
**v0.2.1 Storage suite** (mock embeddings · scale quick) — dual-backend SQLite + PostgreSQL:
|
|
13
|
+
|
|
14
|
+
| Metric | Result |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| SQLite search @ 1k | **2.02 ms** |
|
|
17
|
+
| SQLite insert @ 1k | **1.72k ops/sec** |
|
|
18
|
+
| SQLite cold start | **7.91 ms** |
|
|
19
|
+
| Postgres 16 writers | **1.12k ops/sec** |
|
|
20
|
+
|
|
21
|
+
Storage (mock) ≠ LIVE (real providers). Full page: [wolbarg.com/benchmarks](https://wolbarg.com/benchmarks) · [methodology](https://wolbarg.com/docs/benchmarks) · [raw JSON](https://wolbarg.com/benchmarks/benchmark.json).
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install wolbarg
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Node.js **22.5+**.
|
|
30
|
+
|
|
31
|
+
### Optional peers (install when you use the feature)
|
|
32
|
+
|
|
33
|
+
| Peer | Required for |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| `pg` | `postgres({ … })` storage |
|
|
36
|
+
| `pdf-parse` (pin `@1.1.4`) | `ingest()` of `.pdf` files |
|
|
37
|
+
| `mammoth` | `ingest()` of `.docx` files |
|
|
38
|
+
| `tesseract.js` | OCR provider for images |
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Example: PDF + DOCX ingest
|
|
42
|
+
npm install pdf-parse@1.1.4 mammoth
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Important:** these packages are **not** bundled with `Wolbarg`. If you call `ingest()` on PDF/DOCX without the matching peer, Wolbarg throws a configuration error at use time (not at import). Plain `.txt` / `.md` / `.csv` / `.json` need no extras.
|
|
46
|
+
|
|
47
|
+
## Quick start
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import {
|
|
51
|
+
Wolbarg,
|
|
52
|
+
sqlite,
|
|
53
|
+
openaiEmbedding,
|
|
54
|
+
openaiLlm,
|
|
55
|
+
bm25,
|
|
56
|
+
meta,
|
|
57
|
+
} from "wolbarg";
|
|
58
|
+
|
|
59
|
+
const ctx = new Wolbarg({
|
|
60
|
+
organization: "my-org",
|
|
61
|
+
storage: sqlite("./memory.db"),
|
|
62
|
+
embedding: openaiEmbedding({
|
|
63
|
+
apiKey: process.env.OPENAI_API_KEY!,
|
|
64
|
+
model: "text-embedding-3-small",
|
|
65
|
+
}),
|
|
66
|
+
llm: openaiLlm({
|
|
67
|
+
apiKey: process.env.OPENAI_API_KEY!,
|
|
68
|
+
model: "gpt-4.1-mini",
|
|
69
|
+
}),
|
|
70
|
+
keywordSearch: bm25(),
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
await ctx.remember({
|
|
74
|
+
agent: "research",
|
|
75
|
+
content: { text: "Stripe supports recurring invoices." },
|
|
76
|
+
metadata: { topic: "billing" },
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const hits = await ctx.recall({
|
|
80
|
+
query: "recurring invoices",
|
|
81
|
+
topK: 5,
|
|
82
|
+
hybrid: true,
|
|
83
|
+
filter: { metadata: meta.eq("topic", "billing") },
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Required:** `organization`, `storage`, `embedding`.
|
|
88
|
+
**Optional:** `llm`, `keywordSearch`, `reranker`, `ocr`, `vision`, `chunking`, `compression`, `retrieval`.
|
|
89
|
+
|
|
90
|
+
Calling `compress` without `llm` is a TypeScript error.
|
|
91
|
+
|
|
92
|
+
## API
|
|
93
|
+
|
|
94
|
+
| Method | Description |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| `remember` | Store + embed |
|
|
97
|
+
| `recall` | Semantic / hybrid search |
|
|
98
|
+
| `ingest` | Documents → chunks → memories (**peers** for PDF/DOCX/OCR) |
|
|
99
|
+
| `compress` | LLM summary (needs `llm`) |
|
|
100
|
+
| `forget` / `history` / `stats` / `clear` | Management |
|
|
101
|
+
| `ready` / `close` | Lifecycle |
|
|
102
|
+
|
|
103
|
+
Full documentation: [wolbarg.com](https://wolbarg.com/docs/introduction)
|
|
104
|
+
|
|
105
|
+
## Limitations (v0.2)
|
|
106
|
+
|
|
107
|
+
- **Ingest peers are opt-in but required for those formats** — see table above.
|
|
108
|
+
- **PDF text layer only** via `pdf-parse`; scan/image PDFs need OCR/vision (or a text PDF). Older pdf.js in `pdf-parse@1.1.4` may reject some modern PDFs.
|
|
109
|
+
- **Node `node:sqlite` is experimental**; Node **22.5+** required.
|
|
110
|
+
- **Postgres** needs `pg`; `pgvector` is optional (falls back to byte embeddings + in-process distance).
|
|
111
|
+
- **Not** an agent framework, chat UI, or hosted vector SaaS.
|
|
112
|
+
|
|
113
|
+
See [Limitations (v0.2)](https://wolbarg.com/docs/guides/limitations) for the full list.
|
|
114
|
+
|
|
115
|
+
## Migration from 0.1
|
|
116
|
+
|
|
117
|
+
`init()` still works. Prefer constructor DI. LLM is optional. Schema auto-migrates to v2.
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
MIT
|