Skip to main content
The Firebase plugin extends Genkit with three capabilities:
  1. Firestore vector search — use Cloud Firestore’s native vector similarity search as a retriever for RAG pipelines.
  2. Firebase Genkit Monitoring — export traces, metrics, and logs to the Google Cloud Observability suite through a single call.
  3. Firebase Auth integration — verify Firebase ID tokens to protect HTTP-triggered flows (Go only, see auth.go).

Installation

Configuration

The TypeScript Firebase plugin does not use a plugin initializer — it exports standalone functions (defineFirestoreRetriever, enableFirebaseTelemetry) that you call directly.Make sure the Firebase Admin SDK is initialised before using these functions:

Firestore as a vector store

Firestore’s vector search lets you find documents whose embedding vectors are nearest to a query embedding. Genkit wraps this with a retriever so your flows can use it for RAG.

Prerequisites

Before querying, create a vector index on the Firestore collection:

Defining a retriever

Querying the retriever

Indexing documents

Indexing (writing embeddings to Firestore) is handled outside the plugin — you embed each document and write it to the collection using the Firebase Admin SDK:

Firebase Genkit Monitoring

Enable telemetry export to Google Cloud Trace, Logging, and Monitoring:
enableFirebaseTelemetry delegates to the @genkit-ai/google-cloud plugin internally, so all Google Cloud Observability features are available.
When deploying to Firebase App Hosting or Cloud Run, the project ID and credentials are automatically inferred from the runtime environment. No additional configuration is needed.

Firebase Auth for flow security

In Go, the Firebase plugin provides an Auth client you can use to verify Firebase ID tokens in HTTP middleware:

Deploying to Firebase App Hosting

Firebase App Hosting has native support for Genkit. Set up Firebase and deploy:
See the Firebase deployment guide for a complete walkthrough including environment variable configuration and telemetry setup.

RAG guide

Build retrieval-augmented generation pipelines end-to-end.

Firebase deployment

Deploy Genkit flows to Firebase App Hosting.

Vertex AI plugin

Vertex AI Vector Search for larger-scale retrieval.

Observability

Traces, metrics, and logging in production.