Skip to main content

genkitx-lancedb

Genkit is an open-source framework for building end-to-end AI and RAG pipelines with a clean, TypeScript-first developer experience. The genkitx-lancedb plugin lets you use LanceDB as a high-performance vector store inside your Genkit flows, so you can index, search, and retrieve data efficiently as part of your AI applications.

Installation

Usage

Adding LanceDB plugin to your genkit instance.
TypeScript
You can run this app with the following command:
This’ll add LanceDB as a retriever and indexer to the genkit instance. You can see it in the GUI view Screenshot 2025-05-11 at 7 21 05 PM

Testing retrieval on a sample table

To see the raw retrieval results, open the LanceDB retriever in the Genkit Developer UI, enter a query and run it: Screenshot 2025-05-11 at 7 21 05 PM The retriever returns 5 results from the LanceDB table. Each result looks something like this: Screenshot 2025-05-11 at 7 21 18 PM

Creating a custom RAG flow

Now that we’ve seen how you can use LanceDB in a Genkit pipeline, let’s refine the flow and create a RAG. A RAG flow will consist of an index and a retriever with its outputs postprocessed and fed into an LLM for final response

Creating custom indexer flows

You can also create custom indexer flows, using more options and features provided by LanceDB.
TypeScript
Screenshot 2025-05-11 at 8 35 56 PM In your console, you can see the logs Screenshot 2025-05-11 at 7 19 14 PM

Creating custom retriever flows

You can also create custom retriever flows, using more options and features provided by LanceDB.
TypeScript
Now using our retrieval flow, we can ask a question about the ingested PDF Screenshot 2025-05-11 at 7 18 45 PM