Agentic Gemini is an exploratory repository demonstrating multi-agent workflows using the AG2 (autogen) framework and Google's Gemini models (via AI Studio).
The primary objective is to provide a hands-on, runnable example of various agent patterns, from simple code execution and group chats to complex, human-in-the-loop validation, all running securely within a Docker environment.
Follow these instructions to get a copy of the project up and running on your local machine.
You will need the following tools installed on your system:
- Git
- Python 3.11+
- Docker Engine
The application requires a Google Gemini API key. This project uses a .gitignore to protect your keys, so you must create two files:
-
config.json: Create this file in the root directory, usingsample_config.jsonas a template. This file will contain your actual API key.[ { "model": "gemini-2.5-flash-lite", "api_key": "your-AI-Studio-API-key-goes-here", "api_type": "google" } ] -
config_path.json: Create this file in the root directory, usingsample_config_path.jsonas a template. This file tells the application where to find yourconfig.json. For this project, you can just set it toconfig.json.{ "config_path": "config.json" }
This is the recommended way to run the application. It ensures a consistent, secure, and isolated environment.
-
Clone the repository:
git clone [https://github.com/your-username/Agentic-Gemini.git](https://github.com/your-username/Agentic-Gemini.git) cd Agentic-Gemini -
Build the Docker image: This command reads the
Dockerfileand builds a local image namedagentic-gemini.docker build -t agentic-gemini . -
Run the application: This command runs the app interactively.
-
The
-v /var/run/docker.sock:/var/run/docker.sockflag is required; it allows the agent inside the container to spawn new Docker containers for code execution. -
The
-v "/your/target/directory":"/my_files"flag is required for Mode 5. This mounts your local directory (e.g.,~/Documents) into the container at/my_files, allowing the agent to find, read, edit, and run files.- Note: This flag must be read-write (without the
:rosuffix). The agent needs write-access to this directory to create the temporary scripts it uses for code execution, even if you do not plan to edit your original files.
- Note: This flag must be read-write (without the
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v "/your/local/directory":"/my_files" agentic-gemini
-
If you want to edit the code locally with IDE support (like linting and code completion in VS Code), you should set up a local virtual environment.
-
Navigate to the project directory:
cd Agentic-Gemini -
Create a virtual environment:
python -m venv venv
-
Activate the environment:
- Linux/macOS:
source venv/bin/activate - Windows (PowerShell):
.\venv\Scripts\Activate.ps1
- Linux/macOS:
-
Install dependencies:
pip install -r requirements.txt
You can now open the folder in your IDE. Remember to run the application using the Docker commands above.
This project is built upon the AG2 (autogen) framework.