I built a team of AI Agents with Nano Banana (it’s I-N-S-A-N-E)

David OndrejAbout 7 min readSep 5, 2025Watch original
THE SUMMARYAI-generated

Key Concepts

  • Nano Banana (Google Gemini 2.5 Flash image preview): A new AI model from Google, considered the best image model, excelling at consistent image editing.
  • Multi-Agent Systems: AI systems where multiple AI agents, each powered by Nano Banana, work together.
  • Open Router: A platform to access and use AI models like Nano Banana, offering both free and paid versions.
  • Cloud Code: A coding tool used for building and deploying AI applications.
  • Codeex: An AI coding assistant, potentially more powerful than Cloud Code.
  • Vectal.ai: A platform where Nano Banana can be used for free.
  • Consistency: The ability of an AI model to make edits to an image while maintaining the overall integrity and style of the original.

Building AI Agents with Nano Banana: A Step-by-Step Guide

1. Introduction to Nano Banana

  • Nano Banana (officially Google Gemini 2.5 Flash image preview) is highlighted as a groundbreaking AI model for image editing due to its consistency and reliability.
  • The video emphasizes the potential of building multi-agent systems powered by Nano Banana, leveraging its ability to output text, make decisions, and take actions.
  • Examples of use cases include new clothing design, social media thumbnails, e-commerce product shots, logo creation, photo restoration, and banner design.
  • The model's ability to edit images with consistency is emphasized, citing an example of enlarging a cloud in an image while keeping everything else the same.
  • Users can access Nano Banana for free on vectal.ai.

2. Setting Up the Development Environment

  • The video demonstrates building a multi-agent system using Cloud Code.
  • The project involves generating multiple images and creating variations using multiple AI agents powered by Nano Banana.
  • The first step is creating a project_details file to describe the project at a high level.
  • The model used is Opus, considered the best model.
  • The first prompt instructs the AI to connect the model name (Google Gemini 2.5 Flash image preview) with the ability to save the resulting image locally.
  • The importance of providing examples in prompts is emphasized, using XML tags to include the official Open Router API documentation.
  • The prompt engineering tactic "think hard answer in short" is highlighted for improving the reasoning effort of the model.
  • An .env file is created to store the Open Router API key.
  • The cost of using Nano Banana via Open Router is mentioned as approximately $0.03 per image.
  • The video demonstrates how to obtain a free API key from Open Router, acknowledging the limitations of the free version.

3. Initial Code Implementation and Debugging

  • The initial code is executed, and the process of installing required Python packages using pip install requirements.txt is shown.
  • An error encountered during the installation process (command not found: pip) is resolved using AI assistance.
  • A new Conda environment is created to manage Python dependencies.
  • The initial code generates a description of a beautiful sunset and creates a new image.
  • An error where the output is saved as a text file instead of a PNG image is encountered and debugged.
  • The AI is instructed to save the image as a PNG file, leading to code modifications to support Base64 encoding.
  • Another error ("Fail to generate image") is encountered and addressed through web search and further debugging.
  • The code is successfully modified to generate and save a PNG image based on the prompt.

4. Adding Multi-Image Support

  • The next step involves adding support for generating multiple images with separate PNG files.
  • The AI is instructed to make four different API calls to generate four images.
  • A simple Flask app is created to provide a web user interface for generating and viewing the images.
  • The Flask app is started, and the generated images are displayed in the UI.
  • A test prompt ("blue dog in a 1930s garden") is used to generate four variations of the image.

5. Implementing Image Editing and Uploads

  • The video proceeds to add image editing and image upload functionality.
  • The AI is instructed to implement this in the simplest way possible.
  • A Gemini logo is uploaded, and the AI is prompted to make the selected image more vibrant and colorful.
  • An issue is identified where the attached image is not being properly passed to the model.
  • The presenter uses multiple Cloud Code instances to work on different aspects of the project simultaneously.
  • The conversational assistant feature is tested, but it is found to be not working correctly.
  • The focus is shifted back to getting the image editing functionality to work.
  • The presenter uses Cloud Code's built-in web search to find information on how to pass images to multi-modal AI models using the Open Router API.
  • Debug log statements are added to the code to track the image data as it is being processed.
  • The issue is identified as the page reloading after upload, wiping the selected image from memory.
  • The code is fixed, and the image editing functionality is successfully implemented.

6. Addressing the Conversational Chat Assistant

  • The presenter attempts to fix the conversational chat assistant, but it is found to be not working correctly.
  • The messages are lost, and the chat history is not persisted.
  • The AI is instructed to refactor the chat assistant to have a nicer UI and to actually work.

7. Implementing the Tree UI

  • The presenter starts working on the tree UI, which allows users to generate and branch out from images in a visual manner.
  • The goal is to replicate the functionality previously implemented in vectal.ai.
  • The presenter uses Codeex, a potentially more powerful AI coding assistant, to work on the tree UI.
  • The tree UI is implemented, allowing users to upload an image and generate variations.
  • An issue is encountered where the "variant" button in the tree view does not work.
  • Debug log statements are added to the code to investigate the issue.
  • The issue is identified as a problem with the click handler in the UI.
  • The code is fixed, and the "variant" button is made to work, generating four variations of the selected image.
  • The presenter demonstrates the branching out functionality, generating further variations from a selected image.

8. Conclusion and Key Takeaways

  • The video concludes by highlighting the potential of Nano Banana for building various AI-powered applications and startups.
  • The presenter emphasizes the importance of consistency in image editing, which is a key strength of Nano Banana.
  • The video showcases the process of building a complex AI application, including debugging and problem-solving.
  • The presenter encourages viewers to try Nano Banana on vectal.ai and to explore the possibilities of building their own AI agents.
  • The video emphasizes the importance of using both Cloud Code and Codeex for AI development, leveraging their respective strengths.

Notable Quotes

  • "The real opportunity with Nanobanana is actually building multi-agent systems where each of the AI agents is powered by Nano Banana."
  • "This is the first AI model in history that can do this." (referring to consistent image editing)
  • "When building something with AI, you don't want to oneshot a big project. You want to split it into five, 7, 10 smaller stages, and then execute each stage individually, building on top of the last one."

Technical Terms and Concepts

  • API (Application Programming Interface): A set of rules and specifications that software programs can follow to communicate with each other.
  • Prompt Engineering: The process of designing and refining prompts to elicit desired responses from AI models.
  • XML (Extensible Markup Language): A markup language used for encoding documents in a format that is both human-readable and machine-readable.
  • Base64: A binary-to-text encoding scheme that represents binary data in an ASCII string format.
  • Flask: A lightweight Python web framework.
  • UI (User Interface): The means by which a user interacts with a computer system or software application.
  • JSON (JavaScript Object Notation): A lightweight data-interchange format that is easy for humans to read and write and easy for machines to parse and generate.
  • SQLite: A self-contained, serverless, zero-configuration, transactional SQL database engine.

Synthesis/Conclusion

The video provides a detailed walkthrough of building AI agents powered by Google's Nano Banana model. It demonstrates the model's capabilities in image generation and, more importantly, consistent image editing. The tutorial covers the entire development process, from setting up the environment and writing the initial code to debugging errors and implementing advanced features like multi-image support, image editing, and a tree-based UI. The video emphasizes the importance of prompt engineering, breaking down complex projects into smaller stages, and utilizing AI tools like Cloud Code and Codeex for efficient development. The final product is a functional application that allows users to generate and edit images with a high degree of consistency, showcasing the potential of Nano Banana for various creative and commercial applications. The presenter's real-time debugging and problem-solving provide valuable insights into the practical challenges and strategies involved in AI development.

AI summaries can miss context or contain errors. Check important details against the original video.

MAKE IT YOURS

Read. Remember. Reuse.

Free tools

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.