Skip to content

ferrovec 0.5.0 — per-document metadata, LangChain.js adapter, local RAG example

Choose a tag to compare

@singhpratech singhpratech released this 09 Nov 02:41
· 14 commits to main since this release

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 every query() hit and list() 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; TypeError for anything that is not plain JSON, RangeError('metadata too large') over the cap. An upsert without metadata clears 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 LangChain VectorStore: addDocuments, similaritySearch / similaritySearchWithScore with an exact-match metadata filter, delete, fromDocuments, fromTexts, and the inherited asRetriever().
  • @langchain/core ^1 is 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.