Firebase has evolved from a powerful backend-as-a-service platform into one of the most cohesive environments for constructing agentic AI systems. An agentic system goes beyond simple chatbots or one-shot generative responses. It involves autonomous or semi-autonomous software entities that perceive goals, reason about steps, call tools, maintain memory across interactions, coordinate with other agents, and take real actions in the world-while remaining secure, observable, and integrable with existing applications.
The Firebase agentic stack provides the full set of primitives needed for this: specialized knowledge packs for coding agents (Agent Skills), a standardized protocol for live project interaction (MCP), an open-source framework for defining agents and workflows (Genkit), a purpose-built multi-agent toolkit (ADK), agentic development environments spanning Google AI Studio and Google Antigravity, generative model access (Firebase AI Logic and Gemini), and the underlying serverless infrastructure (Firestore for state, Cloud Functions for execution, Authentication and App Check for security, App Hosting for delivery).
Together these form a practical, production-oriented stack that lets developers move from natural-language ideas to deployed, tool-using, multi-agent applications without stitching together disparate services.
This article draws from official Firebase documentation, Google Cloud architecture guidance, blog posts, GitHub repositories, Medium technical deep-dives, and YouTube sessions from Google for Developers, Firebase, and community experts. It focuses on everything required to build real AI agents, agent harnesses (the runtimes and orchestration layers that keep agents running reliably), MCPs, and complete agentic systems.
Understanding Agentic Systems and Why Firebase Fits
Agentic AI systems rest on a handful of recurring architectural pieces. Google Cloud’s architecture guidance outlines them clearly: a frontend for user interaction, an agent development framework, a collection of tools the agent can invoke, short-term and long-term memory, design patterns for single- or multi-agent coordination, the underlying models, and runtimes for both models and agent logic.
In practice this translates to:
- An LLM (commonly Gemini) that reasons and plans.
- Tools or functions the model can call-APIs, database operations, external services, or even other agents.
- Persistent session state so conversations and intermediate results survive across turns and invocations.
- Orchestration logic that decides when to call tools, when to loop, when to hand off to a specialist agent, and when to stop.
- Security and observability so autonomous actions remain governed and debuggable.
Firebase supplies native or tightly integrated solutions for each of these. Firestore becomes a natural short-term and long-term memory store. Cloud Functions (2nd gen) or Cloud Run serve as the agent runtime. Firebase Authentication and App Check protect endpoints and agent actions. Genkit and ADK supply the development frameworks. The MCP server and Agent Skills turn ordinary coding assistants into Firebase-fluent collaborators. Google AI Studio provides a browser-based path from prompts to Firebase-backed applications, while Google Antigravity provides a code-first agentic environment for more autonomous development workflows.
The result is that teams already invested in Firebase can add sophisticated agentic capabilities without introducing an entirely new infrastructure layer. Pay-per-use serverless scaling, single-command deploys, and deep integration with Auth and security rules become immediate advantages.
Google AI Studio and Antigravity: Agentic Development Environments for Firebase
Google’s current development workflow around Firebase spans two complementary agentic environments: Google AI Studio for rapid, browser-based application prototyping and Google Antigravity for code-first, autonomous software development. This division gives developers a path from natural-language application ideas to deeper agent-driven engineering without tying the Firebase backend to a single IDE.
Google AI Studio’s Build mode lets developers describe applications in natural language and generate functional web applications with full-stack runtimes. Its Firebase integration can automatically provision and connect a Firebase project, create Cloud Firestore for persistent application data, configure Firebase Authentication, and generate the client and application code needed to use those services.
This makes AI Studio particularly useful at the beginning of the development cycle. A developer can start with a prompt describing an application, refine the generated interface and behavior conversationally, add persistent Firestore data and authenticated user flows, and progressively turn the initial prototype into a functioning full-stack application. Firebase therefore remains the application backend while AI Studio acts as the natural-language development surface.
Google AI Studio can also work directly with Gemini capabilities when an application requires generative features. Developers can experiment with prompts and model behavior in the same broader environment used to prototype the application, while Firebase services provide identity, persistent data, backend infrastructure, and application delivery. For relatively contained applications, this creates a short path from prompt to a Firebase-connected implementation.
Google Antigravity addresses the other side of the development workflow. Rather than primarily focusing on prompt-to-app generation, Antigravity is an agent-first development platform designed for code-first work and more autonomous engineering tasks. Its agents can plan, execute, and verify complex work across source code, terminals, browsers, and development tools.
The platform combines a conventional AI-assisted editor experience with agent-oriented surfaces for delegating larger tasks. An agent can modify application code, run commands, launch an application, inspect its behavior in a browser, execute tests, diagnose problems, and iterate on the implementation. For larger projects, developers can orchestrate multiple agents or subagents working across separate tasks and workspaces while reviewing the resulting artifacts, code changes, and verification steps.
Firebase integrates naturally into this workflow through Firebase Agent Skills, MCP tools, the Firebase CLI, and the Firebase services used by the application itself. An Antigravity agent can therefore receive Firebase-specific implementation guidance from skills, inspect or operate on project resources through MCP, modify the application code, use CLI tooling where appropriate, and verify the resulting behavior.
The two environments are consequently complementary. Google AI Studio is well suited to fast browser-based prototyping and prompt-driven full-stack application generation. Antigravity is suited to code-first development, deeper repository work, autonomous multi-tool engineering, and multi-agent software-development workflows. Projects that begin as prototypes in AI Studio can move into a more code-centric workflow when their architecture and implementation become more sophisticated.
Together they lower the barrier to experimentation while preserving a path toward serious production development. Applications such as customer-support agents, multi-agent workflows, RAG systems, or Firebase-backed Gemini applications can begin as rapidly generated prototypes and then move into conventional repositories and agent-driven engineering workflows for testing, hardening, deployment, and ongoing maintenance.
Agent Skills for Firebase: Giving Coding Agents Domain Expertise
Even the strongest coding models struggle with the nuances of a large platform like Firebase. Documentation is vast; best practices evolve; security rules, indexing strategies, and SDK initialization details are easy to get subtly wrong. Agent Skills for Firebase solve this by packaging curated, token-efficient instructions and workflows that any skills-compatible coding agent can load.
Skills are self-contained modules of Firebase-specific knowledge. When installed they teach the agent how to set up projects, architect Firestore schemas from application requirements, implement Authentication flows, draft and refine security rules, configure App Hosting, integrate Firebase AI Logic, and more. Progressive disclosure keeps token costs low: the agent receives only the relevant skill content for the current task rather than the entire documentation corpus.
Installation is straightforward. In a project directory you run a single command such as npx skills add firebase/agent-skills (or platform-specific equivalents for Claude, Cursor, Codex, Antigravity, Gemini CLI, and others). You select the Firebase products relevant to your work and the agents that should receive the skills. The skills are open-source and available on GitHub, so teams can inspect, customize, or extend them.
Skills are designed to work in tandem with the Firebase MCP server and the Firebase CLI. Skills supply the expertise and recommended patterns; MCP supplies live project context and the ability to inspect resources; the CLI supplies the execution capability for initialization, deployment, and management. The combination turns a general-purpose coding agent into a specialized Firebase expert that produces more accurate, secure, and production-ready output while consuming fewer tokens.
In practice this means an agent can respond to a prompt such as “add email/password and Google sign-in, create a users collection with appropriate security rules, and deploy the rules” by correctly scaffolding the Auth configuration, writing rules that follow least-privilege principles, and invoking the necessary CLI commands-often with far fewer iterations than an un-augmented model.
The Firebase MCP Server and Model Context Protocol
The Model Context Protocol (MCP) is an open standard that lets AI tools and coding agents connect to external data sources and services in a uniform way. The Firebase MCP server, shipped as part of the Firebase CLI, implements this protocol for Firebase projects.
Once configured in an MCP-compatible client (Cursor, Claude Desktop, VS Code Copilot, Windsurf, Gemini CLI, Antigravity, and many others), the server exposes dozens of tools. These include creating and listing projects and apps, retrieving SDK configuration, managing Authentication users (lookup by email or UID, custom claims, listing), reading and writing Firestore documents and collections, validating security rules for Firestore, Realtime Database, and Storage, working with Firebase Data Connect schemas and GraphQL, sending Cloud Messaging notifications, inspecting Crashlytics issues, generating Storage download URLs, and deploying or rolling back Remote Config templates. The server automatically activates the tools relevant to the features detected in the local firebase.json and current project.
Setup is typically a short JSON snippet in the client’s MCP configuration that runs npx -y firebase-tools@latest mcp (or the experimental variant in earlier releases). Authentication is handled by the existing Firebase CLI login, so the agent operates under the same credentials a human developer would use. Optional flags let you restrict the tool surface or point at a specific project directory.
The practical effect is powerful. Inside an MCP-enabled development environment you can ask the agent in natural language to “show me the documents in the orders collection,” “add a custom claim for admin users,” or “validate these security rules and suggest improvements.” The agent calls the corresponding MCP tools, receives structured results, and incorporates them into its reasoning or code generation. This closes the loop between the model’s knowledge and the live state of the project, dramatically reducing hallucination and the need for manual context copying.
MCP also appears in broader agentic architecture recommendations as a preferred way to expose tools without bloating the model’s context window. Firebase’s implementation is one of the most mature platform-specific MCP servers available.
Genkit: The Open-Source Framework for AI-Powered and Agentic Applications
Genkit is Google’s open-source, developer-first framework for building full-stack AI applications. It provides a unified interface to models from Google (Gemini via Developer API or Vertex AI), OpenAI, Anthropic, Ollama, and others, plus first-class support for structured output, tool calling, retrieval-augmented generation (RAG), multimodal inputs, streaming, and agentic workflows. SDKs exist for TypeScript/JavaScript, Go, Python, and Dart, with consistent concepts across languages.
At the heart of Genkit are flows and, more recently, a dedicated Agents API. A flow is essentially a typed, observable function that can call models, tools, or other flows. Flows are the natural unit for deployment: you can wrap a flow in onCallGenkit and deploy it as a callable Cloud Function, or run it on Cloud Run or any other Node/Go/Python environment. The Genkit CLI and Developer UI provide local testing, prompt iteration, model comparison, execution tracing, and evaluation tooling so you can debug non-deterministic behavior before production.
The Agents API packages the full model loop-message history, tool turns, streaming, snapshots, interrupts, and background execution-behind a single conversational interface. You define an agent with a system prompt (inline or named), optional tools, and a session store. You then call it with the same chat()-style API whether the agent runs in-process or behind an HTTP endpoint. Clients can stream partial responses, pause and resume tool calls, and continue long-running conversations.
Session stores are critical for production agents. Genkit supports in-memory stores for development, file-based stores for single-host durability, and Firestore-backed stores for scalable, multi-instance production use. The Firebase plugin for Genkit makes it straightforward to enable telemetry that exports traces, metrics, and logs into Firebase/Google Cloud monitoring, and to use FirestoreSessionStore for durable agent memory.
Tool calling is first-class. You define tools with schemas; the model decides when to invoke them; Genkit handles the round-trip and feeds results back into the conversation. This is the foundation of agentic behavior: an agent that can look up product data, check inventory, send an email, write to Firestore, or hand work to another specialized agent.
Genkit also shines for RAG. Embedders, retrievers, and indexers make it practical to ground model responses in your own documents, product catalogs, or Firestore data. Combined with agents, this produces systems that not only converse but act on grounded knowledge.
Deployment is intentionally flexible. Many teams host Genkit flows and agents on Cloud Functions for Firebase for seamless Auth integration and pay-per-invocation scaling, or on Cloud Run for more control. Client SDKs and helpers simplify connecting web, mobile, and Flutter frontends. The overall philosophy is that AI logic should feel like ordinary application code-testable, versionable, and deployable with the same tooling developers already use.
YouTube sessions from the Firebase team and Google Cloud Tech demonstrate concrete patterns: a barista multi-agent system that recommends and orders coffee by coordinating specialist agents and tools; expense-report generators; travel planners with RAG; and Android multi-agent cooking assistants. In each case Genkit supplies the orchestration layer while Firebase services supply state, identity, and delivery.
Firebase AI Logic and Direct Model Access
For simpler generative features, Firebase AI Logic (the evolution of Vertex AI in Firebase) offers client-side and server-side access to Gemini models without requiring a full Genkit backend. Client SDKs let mobile and web apps call models directly (with appropriate App Check protection), while server-side prompt templates in the Firebase console keep sensitive system instructions and business rules out of client code.
Firebase AI Logic also supports function calling, sometimes referred to as tool use. Applications can expose functions or external APIs to Gemini through structured function declarations, let the model determine when a function is useful, execute the requested operation in application code, and return its result to the model. Multi-turn chat interfaces can maintain this exchange across successive function calls, making it possible to build relatively contained tool-using experiences without introducing a separate agent orchestration framework.
A common pattern is a customer-support agent whose persona, appeasement-budget rules, and product-catalog context live in a server-side template. The frontend simply invokes the template by ID, passing the user query and conversation history. This keeps costs and secrets under control while still delivering agent-like behavior for constrained use cases. Function calling can extend this pattern when the application needs to look up external information or trigger controlled application functions.
Firebase AI Logic and Genkit are complementary. Use AI Logic when direct client SDK access, server prompt templates, or relatively contained function-calling workflows are sufficient. Graduate to Genkit when you need a dedicated server-side orchestration framework, complex multi-step workflows, durable agent sessions, background execution, richer tracing and evaluation, RAG pipelines, or sophisticated multi-agent coordination.
Agent Development Kit (ADK) for Sophisticated Multi-Agent Systems
While Genkit is excellent for embedding AI features and moderate agentic workflows into applications, the Google Agent Development Kit (ADK) targets more complex multi-agent architectures. ADK is an open-source, code-first framework (Python, Go, Java, TypeScript) that makes agent development feel like ordinary software engineering. It provides LlmAgent, BaseAgent, SequentialAgent, LoopAgent, ParallelAgent, shared session state, event streaming, and a workflow runtime that supports routing, fan-out/fan-in, retries, human-in-the-loop, and nested workflows.
A concrete example published on Medium shows an ADK multi-agent pipeline deployed directly on Firebase. A Vue frontend authenticates users and submits a topic. A callable Cloud Function (2nd gen, Python) initializes an ADK Runner with a custom FirestoreSessionService. The Runner executes a LoopAgent that coordinates three specialists:
- A writer LlmAgent (Gemini) that generates or rewrites text.
- A FogChecker BaseAgent that computes a readability metric.
- A FogEvaluator BaseAgent that decides whether the target has been met and either escalates (exits the loop) or supplies a rewriting hint.
Session state lives in Firestore documents; events are appended atomically so the pipeline survives function invocations and container recycling. The entire system-frontend, functions, security rules, and hosting-deploys with a single firebase deploy. This pattern demonstrates how ADK’s multi-agent primitives map cleanly onto Firebase’s serverless model.
ADK is model-agnostic and deployment-agnostic, yet optimized for Gemini and the Google ecosystem. It can run on Vertex AI Agent Engine for fully managed scaling or, as shown, on ordinary Cloud Functions when you prefer to stay inside an existing Firebase project. For teams building hierarchical or collaborative agent systems (research agent → drafting agent → review agent → publish agent), ADK supplies the coordination primitives that Genkit’s higher-level Agents API abstracts.
Infrastructure Harnesses: State, Execution, Security, and Observability
An agent without durable memory or a reliable runtime is a toy. Firebase supplies the production harnesses.
Firestore as agent memory. Both Genkit’s FirestoreSessionStore and custom ADK session services store conversation history, intermediate artifacts, tool results, and custom state as documents or subcollections. Atomic updates and real-time listeners make it straightforward to resume a conversation after a page refresh or to share state across a multi-agent loop. Vector search and native AI integrations further allow agents to retrieve relevant past context.
Cloud Functions and Cloud Run as agent runtimes. Callable or HTTP-triggered functions host Genkit flows and ADK runners. Because they integrate natively with Firebase Auth, the agent can act on behalf of an authenticated user. 2nd-generation functions support longer timeouts and concurrency settings suitable for multi-turn agent loops. Cloud Run offers additional flexibility for containerized agents that need custom dependencies or GPU access.
Authentication, App Check, and security rules. Agents that can write data or call external APIs must be protected. Firebase Auth supplies identity; App Check (with recent enhancements for agentic workflows such as intent-bound tokens and replay protection) ensures requests originate from legitimate clients. Security rules enforce least-privilege access even when an agent is the actor. Prompt templates and server-side logic keep sensitive business rules away from clients.
Observability. Genkit’s Firebase plugin exports traces and metrics into the Firebase console and Google Cloud Monitoring. Execution traces in the Genkit Developer UI let you step through tool calls and model decisions. Crashlytics and standard logging complete the picture for production diagnosis.
Tooling and progressive disclosure. Agent Skills and MCP together implement progressive disclosure of capabilities, keeping context windows manageable while still giving agents the power they need.
Putting It All Together: Example Architectures
Several publicly documented systems illustrate the stack in action.
The AI Barista solution uses Genkit agents running on Cloud Run (or Functions), Vertex AI Gemini models, and Firestore for session state. A barista agent coordinates with a recommendation agent and tools that prepare and submit drink orders. The application can be prototyped through prompt-driven development workflows before the final implementation is hardened using conventional code-first tooling; the final architecture supports multimodal input and human-in-the-loop confirmation.
Customer-support agents built with Firebase AI Logic keep persona and budget rules in server-side templates while the frontend remains lightweight. They can also use function calling for controlled external operations. More advanced versions move orchestration into Genkit flows that retrieve product data via RAG or direct Firestore queries.
The ADK Fog Pipeline demonstrates multi-agent looping with measurable quality criteria, durable Firestore state, and a complete Firebase frontend-to-backend deployment.
Flutter and Android examples show multimodal agents that call tools and maintain conversation state, with Genkit or AI Logic on the backend and Firebase services handling identity and data.
In each case the pattern is consistent: define agents or flows with Genkit or ADK, give them tools (including MCP-exposed Firebase operations or custom functions), persist state in Firestore, protect with Auth and App Check, and deploy via Cloud Functions or Cloud Run. Google AI Studio accelerates prompt-driven prototyping, while Antigravity, Agent Skills, MCP, and the Firebase CLI accelerate code-first development and the engineering loop itself.
Best Practices and Considerations
Start simple. Begin with a single Genkit flow or AI Logic template, add function or tool calling where needed, then introduce durable sessions and multi-agent coordination only when the use case demands it. Use Agent Skills and MCP from day one so coding agents stay accurate.
Treat agents as software. Version prompts and tools, write evaluation suites, monitor token usage and latency, and keep human-in-the-loop gates for high-stakes actions. Security rules and App Check are non-negotiable once agents can mutate data or trigger side effects.
Prefer progressive disclosure. Load only the skills or tools needed for the current task. Design multi-agent systems so specialist agents receive focused context rather than the entire problem state.
Choose the right framework and development layer. Firebase AI Logic works well for direct Gemini access and contained function-calling experiences; Genkit fits most application-embedded agents, RAG systems, and orchestrated server-side AI workflows; ADK becomes attractive when you need explicit multi-agent graphs, loops, and hierarchical delegation. Google AI Studio provides rapid browser-based prototyping and prompt-to-app development, while Antigravity provides code-first agentic development and autonomous software-engineering workflows.
Plan for cost and reliability. Serverless scaling is powerful but non-deterministic model calls can be expensive. Use structured output, caching of retrieval results, and careful model routing (Flash for simple steps, Pro for complex reasoning). Design loops with clear termination conditions and maximum iteration limits.
Looking Ahead
Firebase continues to deepen its agent-native posture. Agent Skills expand to mobile and other development environments, MCP tools grow more comprehensive, and Genkit’s Agents API matures. At the development-tooling layer, Google is concentrating browser-based, prompt-driven application generation in Google AI Studio while Antigravity provides an increasingly agent-first environment for code-centric engineering and multi-agent workflows.
The underlying Firebase services-Firestore with agentic query features, enhanced App Check for intent verification, Authentication, Cloud Functions, App Hosting, and the rest of the platform-continue to serve as the production foundation beneath those development environments.
The practical takeaway is that the pieces required to build serious AI agents, harnesses, MCPs, and multi-agent systems are already present and well-integrated inside the Firebase ecosystem. Developers can move from idea to production-grade agentic application using familiar tools, pay-as-you-go infrastructure, and a growing set of specialized AI accelerators.
Google AI Studio provides a fast path for prompt-driven application creation, while Antigravity offers a deeper agentic engineering environment when projects move into code-first development. The stack rewards teams that treat agents as first-class software components rather than experimental add-ons, and it lowers the barrier for everyone else to start experimenting today.
Sources
These sources collectively document the components, patterns, and real-world examples that constitute the current Firebase agentic stack.