Agentic Gemini is an exploratory repository demonstrating multi-agent workflows using the AG2 (autogen) framework and Google's Gemini models (via AI Studio).
This project wraps the powerful agentic backend in a modern Flask-based Web UI, enabling you to interact with various agent patterns—from simple code execution to complex human-in-the-loop workflows—directly from your browser. It features persistent chat history, syntax highlighting, and a responsive design.
-
5 Distinct Agent Modes:
-
Basic Code Agent: Simple User
$\to$ Assistant flow. - Coder vs. Reviewer: Iterative code improvement.
- Orchestrated Group Chat: Manager, Planner, and Reviewer working together.
- Human-in-the-Loop: Expert and Planner with real-time human validation.
- Tool Use Chat: Advanced filesystem operations (Find, Read, Edit, Run files) within a sandboxed environment.
-
Basic Code Agent: Simple User
-
Modern Web Interface:
- Champagne & Cognac aesthetic.
- Real-time streaming responses via WebSockets.
- Markdown rendering and Syntax Highlighting for code.
-
Persistent History:
- SQLite-backed chat history.
- Sidebar navigation with Rename, Delete, and Download capabilities.
-
Secure Execution:
- Dockerized environment ensures host system safety.
- Strict file access controls in Tool Mode.
Follow these instructions to get the project up and running on your local machine.
You will need the following tools installed on your system:
- Git
- Docker Engine
- (Optional) Python 3.12+ for local development
The application requires a Google Gemini API key. You must create two configuration files in the root directory:
-
config.json: Create this file usingsample_config.jsonas a template.[ { "model": "gemini-2.5-flash-lite", "api_key": "your-AI-Studio-API-key-goes-here", "api_type": "google" } ] -
config_path.json: Create this file usingsample_config_path.jsonas a template.{ "config_path": "config.json" }
This is the recommended way to run the application. It ensures the environment is isolated and the file permissions are handled correctly.
-
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:
docker build -t agentic-gemini . -
Run the application: Run the following command.
-p 5000:5000: Exposes the Web UI port.-v ...docker.sock: Required for the agent to spawn execution containers.-v ...:/my_files: Required for Mode 5. Mounts your local working directory.
docker run -it --rm -p 5000:5000 -v /var/run/docker.sock:/var/run/docker.sock -v "/your/local/directory":"/my_files" agentic-gemini
-
Access the UI: Open your browser and navigate to:
http://localhost:5000
If you wish to modify the web application code locally:
-
Create and activate a virtual environment:
python -m venv venv # Linux/macOS: source venv/bin/activate # Windows: .\venv\Scripts\Activate.ps1
-
Install dependencies:
pip install -r requirements.txt
-
Run the server:
python web_app.py
Cleaning up Docker Resources If you need to stop all containers and clean up the environment (useful if the Docker daemon gets cluttered), use these commands:
-
Stop all containers:
docker stop $(docker ps -a -q) -
Remove all containers:
docker rm $(docker ps -a -q) -
Complete System Prune (Images & Volumes):
docker system prune -a --volumes
This project is built upon the AG2 (autogen) framework.