Announcing Firebase Genkit for Node.js 1.0

A framework for building and deploying AI-powered apps

The demand for intelligent, personalized apps is skyrocketing. Integrating AI is no longer a future aspiration – it’s becoming a core requirement for engaging users and streamlining workflows. That’s where Firebase Genkit comes in.

We’re thrilled to announce that after a successful preview at Google I/O 2024, Genkit for Node.js is now at version 1.0 and ready for production use. This is a significant milestone, and we couldn’t have reached it without the valuable feedback from our community. We’ve been hard at work refining the core primitives, expanding features, and making Genkit more powerful and user-friendly.

Genkit is an open source, developer-first framework for building AI-powered features for your apps

Genkit is an open-source framework that enables developers to integrate AI-powered agents, automations, and features directly into their applications. Genkit offers out-of-the-box support for Google’s Gemini models, Imagen and Anthropic models via Vertex and a wide range of other models through our community plugins including OpenAI and GitHub. Furthermore, Genkit facilitates the use of self-hosted open models like Gemma, Llama, and DeepSeek via its Ollama integration. As of today, Genkit is production-ready for Node.js and in alpha for Go. It also has built-in local developer tooling for testing, debugging, and prompt management.

  1. A developer-focused framework for AI
  2. AI focused local development
  3. Built for apps in production
  4. Agents

Let’s dive into what makes Genkit 1.0 the right choice for your next AI-powered app:

Core Building Blocks for AI

Genkit provides powerful AI primitives that make building complex AI features easy:

  • Unified Generation API: Use models from any provider within Genkit’s growing plugin ecosystem to generate content.
Generating text with Gemini 2.0 Flash
import { genkit } from 'genkit';
import { googleAI, gemini20Flash } from '@genkit-ai/googleai';

const ai = genkit({
  plugins: [googleAI()],
  model: gemini20Flash,  // Set default model
});

// Simple generation
const { text } = await ai.generate('Why is AI awesome?');
console.log(text);
Copied!
  • Structured Generation: Generate and stream structured data, including JSON and custom formats, with built-in validation for easy app integration and data handling.

  • Tool / Function Calling: Enable models to automatically call custom functions to complete complex tasks, unlocking sophisticated agentic capabilities.

  • Vector Search (RAG): Improve the relevance and accuracy of generated content by retrieving important context from various data sources.

Powerful Developer Tooling for Rapid Iteration

Genkit comes with a comprehensive suite of built-in developer tools designed to streamline your AI development. Genkit provides a dedicated CLI and local-first Developer UI that empowers you to build, text, and refine your AI applications.

  • Rapid turn-around times: Effortlessly experiment with different AI functions, prompts, and queries to fine-tune your application’s behavior and optimize its performance. The intuitive interface allows you to quickly iterate and test variations, ensuring you achieve the desired results.

  • Efficient debugging: Identify and resolve issues with ease using Genkit’s detailed execution traces. The Developer UI provides in-depth insights into the execution flow of your AI functions, allowing you to pinpoint errors and debug effectively.

  • Comprehensive Evaluation: Assess the quality of generated results across multiple test cases. The Developer UI enables you to systematically build test datasets and evaluate your AI features and identify areas for improvement.

The Genkit Developer UI is designed to give you control over your AI development, providing you with the insights needed to build high-quality AI applications efficiently.

Production Monitoring with Minimal Setup, Full Visibility

Genkit includes built-in production monitoring. When you deploy Genkit to Firebase or Google Cloud, you gain access to our new AI monitoring dashboards directly within the Firebase Console.

How many tokens do your AI features consume? What’s the latency of database access in a RAG flow? How many of your LLM calls fail? You can find the answers to these questions and more in the Firebase console. The Genkit console experience provides direct insights into key metrics and even allows you to inspect production traces of your application.

These traces can also be exported and used for evaluations directly within Genkit, enabling you to iterate and improve your features. All of this empowers you to operate high-quality, safe, and efficient generative AI features in production.

To enable AI monitoring for your Genkit app, import the Firebase plugin and configure telemetry as follows:

Enabling AI monitoring
import { enableFirebaseTelemetry } from "@genkit-ai/firebase";

enableFirebaseTelemetry();
Copied!

Check out the documentation for the Firebase plugin for full instructions to set up Genkit Monitoring.

Building Agentive Apps

In Genkit 1.0, we’ve stabilized the core primitives developers need to build any AI-powered feature.

Building on top of these primitives, we are striving to make it even easier for developers to bring agentive experiences to their apps with:

  • Chat API: Use the multi-turn chat API (with plugin-friendly storage adapter) to create engaging, conversational agents.
  • Session State: Leverage shared session state to create context-aware agents that can personalize interactions based on past activity.
  • Multi-Agent Systems: Combine any prompt to create sophisticated multi-agent systems, leveraging existing primitives, and unlocking new possibilities for complex workflows.

This is currently available through our beta namespace, as we rapidly iterate based on feedback from you, our users.

Here’s a complete multi-agent example:

Genkit multi-agent flow
import { genkit } from "genkit/beta";
import { gemini20Flash, googleAI } from "@genkit-ai/googleai";

const ai = genkit({
  plugins: [googleAI()],
  model: gemini20Flash,
});

const poet = ai.definePrompt({
  name: "poet",
  description: "transfer to this agent for eloquent writing",
  system: "You are the world's greatest poet, known for your award-winning prose.",
  tools: ["pirate"],
});

const pirate = ai.definePrompt({
  name: "pirate",
  description:
      "transfer to this agent for about oceanography, sailing, or parrots",
  system: "You are a pirate who loves sea shanties.",
  tools: ["poet"],
});

const chat = ai.chat(poet);
chat.send("Tell me about games or hobbies that help pass the time on a long voyage.");
Copied!

Getting started

Ready to get started? Check out the Genkit documentation, which provides all the info you need to get going:

  • Getting Started Guide: Step-by-step instructions for installing Genkit and building your first AI app in minutes.
  • Building AI Workflows: Dive deeper into the specific features and functionality of Genkit.
  • Genkit Fundamentals Video: A visual, comprehensive overview of the core concepts and features you need to start building.
  • Genkit by Example: Explore key Genkit features in an interactive playground right next to the source code
  • Migration Guide: A comprehensive guide to help you upgrade from Genkit 0.9 to 1.0

What’s next?

We’re excited about the future of Genkit and are committed to continuous improvement and expansion. We encourage you to try out the beta features (especially agents) and share your feedback with us. To use the beta channel, import from the genkit/beta package.

To stay informed about our upcoming plans and features, check out our public roadmap.

Got questions or feedback? Join us on our Discord server, or Stack Overflow. For feature requests and bug reports, hit us up on the GitHub issue tracker or User Voice.

Your feedback and engagement are crucial to making Genkit the best platform for building AI-powered applications. We’re excited to see what you build!