Repository navigation
ferrovec 0.5.0 — per-document metadata, LangChain.js adapter, local RAG example
Released together: crates.io https://crates.io/crates/ferrovec/0.5.0 and npm https://www.npmjs.com/package/ferrovec/v/0.5.0. The Rust core's code is unchanged from 0.4.0; its version moves to 0.5.0 so crate and npm share one release number.
Per-document metadata (npm)
insert(text, { id, metadata })stores a JSON object beside the text; it comes back on everyquery()hit andlist()row.- Covered by the same write-ahead log and checksummed snapshots as the text: a new log record kind (3) and an optional third element in the snapshot's text table. 0.5 reads every 0.4 store unchanged.
- Capped at 64 KiB per document;
TypeErrorfor anything that is not plain JSON,RangeError('metadata too large')over the cap. An upsert withoutmetadataclears the previous metadata. - Upgrade note: 0.4.x cannot open a store that contains metadata (it truncates the log at the first metadata record and rejects a snapshot slot that holds any). Close every tab of your app before upgrading.
LangChain.js adapter — ferrovec/langchain
FerrovecVectorStore, a LangChainVectorStore:addDocuments,similaritySearch/similaritySearchWithScorewith an exact-match metadata filter,delete,fromDocuments,fromTexts, and the inheritedasRetriever().@langchain/core ^1is an optional peer dependency, only loaded when you import the subpath.
Example — examples/ai-sdk-local-rag
- Vite page: notes go into ferrovec in the browser, a Vercel AI SDK tool call retrieves them, the model answers through any OpenAI-compatible endpoint (Ollama on localhost by default). Nothing leaves the machine.
Tests
- Node 90 pass / 1 skipped, browser durability 5/5 including a new kill-and-reopen metadata case, chaos harness 100 cycles / 467 acknowledged writes / 0 lost.