@infino-ai/langchain-infino

LangChain.js over Infino — vector,
full-text (BM25), hybrid (RRF), and SQL-native retrieval over one copy of your
data on object storage.
Most "vector database" LangChain integrations expose only the vector slice of
their engine. Infino keeps your data in Apache Parquet on object storage and
runs BM25, vector, hybrid, and SQL retrieval over it from a single in-process
engine — no separate search cluster or vector store to keep in sync. This
package surfaces that whole retrieval surface, not just similaritySearch.
Infino never embeds: you bring a LangChain Embeddings object and the
integration supplies the vectors.
Installation
npm install @infino-ai/langchain-infino @langchain/core @infino-ai/infino
Runtime: @infino-ai/infino is a native Node addon, so this runs in a
Node.js runtime (incl. Node serverless functions) — not the Edge runtime
or the browser. On serverless, point the catalog at object storage
(s3://…), since there's no persistent local disk.
Quickstart
import { connect } from "@infino-ai/infino";
import { OpenAIEmbeddings } from "@langchain/openai";
import { InfinoVectorStore } from "@infino-ai/langchain-infino";
const connection = connect("./data");
const embeddings = new OpenAIEmbeddings();
const store = await InfinoVectorStore.fromTexts(
["Infino runs search on object storage.", "One engine for SQL, BM25, and vectors."],
[{ source: "docs" }, { source: "docs" }],
embeddings,
{
connection,
tableName: "docs",
dim: 1536,
metadataColumns: { source: "large_utf8" },
},
);
const docs = await store.similaritySearch("search on S3", 2);
const filtered = await store.similaritySearch("search", 2, { source: { $eq: "docs" } });
const hybrid = await store.hybridSearch("search on object storage", 4);
const lexical = await store.bm25Search("object storage", 4);
const retriever = store.asRetriever();
Core concepts
- One table, one copy of the data.
doc_id (FTS-indexed) + page_content
(FTS-indexed) + embedding + any promoted metadata columns + a JSON
catch-all for the rest. BM25, vector, hybrid, and SQL all run over it.
- Bring your own embeddings. Pass any LangChain
Embeddings; dim must
match the model and the table's vector column.
- Filtering.
filter is a structured metadata predicate ($eq, $ne,
$gt/$gte/$lt/$lte, $in/$nin, $and/$or/$not) compiled to a
SQL WHERE over the promoted metadata columns — declare those in
metadataColumns at table creation.
API
InfinoVectorStore.fromTexts(texts, metadatas, embeddings, dbConfig) /
fromDocuments(docs, embeddings, dbConfig) — create the table and insert.
addDocuments / addVectors — upsert by id (re-adding overwrites).
similaritySearch / similaritySearchWithScore / similaritySearchVectorWithScore (filter supported).
maxMarginalRelevanceSearch(query, { k, fetchK, lambda, filter }).
hybridSearch(query, k) (BM25 + vector, RRF) · bm25Search(query, k, mode).
getByIds(ids) · delete({ ids }) · asRetriever().
dbConfig: { connection, tableName, dim, metric?, nCent?, textColumn?, vectorColumn?, idColumn?, metadataColumns? }.