Skip to content

Update Agentic App Manager for Google I/O 25 #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release

# Firebase
google-services.json
GoogleService-Info.plist
firebase.json
firebase_options.dart
45 changes: 45 additions & 0 deletions agentic_app_manager/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: "ea121f8859e4b13e47a8f845e4586164519588bc"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: ea121f8859e4b13e47a8f845e4586164519588bc
base_revision: ea121f8859e4b13e47a8f845e4586164519588bc
- platform: android
create_revision: ea121f8859e4b13e47a8f845e4586164519588bc
base_revision: ea121f8859e4b13e47a8f845e4586164519588bc
- platform: ios
create_revision: ea121f8859e4b13e47a8f845e4586164519588bc
base_revision: ea121f8859e4b13e47a8f845e4586164519588bc
- platform: linux
create_revision: ea121f8859e4b13e47a8f845e4586164519588bc
base_revision: ea121f8859e4b13e47a8f845e4586164519588bc
- platform: macos
create_revision: ea121f8859e4b13e47a8f845e4586164519588bc
base_revision: ea121f8859e4b13e47a8f845e4586164519588bc
- platform: web
create_revision: ea121f8859e4b13e47a8f845e4586164519588bc
base_revision: ea121f8859e4b13e47a8f845e4586164519588bc
- platform: windows
create_revision: ea121f8859e4b13e47a8f845e4586164519588bc
base_revision: ea121f8859e4b13e47a8f845e4586164519588bc

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
81 changes: 81 additions & 0 deletions agentic_app_manager/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Agentic App Manager
**Target Platforms:** iOS, Android, Web

**Tech Stack:** Flutter (frontend), Firebase AI Logic (Gemini API in Vertex AI for the backend)

![Agentic App Manager – Firebase AI Model Constructors w/ Screenshots](README/AppScreenshots.png)

This app demonstrates how to build agents an agentic experience in a Flutter app
using Firebase AI Logic with the Gemini API in Vertex AI.

Users take and annotate screenshots, then add text to file feedback. An agent
then interprets the feedback. For example, if a user wants a different color
scheme (e.g., "I prefer blue!"), the agent identifies whether it has a tool to
address the feedback, like changing the color. To avoid abrupt UI changes,
the agent first uses _a different tool_ to ask for confirmation before applying
the change.

If no tools can address the feedback or the user denies the change, the app
automatically generates a detailed feedback report that includes device information,
an "action history" of agent suggestions, and generated tags with a suggested
priority level. This system demonstrates the potential of agent-based
interactions in improving user's app experiences and streamlining developer
workflows.

> [!NOTE]
> Check out this Google I/O 2025 talk for a full walkthrough: [COMING SOON]().

## Getting Started

1. Follow [these instructions](https://firebase.google.com/docs/ai-logic/get-started?&api=vertex#set-up-firebase)
to set up a Firebase project & connect the app to Firebase using `flutterfire configure`

1. Run `flutter pub get` in the root of the project directory `agentic_app_manager` to
install the Flutter app dependencies

1. Run `flutter run -d <device-id>` to start the app on iOS, Android, or Web.

> [!TIP]
> Get available devices by running `flutter devices` ex: `AA8A7357`, `macos`, `chrome`.

1. There are two main.dart files:
- `main.dart` contains the app which has the Feedback UI for users to mark up.
- `main_audio_streaming.dart` contains version of the app that uses real-time
audio streaming.

Click the icon in the top right corner "bug report" or "call" to initiate a
feedback session. You can file feedback about the app color, font size, or
typeface and the agent will have tools that it can use address the feedback.

In the default version of the app, you can also file feedback about something else
in the app and it will offer to file a feedback report for you.

## Implementation
This demo showcases 3 different model constructors from Firebase AI, each
supporting different model with different functionality functionality.
Here's a high-level overview:
1. `GenerativeModel`: Multimodal input with text & images. Tool use as output.
2. `ImagenModel`: Generate the email senders' profile picture images.
3. `LiveGenerativeModel`: Live audio streaming input & output, with tool use.

Check out [this table](https://firebase.google.com/docs/ai-logic/models) for more on the various supported models & features.

## Architecture

### `GenerativeModel`
See code in [`lib/agentic_app_manager/`](https://github.com/flutter/demos/blob/main/agentic_app_manager/lib/agentic_app_manager/)
![GenerativeModel Architecture Diagram](README/AgenticAppManagerArchitectureDiagram.png)

### `ImagenModel`
See code in [`lib/image_generator.dart`](https://github.com/flutter/demos/blob/main/agentic_app_manager/lib/image_generator.dart)
![ImagenModel Architecture Diagram](README/ImagenArchitectureDiagram.png)

### `LiveGenerativeModel`
See code in [`lib/audio_app_manager/audio_app_manager_demo.dart`](https://github.com/flutter/demos/blob/main/agentic_app_manager/lib/audio_app_manager/audio_app_manager_demo.dart)
![ImagenModel Architecture Diagram](README/AgenticAppManagerAudioArchitectureDiagram.png)

## Resources
- [[Codelab] Build a Gemini powered Flutter app with Flutter & Firebase AI Logic](https://codelabs.developers.google.com/codelabs/flutter-gemini-colorist)
- [Demo App] [Colorist](https://github.com/flutter/demos/tree/main/vertex_ai_firebase_flutter_app): A Flutter application that explores LLM tooling interfaces by allowing users to describe colors in natural language. The app uses Gemini LLM to interpret descriptions and change the color of a displayed square by calling specialized color tools.
- [Firebase AI Logic docs](https://firebase.google.com/docs/ai-logic)

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added agentic_app_manager/README/AppScreenshots.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
namespace = "com.example.agentic_app_manager_next_25"
namespace = "com.example.agentic_app_manager"
compileSdk = flutter.compileSdkVersion
ndkVersion = "27.0.12077973"

Expand All @@ -24,7 +24,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.agentic_app_manager_next_25"
applicationId = "com.example.agentic_app_manager"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = 23
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="scavenger_hunt"
android:label="agentic_app_manager"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.scavenger_hunt
package com.example.agentic_app_manager

import io.flutter.embedding.android.FlutterActivity

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'
platform :ios, '13.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
Loading
Loading