# Firebase Developers - Medium

Tutorials, deep-dives, and random musings from Firebase developers all around the world. Views expressed are those of the authors and don't necessarily reflect those of Firebase or its parent companies. - Medium

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Beyond the Spinner: Building Responsive AI Apps with Genkit Streaming

DevFeed: [Beyond the Spinner: Building Responsive AI Apps with Genkit Streaming](<https://devfeed.tech/articles/beyond-the-spinner-building-responsive-ai-apps-with-genkit-streaming-23892.md>)

Original publisher: [Read original article](<https://medium.com/firebase-developers/streaming-made-easy-with-genkit-a6f9da52a76a?source=rss----8e8b7dc6774d---4>)

Author: Pavel J

Published: 2025-10-28T10:35:17Z

Content type: tutorial

Language: en

Sources: [Firebase Developers - Medium](<https://devfeed.tech/sources/firebase-developers-medium.md>)

Topics: [Genkit](<https://devfeed.tech/topics/genkit.md>), [Streaming](<https://devfeed.tech/topics/streaming.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [User experience (UX)](<https://devfeed.tech/topics/ux.md>), [Structured-data](<https://devfeed.tech/topics/structured-data.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [await](<https://devfeed.tech/tags/await.md>), [genkit](<https://devfeed.tech/tags/genkit.md>), [json](<https://devfeed.tech/tags/json.md>), [llm](<https://devfeed.tech/tags/llm.md>), [process](<https://devfeed.tech/tags/process.md>), [streaming](<https://devfeed.tech/tags/streaming.md>), [ux](<https://devfeed.tech/tags/ux.md>)

### AI overview

A practical guide to using Genkit streaming for responsive AI applications. It covers streaming LLM response chunks with generateStream and callbacks, awaiting final response metadata, parsing incomplete streamed JSON, and streaming custom AI logic from flows.

### Source excerpt

Better AI UXA practical guide to streaming LLM responses, partial JSON, and custom status messages to eliminate perceived latency. In the new age of AI, streaming structured data has suddenly become useful and mainstream. The main reason is that LLMs can be slow, and a good user experience (UX) strives to reduce this perceived latency. We could show a spinner for a few seconds, but that feels slow. Instead, if we start rendering content as soon as we receive the first few tokens from the LLM, the user can watch the response "grow in front of their eyes." Even if the end-to-end time is the same, it feels faster because the user sees activity immediately. BTW, this sample app (streaming side only) is available at: https://github.com/genkit-ai/samples/tree/main/simple-chatbot Streaming is foundational to Genkit's design. Everything in Genkit is built on top of actions -- simple, function-like constructs that, among other things, can stream. Models are actions, and flows are actions, so they can all stream. LLM streams Let's start with receiving streams from LLMs. The most common and useful way is to use the generateStream function: const { stream, response } = ai.generateStream({ prompt: 'Tell me a story about AI', }); for await (const chunk of stream) { process.stdout.write(chunk.text); } // optional const finalResponse = await response; console.log(finalResponse.usage); console.log(finalResponse.messages); // history In addition to the stream of "generate response chunks," we can optionally await the response promise. This is useful because it contains final usage data (like token counts), the complete message array (great for tracking history), and other metadata. If you don't like using the for await syntax and prefer callbacks, there's another less known way to stream using the generate function, by providing the onChunk callback: const response = await ai.generate({ prompt: 'Tell me a story aboud AI', onChunk: (chunk) => process.stdout.write(chunk.text), }); conso

## Building Arc: An AI Messenger Powered by Firebase, Flutter, and Vertex AI

DevFeed: [Building Arc: An AI Messenger Powered by Firebase, Flutter, and Vertex AI](<https://devfeed.tech/articles/building-arc-an-ai-messenger-powered-by-firebase-flutter-and-vertex-ai-23884.md>)

Original publisher: [Read original article](<https://medium.com/firebase-developers/building-arc-an-ai-messenger-powered-by-firebase-flutter-and-vertex-ai-f8a3d947c247?source=rss----8e8b7dc6774d---4>)

Author: TAKAYUKI MIYANO

Published: 2025-10-27T07:49:55Z

Content type: article

Language: en

Sources: [Firebase Developers - Medium](<https://devfeed.tech/sources/firebase-developers-medium.md>)

Topics: [App](<https://devfeed.tech/topics/app.md>), [Architecture & Design](<https://devfeed.tech/topics/architecture-design.md>), [Firebase](<https://devfeed.tech/topics/firebase.md>), [Flutter](<https://devfeed.tech/topics/flutter.md>), [Cloud Run](<https://devfeed.tech/topics/cloud-run.md>), [Cloud Functions](<https://devfeed.tech/topics/cloud-functions.md>), [Retrieval Augmented Generation (RAG)](<https://devfeed.tech/topics/retrieval-augmented-generation-rag.md>), [Messaging](<https://devfeed.tech/topics/messaging.md>), [Microservices](<https://devfeed.tech/topics/microservices.md>), [Security](<https://devfeed.tech/topics/security.md>), [Resilience](<https://devfeed.tech/topics/resilience.md>), [networking](<https://devfeed.tech/topics/networking.md>)

Tags: [architecture](<https://devfeed.tech/tags/architecture.md>), [cloud-functions](<https://devfeed.tech/tags/cloud-functions.md>), [cloud-run](<https://devfeed.tech/tags/cloud-run.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [flutter](<https://devfeed.tech/tags/flutter.md>), [gemini](<https://devfeed.tech/tags/gemini.md>), [messenger](<https://devfeed.tech/tags/messenger.md>), [microservices](<https://devfeed.tech/tags/microservices.md>), [resilience](<https://devfeed.tech/tags/resilience.md>), [retrieval-augmented-generation](<https://devfeed.tech/tags/retrieval-augmented-generation.md>), [security](<https://devfeed.tech/tags/security.md>), [vertex-ai](<https://devfeed.tech/tags/vertex-ai.md>)

### AI overview

This article describes the architecture of Arc, a private messaging app built with Flutter and Firebase. It covers ephemeral messaging, mesh networking for resilience, Cloud Run microservices, Cloud Functions for event-driven processing, and a RAG architecture using Vertex AI Search and Gemini models. It also discusses security, privacy, and GenAI companions.

### Source excerpt

Introduction: The Vision of Arc Our journey at Arc began with a singular vision: to redefine private communication in the digital age. We envisioned a world of ephemeral, intimate conversations -- a space where privacy isn't an afterthought, but the very foundation. This philosophy gave birth to Arc, a next-generation messaging app where every message, even in group chats, is designed to disappear over time. Our vision goes beyond just ephemerality. We also saw a critical need to build resilience, especially in regions with unstable internet infrastructure and in a world where disasters are a constant threat. This led us to develop our mesh networking technology, a potential lifeline when traditional communication fails. Our mission is to transform our app into a vital piece of social infrastructure that protects people's safety and gives them peace of mind. However, a vision of this scale demands an architecture that can compete on a global level. For us, true "optimization" is a comprehensive concept built on four pillars: Stability, Speed, Lightweight Design, and High Security. In this article, we'll explore the architectural decisions that shaped Arc. We'll detail how we integrated Flutter as our client, used Firebase's managed services as our foundation, and combined them with Cloud Run for scalable microservices, Cloud Functions for event-driven processing, and an advanced RAG (Retrieval-Augmented Generation) architecture using Vertex AI Search for grounding and Gemini models. This is the story of how we built a platform that is not only secure and high-performance but also intelligent and ready for future evolution. The Challenge: Going Beyond a Standard Messenger To make Arc a reality, we faced numerous technical hurdles that went beyond conventional architectures. Our goal wasn't just to build another messaging app; it was to create a new conversational experience and a resilient communication platform. Our app also includes GenAI companions (AI Characters)

## Dynamic configuration in Java with Server-Side Firebase Remote Config

DevFeed: [Dynamic configuration in Java with Server-Side Firebase Remote Config](<https://devfeed.tech/articles/dynamic-configuration-in-java-with-server-side-firebase-remote-config-23887.md>)

Original publisher: [Read original article](<https://medium.com/firebase-developers/dynamic-configuration-in-java-using-server-side-firebase-remote-config-9d30a3c2e1a1?source=rss----8e8b7dc6774d---4>)

Author: Athira M

Published: 2025-10-24T06:33:20Z

Content type: tutorial

Language: en

Sources: [Firebase Developers - Medium](<https://devfeed.tech/sources/firebase-developers-medium.md>)

Topics: [Firebase](<https://devfeed.tech/topics/firebase.md>), [Java](<https://devfeed.tech/topics/java.md>), [Back end](<https://devfeed.tech/topics/backend.md>), [SDKs](<https://devfeed.tech/topics/sdks.md>), [feature flags](<https://devfeed.tech/topics/feature-flags.md>), [Firebase console](<https://devfeed.tech/topics/firebase-console.md>)

Tags: [backend](<https://devfeed.tech/tags/backend.md>), [feature-flags](<https://devfeed.tech/tags/feature-flags.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [firebase-console](<https://devfeed.tech/tags/firebase-console.md>), [firebase-remote-config](<https://devfeed.tech/tags/firebase-remote-config.md>), [java](<https://devfeed.tech/tags/java.md>), [maven](<https://devfeed.tech/tags/maven.md>), [remote-config](<https://devfeed.tech/tags/remote-config.md>), [sdks](<https://devfeed.tech/tags/sdks.md>)

### AI overview

This tutorial explains how to use server-side Firebase Remote Config with Java to externalize backend configuration and feature flags. It describes how the Java server fetches the full configuration template, evaluates conditions locally through the SDK, initializes the Firebase Admin SDK, defines safe defaults, and evaluates parameters using runtime context.

### Source excerpt

Dynamic Configuration in JavaUsing Server-Side Firebase Remote Config Firebase Remote Config is a powerful, cloud-based service that lets you dynamically change your app's behavior and appearance without requiring users to update your app. It's been a game-changer for feature flags and dynamic theming on mobile and web platforms. But what about your backend, or your critical API or Java micro-service? The great news is that Firebase has expanded its support, bringing this powerful tool to the server side with SDKs for Node.js, Python, Go, and Java. This allows you to control server behavior and externalize configuration directly from the Firebase console. The key difference: where evaluation happens If you're familiar with client-side Remote Config, you know the client makes a request, and the Firebase service returns the final, evaluated configuration. The server-side model is fundamentally different: The Java server fetches the entire configuration template (parameters, values, and conditions) from the Remote Config service. The Java server then performs the condition evaluation locally, using the SDK. This shift means your server is in control, making local decisions based on attributes like user ID, location, or subscription tier. This is efficient and perfect for dynamic server logic. 🛠 Setting up Remote Config in Java Let's walk through how to integrate this into your backend, using a Payment Gateway Feature Flag as our running example. Step 1: Add the Firebase Admin SDK First, add the Firebase Admin SDK dependency to your project's configuration file (e.g., pom.xml for Maven). <dependency> <groupId>com.google.firebase</groupId> <artifactId>firebase-admin</artifactId> <version>9.7.0</version> </dependency>Step 2: Initialize the Admin SDK Your server needs secure access to Firebase. We'll use a Service Account to initialize the Admin SDK. import com.google.auth.oauth2.GoogleCredentials; import com.google.firebase.FirebaseApp; import com.google.firebase.Firebas

## Dart Client for Genkit

DevFeed: [Dart Client for Genkit](<https://devfeed.tech/articles/dart-client-for-genkit-23886.md>)

Original publisher: [Read original article](<https://medium.com/firebase-developers/dart-client-for-genkit-call-genkit-flows-from-flutter-dart-b5a2c9b9400e?source=rss----8e8b7dc6774d---4>)

Author: Nozomi Koborinai

Published: 2025-10-23T10:49:27Z

Content type: tutorial

Language: en

Sources: [Firebase Developers - Medium](<https://devfeed.tech/sources/firebase-developers-medium.md>)

Topics: [Genkit](<https://devfeed.tech/topics/genkit.md>), [Dart](<https://devfeed.tech/topics/dart.md>), [client library](<https://devfeed.tech/topics/client-library.md>), [Flutter](<https://devfeed.tech/topics/flutter.md>), [AI Development](<https://devfeed.tech/topics/ai-development.md>), [Cloud Functions](<https://devfeed.tech/topics/cloud-functions.md>), [Cloud Run](<https://devfeed.tech/topics/cloud-run.md>)

Tags: [ai-development](<https://devfeed.tech/tags/ai-development.md>), [apis](<https://devfeed.tech/tags/apis.md>), [client-library](<https://devfeed.tech/tags/client-library.md>), [dart](<https://devfeed.tech/tags/dart.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [flutter](<https://devfeed.tech/tags/flutter.md>), [genkit](<https://devfeed.tech/tags/genkit.md>), [google-cloud-platform](<https://devfeed.tech/tags/google-cloud-platform.md>), [http](<https://devfeed.tech/tags/http.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [server-sent-events-sse](<https://devfeed.tech/tags/server-sent-events-sse.md>), [streaming](<https://devfeed.tech/tags/streaming.md>)

### AI overview

This article introduces a Dart client library for calling Genkit flows deployed on a server from Flutter or other Dart applications. It explains that the library handles Genkit request and response conventions, reduces repeated HTTP client code, supports authentication mechanisms, and simplifies streaming responses through Server-Sent Events. The client can call flows implemented with Genkit JS, TypeScript, or Go when their server endpoints are accessible.

### Source excerpt

Introducing the Dart Client for GenkitCalling Genkit Flows from Flutter/DartDart client for Genkit I'm a big fan of Firebase and often choose Flutter as my front-end framework. Since Google I/O 2024, I've been continuously exploring Genkit. Developed by the Firebase team, Genkit is an open-source framework from Google that simplifies the definition of AI-powered processing sequences on the server-side as Flows. Genkit | Open-source AI development framework by Google However, calling a server-defined flow from a Dart/Flutter client application required some extra effort. To bridge this gap, I developed the Dart client for Genkit package. genkit | Dart package Note: This library is not for defining Genkit flows themselves. It is specifically designed for easily and securely calling flows deployed on a server from a Dart client.Library overview As mentioned above, this library is a dedicated client for easily calling Genkit flows deployed on a server (e.g., as Web APIs on platforms like Cloud Functions for Firebase, Cloud Run, or GKE). It is not for implementing Genkit flows in Dart. The challenges before Previously, calling a Genkit flow from Dart/Flutter required manually implementing an HTTP client according to a set of conventions. For example, here's a typical piece of code using the dio package to call an image generation flow defined in Genkit. Future<String> generateImage({required String imageDescription}) async { try { final response = await dio.post( 'https://<YOUR_GENKIT_ENDPOINT>/generateImage', data: { 'data': { 'imageDescription': imageDescription, }, }, ); if (response.statusCode == 200) { return response.data['result']['url'] as String; } throw Exception('Failed to generate image: ${response.statusCode}'); } on DioException catch (e) { throw Exception('Failed to generate image: ${e.message}'); } } This code presents several challenges: When sending a request, the input must be wrapped in {'data': ...}, and when receiving a response, the result must be ex

## Building Your First MCP Server with Genkit

DevFeed: [Building Your First MCP Server with Genkit](<https://devfeed.tech/articles/building-your-first-mcp-server-with-genkit-23885.md>)

Original publisher: [Read original article](<https://medium.com/firebase-developers/building-your-first-mcp-server-with-genkit-c2053cde230f?source=rss----8e8b7dc6774d---4>)

Author: Pavel J

Published: 2025-04-25T14:09:50Z

Content type: tutorial

Language: en

Sources: [Firebase Developers - Medium](<https://devfeed.tech/sources/firebase-developers-medium.md>)

Topics: [Genkit](<https://devfeed.tech/topics/genkit.md>), [Model Context Protocol](<https://devfeed.tech/topics/model-context-protocol.md>), [MCP Server](<https://devfeed.tech/topics/mcp-server.md>), [backends](<https://devfeed.tech/topics/backends.md>), [Firestore](<https://devfeed.tech/topics/firestore.md>), [Structured-data](<https://devfeed.tech/topics/structured-data.md>), [AI Development](<https://devfeed.tech/topics/ai-development.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [developer tooling](<https://devfeed.tech/topics/developer-tooling.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [backends](<https://devfeed.tech/tags/backends.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [firestore](<https://devfeed.tech/tags/firestore.md>), [generative-ai](<https://devfeed.tech/tags/generative-ai.md>), [generative-ai-tools](<https://devfeed.tech/tags/generative-ai-tools.md>), [genkit](<https://devfeed.tech/tags/genkit.md>), [guides](<https://devfeed.tech/tags/guides.md>), [mcp](<https://devfeed.tech/tags/mcp.md>), [mcp-server](<https://devfeed.tech/tags/mcp-server.md>), [schema](<https://devfeed.tech/tags/schema.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

This tutorial explains how to build a custom MCP server with Genkit. It covers defining order data schemas with zod, generating optional test data and storing it in Firestore, creating flows to retrieve orders, and exposing tools that can be called by AI models or external clients such as Cline.

### Source excerpt

Generative AI Building robust backends for AI applications often involves integrating various components. The Model Context Protocol (MCP) offers a standardized communication layer, and Genkit provides a powerful framework to leverage it. This article guides you through creating a custom MCP server using Genkit, from defining data schemas to interacting with the server using development tools like Cline. This article assumes some familiarity with Genkit concepts like flows and tools. Learn more about Genkit: https://firebase.google.com/docs/genkit If you prefer this tutorial in video format, check out: https://medium.com/media/908bbf0df5ad1306b125a4c7411c203c/href1. Defining Your Data Schema Before building any application, you need to define the structure of your data. In this example, we're building a system to manage website orders for a consulting company. We use zod, a popular schema declaration library, integrated with Genkit. The OrderSchema defines the necessary fields for each order: const OrderSchema = z.object({ id: z.string().describe("Order Id. Format: A-XXX-XXX, ex. A-123-456"), name: z.string().describe("Name of the business"), colorScheme: z.object({ mainColor: z.string().describe("RGB color prefixed with #, ex. #FFAA66"), highlight: z.string().describe("RGB color prefixed with #, ex. #AA6611"), textColor: z.string().describe("RGB color prefixed with #, ex. #224455"), }), email: z.string(), jobDescription: z .string() .describe( "Detailed description of the website they need. Ex. if they are a construction " + "company describe what they want on the home, contact age, testimonials, etc. " + "pages. Not too crazy, usually static website." ), address: z.string(), }); This schema clearly outlines each piece of information associated with an order, including nested details like the colorScheme. 2. Generating Realistic Test Data (optional) During development, you need ways to both populate your system with test data and inspect that data. Manually creatin

## How to Develop Firebase Genkit Flows

DevFeed: [How to Develop Firebase Genkit Flows](<https://devfeed.tech/articles/how-to-develop-firebase-genkit-flows-23890.md>)

Original publisher: [Read original article](<https://medium.com/firebase-developers/how-to-develop-firebase-genkit-functions-2677b386a227?source=rss----8e8b7dc6774d---4>)

Author: Nozomi Koborinai

Published: 2025-03-15T10:00:54Z

Content type: tutorial

Language: en

Sources: [Firebase Developers - Medium](<https://devfeed.tech/sources/firebase-developers-medium.md>)

Topics: [Genkit](<https://devfeed.tech/topics/genkit.md>), [Firebase](<https://devfeed.tech/topics/firebase.md>), [Firestore](<https://devfeed.tech/topics/firestore.md>), [test](<https://devfeed.tech/topics/test.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [emulator](<https://devfeed.tech/tags/emulator.md>), [emulator-suite](<https://devfeed.tech/tags/emulator-suite.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [firestore](<https://devfeed.tech/tags/firestore.md>), [gemini](<https://devfeed.tech/tags/gemini.md>), [genkit](<https://devfeed.tech/tags/genkit.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

This tutorial explains how to test Firebase Genkit Flows locally. It describes the limitations of the Genkit Developer UI when flows need Firebase services such as Firestore or Cloud Storage, and presents the Firebase Local Emulator Suite as a way to simulate those services for local testing.

### Source excerpt

AIHow to Develop Genkit Flows Genkit includes a powerful tool called the Genkit Developer UI that can significantly accelerate the development of Genkit Flows by enabling local testing. However, when integrating with other Firebase products, such as Firestore or Cloud Storage, the Genkit Developer UI may not be sufficient. In this article, I'll walk you through how to enhance your local testing environment by integrating the Firebase Local Emulator Suite to test Genkit Flows more effectively. Genkit Developer UI The Genkit Developer UI is an essential tool that allows you to verify the behavior of Genkit Flows locally before deploying them. (It has a great UI, and it's super exciting to use!!) While the Genkit Developer UI provides a fantastic developer experience, it does have some limitations. The Limitation The challenge comes when you need to integrate other Firebase products. For example, when you create a configuration where Genkit communicates with Firestore, such as the one I discussed in my previous article, "8 Genkit Architectures to Orchestrate Firebase & AI". To clarify this, let's look at two cases. Working with self-contained flowsOK case In this case, the entire processing is self-contained within Genkit, with no need to integrate Firebase products like Firestore or Cloud Storage, so you can run everything locally using the Genkit Developer UI. export const firebaseAuthFlow = onFlow( ai, { name: `firebaseAuthFlow`, outputSchema: z.string(), authPolicy: firebaseAuth((user) => { if (user.firebase?.sign_in_provider !== `anonymous`) { throw new Error(`Only anonymously authenticated users can access this function`) } }), httpsOptions: { secrets: [googleAIapiKey], cors: true, }, }, async () => {} ) Even though this function uses authPolicy with Firebase Authentication, Genkit Developer UI allows you to inject an authentication provider, so local testing is still possible. Working with Flows that require Firebase servicesFurther testing required case In this

## internal AI: A Genkit-Based Internal AI Chat Released as Open Source!

DevFeed: [internal AI: A Genkit-Based Internal AI Chat Released as Open Source!](<https://devfeed.tech/articles/internal-ai-a-genkit-based-internal-ai-chat-released-as-open-source-23891.md>)

Original publisher: [Read original article](<https://medium.com/firebase-developers/internal-ai-a-genkit-based-internal-ai-chat-released-as-open-source-37795896a106?source=rss----8e8b7dc6774d---4>)

Author: tanabee

Published: 2025-02-17T17:14:41Z

Content type: article

Language: en

Sources: [Firebase Developers - Medium](<https://devfeed.tech/sources/firebase-developers-medium.md>)

Topics: [Genkit](<https://devfeed.tech/topics/genkit.md>), [AI Chat](<https://devfeed.tech/topics/ai-chat.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [Firebase](<https://devfeed.tech/topics/firebase.md>), [Retrieval-Augmented Generation](<https://devfeed.tech/topics/retrieval-augmented-generation.md>), [Generative AI](<https://devfeed.tech/topics/generative-ai.md>)

Tags: [emulator](<https://devfeed.tech/tags/emulator.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [firestore](<https://devfeed.tech/tags/firestore.md>), [function-calling](<https://devfeed.tech/tags/function-calling.md>), [gemini](<https://devfeed.tech/tags/gemini.md>), [genkit](<https://devfeed.tech/tags/genkit.md>), [google-cloud-platform](<https://devfeed.tech/tags/google-cloud-platform.md>), [llm](<https://devfeed.tech/tags/llm.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [rag](<https://devfeed.tech/tags/rag.md>), [vertex-ai](<https://devfeed.tech/tags/vertex-ai.md>)

### AI overview

This article introduces internal AI, an open-source Genkit-based internal chat implementation. It describes its usage-based pricing, customizable RAG and function-calling support, Firebase deployment, monitoring, domain restrictions, and local testing with the Firebase Emulator.

### Source excerpt

internal AI: An open-source Genkit-based internal AI chat implementation I have released internal AI, an AI chat solution you can easily and cost-effectively run internally, under an open-source license! Recently, Firebase Genkit reached version 1.0 and became stable for production use. With Genkit, you can quickly build applications that leverage generative AI. However, Genkit itself does not include a user interface. As a use case for an internal AI chat, I decided to make internal AI available as open source. Because internal AI uses a pay-as-you-go model instead of charging per user, you can optimize costs by only paying for the amount of usage. Moreover, thanks to Genkit's extensibility, you can combine RAG (Retrieval-Augmented Generation) and Function Calling to tailor AI features to your organization's needs. This opens the door to more practical AI applications, such as specialized internal information retrieval or automated workflow processes! GitHub - tanabee/internal-ai internal AI -- ChatKey Features Open-source project, allowing customization to fit your organization's needs Abstracted interface with generative AI via Genkit Deployable on Firebase Firebase AI Monitoring for monitoring requests to generative AI Restricting Usage to Specific Domains Usage-based pricing, independent of the number of users Open-source project, allowing customization to fit your organization's needs internal AI is provided as a boilerplate, which you can freely fork and customize according to your organization's requirements. Genkit can be extended in many ways, such as using RAG for accessing internal data or utilizing Google Search for grounding. To keep things simple for initial adoption, this example just communicates with Gemini 2.0. const ai = genkit({ // ... model: gemini20Flash001, }) export const chatFlow = ai.defineFlow( // ... async (messages) => { const response = await ai.generate({ messages }) return response.messages }, ) internal-ai/functions/src/genkit/chatFlow.t

## Bring Relational Power to Firebase with Firebase Data Connect

DevFeed: [Bring Relational Power to Firebase with Firebase Data Connect](<https://devfeed.tech/articles/bring-relational-power-to-firebase-with-firebase-data-connect-23883.md>)

Original publisher: [Read original article](<https://medium.com/firebase-developers/bring-relational-power-to-firebase-with-firebase-data-connect-e65e5c420ca8?source=rss----8e8b7dc6774d---4>)

Author: Nui Somjin

Published: 2024-12-17T14:09:33Z

Content type: tutorial

Language: en

Sources: [Firebase Developers - Medium](<https://devfeed.tech/sources/firebase-developers-medium.md>)

Topics: [Firebase](<https://devfeed.tech/topics/firebase.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [GraphQL](<https://devfeed.tech/topics/graphql.md>), [Cloud](<https://devfeed.tech/topics/cloud.md>), [SDKs](<https://devfeed.tech/topics/sdks.md>), [Authorization](<https://devfeed.tech/topics/authorization.md>), [CRUD](<https://devfeed.tech/topics/crud.md>)

Tags: [cloud](<https://devfeed.tech/tags/cloud.md>), [database](<https://devfeed.tech/tags/database.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [firebase-database](<https://devfeed.tech/tags/firebase-database.md>), [firestore](<https://devfeed.tech/tags/firestore.md>), [graphql](<https://devfeed.tech/tags/graphql.md>), [migrations](<https://devfeed.tech/tags/migrations.md>), [permissions](<https://devfeed.tech/tags/permissions.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [schema](<https://devfeed.tech/tags/schema.md>), [sdk](<https://devfeed.tech/tags/sdk.md>), [sql-database](<https://devfeed.tech/tags/sql-database.md>)

### AI overview

This tutorial introduces Firebase Data Connect, a relational database offering that uses PostgreSQL on Google Cloud and a GraphQL interface. It explains how developers define schemas and connectors while Firebase generates database schemas, migrations, type-safe SDKs, CRUD API endpoints, and authorization mechanisms.

### Source excerpt

This article has been translated from its original blog post in Thai Many of us are familiar with Firebase as a robust Backend-as-a-Service, renowned for its NoSQL databases such as Realtime Database (since 2012) and Cloud Firestore (since 2017). However, both have limitations when handling complex queries. The Firebase community has long been requesting a SQL database solution to address redundancy and facilitate complex queries. At the recent Google I/O, Firebase introduced Firebase Data Connect, its first relational database offering 🎉 How Firebase Data Connect WorksApp data flow While Firebase Data Connect interacts with databases, it's more accurately described as an interface. Under the hood, it's leveraging PostgreSQL on GCP Cloud and providing a GraphQL-based bridge to connect clients with the SQL database. Firebase Data Connect capabilities that make working with PostgresSQL easier The Firebase team built Data Connect with the philosophy of 'You write the query, we do the rest.' Developers only need to define two things, and Firebase handles the rest, allowing developers to focus on their application's core logic. "You write the query, we do the rest"Firebase provides (in GraphQL): Data model (schema): This specifies the database schema, including the tables, columns, and data types. Connectors (queries & mutations): These define the operations for creating, reading, updating, and deleting data within the database. Firebase automatically creates: PostgresSQL schema: Generates the SQL commands to create the database structure in PostgreSQL, including migrations. Type-safe SDK: Provides a strongly-typed SDK for client applications (iOS, Android, Web, Flutter) to interact with the database. API Endpoints: Creates API endpoints for clients to perform CRUD operations on the database, complete with authorization mechanisms to control user permissions. For instance, all users might be able to view product listings, but only admins can add new products. We define D

## Firestore for Image Embeddings

DevFeed: [Firestore for Image Embeddings](<https://devfeed.tech/articles/firestore-for-image-embeddings-23888.md>)

Original publisher: [Read original article](<https://medium.com/firebase-developers/firestore-for-image-embeddings-f3fa2a5a5058?source=rss----8e8b7dc6774d---4>)

Author: Mete Atamel

Published: 2024-10-29T19:13:03Z

Content type: tutorial

Language: en

Sources: [Firebase Developers - Medium](<https://devfeed.tech/sources/firebase-developers-medium.md>)

Topics: [Firestore](<https://devfeed.tech/topics/firestore.md>), [Embeddings](<https://devfeed.tech/topics/embeddings.md>), [LangChain](<https://devfeed.tech/topics/langchain.md>), [multimodal](<https://devfeed.tech/topics/multimodal.md>), [Cloud](<https://devfeed.tech/topics/cloud.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [cloud-storage](<https://devfeed.tech/tags/cloud-storage.md>), [embeddings](<https://devfeed.tech/tags/embeddings.md>), [firestore](<https://devfeed.tech/tags/firestore.md>), [generative-ai-tools](<https://devfeed.tech/tags/generative-ai-tools.md>), [langchain](<https://devfeed.tech/tags/langchain.md>), [llms](<https://devfeed.tech/tags/llms.md>), [multimodal](<https://devfeed.tech/tags/multimodal.md>), [retrieval](<https://devfeed.tech/tags/retrieval.md>), [search](<https://devfeed.tech/tags/search.md>), [software-development](<https://devfeed.tech/tags/software-development.md>), [web](<https://devfeed.tech/tags/web.md>)

### AI overview

A tutorial showing how to use FirestoreVectorStore and LangChain to generate, store, and retrieve image embeddings for similarity search. It covers multimodal embedding models, images from local storage, Google Cloud Storage, and the web, plus text- and image-based queries.

### Source excerpt

Powering LLMs with Firestore In my previous post about Firestore for Text Embedding and Similarity Search, I talked about how Firestore and LangChain can help you to store text embeddings and do similarity searches against them. With multimodal embedding models, you can generate embeddings not only for text but for images and video as well. In this post, I will show you how to store image embeddings in Firestore and later use them for similarity search. Image embeddings support in FirestoreVectorStore As a recap from the previous post, the Firestore for LangChain project provides a FirestoreVectorStore which simplifies storage and retrieval of embeddings. Initially, FirestoreVectorStore only supported text embeddings, but we recently added a new add_images method to store image embeddings. Likewise, we added the similarity_search_image method to run similarity searches with image embeddings. Let's take a closer look at how you can use FirestoreVectorStore in LangChain to work with image embeddings. First, you need to create a multimodal embedding model that can embed images: from langchain_google_vertexai import VertexAIEmbeddings embedding = VertexAIEmbeddings( model_name="multimodalembedding", project=PROJECT_ID, location="us-central1" ) Then, you create a Firestore-backed vector store with the embedding model: from langchain_google_firestore import FirestoreVectorStore vector_store = FirestoreVectorStore( collection=COLLECTION_NAME, embedding_service=embedding, ) Now, you can add images stored locally, in Google Cloud Storage, or any image on the web as follows: ids = ["landmark1.png", "landmark2.png", "landmark3.png"] image_paths = [ "gs://your-storage-bucket/landmark1.png", "./images/landmark2.png", "https://your-website/images/landmark3.png", ] vector_store.add_images(image_paths, ids=ids) This creates embeddings for each image and saves them to Firestore. Afterwards, you can perform a similarity search with a text query: vector_store.similarity_search("stadiu

## High-Precision Responses with Genkit's Google Search Integration

DevFeed: [High-Precision Responses with Genkit's Google Search Integration](<https://devfeed.tech/articles/high-precision-responses-with-genkit-s-google-search-integration-23889.md>)

Original publisher: [Read original article](<https://medium.com/firebase-developers/high-precision-responses-with-genkits-google-search-integration-7f142f5c9693?source=rss----8e8b7dc6774d---4>)

Author: tanabee

Published: 2024-10-21T18:37:56Z

Content type: tutorial

Language: en

Sources: [Firebase Developers - Medium](<https://devfeed.tech/sources/firebase-developers-medium.md>)

Topics: [Genkit](<https://devfeed.tech/topics/genkit.md>), [Google Search](<https://devfeed.tech/topics/google-search.md>), [Google](<https://devfeed.tech/topics/google.md>), [Google Cloud Platform (GCP)](<https://devfeed.tech/topics/google-cloud.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [ai-api](<https://devfeed.tech/tags/ai-api.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [code](<https://devfeed.tech/tags/code.md>), [gemini](<https://devfeed.tech/tags/gemini.md>), [genkit](<https://devfeed.tech/tags/genkit.md>), [github](<https://devfeed.tech/tags/github.md>), [google](<https://devfeed.tech/tags/google.md>), [google-search](<https://devfeed.tech/tags/google-search.md>), [grounding](<https://devfeed.tech/tags/grounding.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [integration](<https://devfeed.tech/tags/integration.md>)

### AI overview

This tutorial explains how to integrate Google Search with Genkit 0.5.9 so applications can use current information, including details from specific domains, when generating responses. It covers enabling Vertex AI, configuring a Google Cloud project and local environment, initializing a Genkit project, and running the Genkit Developer UI.

### Source excerpt

aGenkit With the release of Genkit version 0.5.9, it is now possible to leverage Google Search directly through Genkit. By using Google Search, Genkit can access the latest information, including niche details from specific domains, leading to more accurate responses. This article explains how to set up Google Search integration for Genkit. Enabling Vertex AI To use the Google Search feature, you need a Google Cloud project with Vertex AI enabled. Follow these steps to enable Vertex AI and link your local environment with Google Cloud: 1. In the Cloud console, Enable the Vertex AI API for your project. 2. Set environment variables: export GCLOUD_PROJECT=<your project ID> export GCLOUD_LOCATION=us-central1 3. Authenticate with gcloud: gcloud auth application-default loginInitializing a Genkit Project Next, initialize your Genkit project. % npm init -y % npm i -D genkit-cli % npm i genkit @genkit-ai/googleai @genkit-ai/vertexai % mkdir src && touch src/index.ts Paste the following initialization code into the src/index.ts file. import { genkit, z } from 'genkit'; import { vertexAI } from '@genkit-ai/vertexai'; import { gemini15Flash } from '@genkit-ai/vertexai'; const ai = genkit({ model: gemini15Flash, plugins: [vertexAI({ location: 'us-central1' })], }); export const mainFlow = ai.defineFlow( { name: 'mainFlow', inputSchema: z.string(), outputSchema: z.string(), }, async (prompt) => { const { text } = await ai.generate(prompt); return text; } ); ai.startFlowServer({ flows: [mainFlow] });Enabling Google Search To enable Google Search, specify `googleSearchRetrieval` with `withConfig` for the `gemini15Flash` model, as shown in the following code. const ai = genkit({ model: gemini15Flash.withConfig({ googleSearchRetrieval: {}}), plugins: [vertexAI({ location: 'us-central1' })], });Run locally Launch the Genkit Developer UI with the following command: % npx genkit start -- npx tsx --watch src/index.ts Try asking about the current weather in Tokyo. Ask about Tokyo's weat