BLOG | Technology

Introducing the Astra DB Plugin for Firebase Genkit

Updated: April 15, 2025
Introducing the Astra DB Plugin for Firebase Genkit

There are many challenges when building AI-powered applications—from data infrastructure management to the orchestration of intricate AI features. Genkit is a framework built by the Firebase team that helps you build, test and deploy AI features. Today, we're announcing the Astra DB Genkit plugin, a new integration that makes it easy to build retrieval-augmented generation (RAG) applications in Genkit using Astra DB for accurate, low-latency vector search.

Genkit does a lot of awesome things that make it a great framework to work with. For example, it provides:

  • a unified API for working with large language models (LLMs)
  • a local developer UI for quick experimentation and running evaluations
  • easy monitoring of your application in production

Genkit also makes it easy to build RAG applications, making embedding, indexing, and retrieving part of the framework's primitives. With the Astra DB Genkit plugin, developers can quickly integrate a scalable vector database into their Genkit AI applications. Here, we’ll show you how to get started with Genkit and Astra DB.

Using the Astra DB retriever from within the Genkit UI. You can enter your query at the top and options below. To the right are the schemas that are expected and at the bottom the results.

Using Astra DB in Genkit

It's easy to use Astra DB to embed, index, and retrieve your data within Genkit. First, you install the plugin:

npm install genkitx-astra-db

Then you create your database and a collection in your DataStax account, and, with the API endpoint of the database and an application token to access it, configure Genkit and Astra DB like this:

 

import { genkit } from "genkit";
import { textEmbedding004, googleAI } from "@genkit-ai/googleai";
import {
  astraDBIndexerRef,
  astraDBRetrieverRef,
  astraDB,
} from "genkitx-astra-db";

const ai = genkit({
  plugins: [
    googleAI(),
    astraDB([
      {
        clientParams: {
          applicationToken: process.env.ASTRA_DB_APPLICATION_TOKEN,
          apiEndpoint: process.env.ASTRA_DB_API_ENDPOINT,
        },
        collectionName: process.env.ASTRA_DB_COLLECTION_NAME,
        embedder: textEmbedding004,
      },
    ]),
  ],
});

You can then use the astraDBIndexerRef and astraDBRetrieverRef to access the indexer and retriever for Astra DB and use it according to the Genkit documentation on RAG.

Built-in vector embeddings

Astra DB makes it even easier to build RAG applications as it can handle vectorizing your data for you through Astra DB Vectorize. You can use Vectorize with Genkit too—just make sure you set your collection up with an associated embedding provider, like the built-in NVIDIA embedding provider (and then don't provide an embedder through Genkit). 

const ai = genkit({
  plugins: [
    googleAI(),
    astraDB([
      {
        clientParams: {
          applicationToken: process.env.ASTRA_DB_APPLICATION_TOKEN,
          apiEndpoint: process.env.ASTRA_DB_API_ENDPOINT,
        },
        collectionName: process.env.ASTRA_DB_COLLECTION_NAME,
      },
    ]),
  ],
});

This way Astra DB can handle embedding documents and queries and Genkit can handle the rest of the flow.

Try Astra DB with Genkit

Whether you're a Firebase developer or just like the look of the Genkit framework, we're excited to see what you can build using Genkit and Astra DB. The plugin is open source and available on GitHub, so please raise any issues you might run into there.

Check out the Astra DB and Firebase Genkit integration and this tutorial on how to build a RAG chat bot with Astra DB and Genkit And if you want to discuss how to best work with Astra DB then join us on Discord.


Frequently Asked Questions (FAQ)

What is Firebase Genkit?

Genkit is a framework specifically designed for web application developers to help them build AI-powered applications. It offers a unified API for working with LLMs, easy monitoring of applications in production, and it makes it easy to build RAG applications.

What is Astra DB?

Astra DB is a high-performance NoSQL database with built-in vector search and an intuitive Data API that is optimized for building generative AI applications.

What does the Astra DB Plugin for Firebase Genkit do?

The Astra DB Plugin for Firebase Genkit integrates Astra DB into the Genkit framework as an indexer and a retriever. This enables developers to efficiently embed, index, and retrieve data within their Genkit applications using Astra DB.

Where can I find the documentation and support for the Astra DB Plugin for Firebase Genkit?

Documentation for the plugin is available on the GitHub repository. You can also find more detailed guides and examples on building RAG applications with Genkit in the Firebase Genkit documentation.

Phil Nash

Phil Nash

Developer Relations Engineer

Phil is a developer relations engineer for DataStax and Google Developer Expert living in Melbourne, Australia. He's been working in developer relations for a decade, speaking at conferences since 2012, and writing JavaScript since before jQuery. Away from the keyboard, Phil enjoys travel, live music, and hanging out with his mini sausage dog, Ruby.

More Technology

View All