|
1 | | -# Microsoft Agent Framework Starter |
| 1 | +# autogen |
2 | 2 |
|
3 | | -This repo now runs as a Microsoft Agent Framework starter instead of the previous AutoGen-first setup. |
| 3 | +[](https://github.com/Coding-Autopilot-System/autogen/actions/workflows/ci.yml) |
| 4 | +[](https://www.python.org/) |
| 5 | +[](LICENSE) |
4 | 6 |
|
5 | | -It is configured for: |
| 7 | +Part of the [Coding-Autopilot-System](https://github.com/Coding-Autopilot-System) ecosystem: |
| 8 | +[gsd-orchestrator](https://github.com/Coding-Autopilot-System/gsd-orchestrator) | [Promptimprover](https://github.com/Coding-Autopilot-System/Promptimprover) |
6 | 9 |
|
7 | | -- Microsoft Agent Framework Python SDK |
8 | | -- Operator Workbench as the primary local product UI |
9 | | -- Microsoft DevUI for local interactive testing |
10 | | -- Gemini API through Google's OpenAI-compatible endpoint |
11 | | -- Gemini CLI fallback when the Gemini API returns quota errors |
12 | | -- local repo inspection tools so the agent can reason over files in this repo |
13 | | -- human approval before the agent treats a proposed action as approved |
| 10 | +autogen is a Python multi-agent orchestration runtime built on Microsoft Agent Framework — combining a Gemini/Claude provider fallback chain, AG-UI observability, and a local operator workbench for end-to-end autonomous engineering workflows. |
14 | 11 |
|
15 | | -The current entrypoint is [main.py](/C:/repo/autogen/main.py), which now dispatches to the MAF CLI in [maf_starter/cli.py](/C:/repo/autogen/maf_starter/cli.py). |
| 12 | +## Features |
16 | 13 |
|
17 | | -## What Is Included |
| 14 | +- **Provider fallback chain** — Gemini API (primary) -> Anthropic API -> local CLI fallback; routing policy classifies prompt complexity and selects provider automatically |
| 15 | +- **Multi-agent team orchestration** — sequential planner->researcher->implementer->reviewer chain with FileCheckpointStorage for resumable runs |
| 16 | +- **Bounded repo tools** — read/list/search/write with enforced scope limits; agents cannot access paths outside the configured repo root |
| 17 | +- **AG-UI observability** — DevUI-discoverable workflows expose run state, specialist handoffs, and pause/approval events |
| 18 | +- **Human-in-the-loop approvals** — approval policy gates destructive writes; operators review before execution proceeds |
18 | 19 |
|
19 | | -- `entities/repo_copilot` |
20 | | - A repo-aware Gemini agent discovered by DevUI. |
| 20 | +## Architecture |
21 | 21 |
|
22 | | -- `entities/repo_copilot_auto` |
23 | | - Auto-routing repo assistant with ordered API and CLI fallback. |
24 | | - |
25 | | -- `entities/repo_copilot_pro` |
26 | | -- `entities/repo_copilot_flash` |
27 | | -- `entities/repo_copilot_flash_lite` |
28 | | - Model-pinned assistants so the DevUI entity dropdown acts like a model selector. |
29 | | - |
30 | | -- `entities/repo_copilot_workflow` |
31 | | - A checkpointed workflow wrapper around the same agent. |
32 | | - |
33 | | -- `entities/repo_team` |
34 | | - A true multi-agent sequential workflow: planner -> researcher -> implementer -> reviewer, with request-info pauses. |
35 | | - |
36 | | -- `maf_starter/tools.py` |
37 | | - Safe local tools for: |
38 | | - - repo overview |
39 | | - - file listing |
40 | | - - file reading |
41 | | - - text search |
42 | | - - human approval requests |
43 | | - |
44 | | -- `maf_starter/cli.py` |
45 | | - Local commands for: |
46 | | - - config checks |
47 | | - - smoke tests |
48 | | - - Gemini model probing |
49 | | - - launching DevUI |
50 | | - |
51 | | -## Quick Start |
52 | | - |
53 | | -### 1. Create and activate a virtual environment |
54 | | - |
55 | | -```powershell |
56 | | -python -m venv .venv |
57 | | -.\.venv\Scripts\Activate.ps1 |
58 | | -``` |
59 | | - |
60 | | -### 2. Install dependencies |
61 | | - |
62 | | -```powershell |
63 | | -python -m pip install -U pip |
64 | | -python -m pip install -r requirements.txt |
65 | | -``` |
66 | | - |
67 | | -### 3. Copy the env template |
68 | | - |
69 | | -```powershell |
70 | | -Copy-Item .env.example .env |
71 | | -``` |
72 | | - |
73 | | -Then fill in `GEMINI_API_KEY`. |
74 | | - |
75 | | -### 4. Check configuration |
76 | | - |
77 | | -```powershell |
78 | | -python main.py doctor |
79 | | -``` |
80 | | - |
81 | | -### 5. Run a smoke test |
82 | | - |
83 | | -```powershell |
84 | | -python main.py smoke --message "Reply with exactly READY" |
85 | | -``` |
86 | | - |
87 | | -### 6. Probe Gemini models |
88 | | - |
89 | | -This is useful if you want to see which Gemini models work with your current key/project before picking a default. |
90 | | - |
91 | | -```powershell |
92 | | -python main.py probe-models |
93 | | -``` |
94 | | - |
95 | | -### 7. Launch Operator Workbench |
96 | | - |
97 | | -```powershell |
98 | | -python -m uvicorn autogen_dashboard.app:create_app --factory --host 127.0.0.1 --port 8000 |
99 | | -``` |
100 | | - |
101 | | -Then open: |
102 | | - |
103 | | -- `http://127.0.0.1:8000` |
104 | | - |
105 | | -The Operator Workbench is the polished local UI for daily use. The active run workspace is organized into: |
106 | | - |
107 | | -- `Overview` |
108 | | -- `Timeline` |
109 | | -- `Agents` |
110 | | -- `Routing` |
111 | | -- `Artifacts` |
112 | | - |
113 | | -Operator Workbench manual spot checks: |
114 | | - |
115 | | -- confirm human, manager, specialist, approval, and event messages are visually distinct at a glance |
116 | | -- confirm the active route and active stage strips stay visible above the transcript |
117 | | -- confirm Timeline shows approvals, route attempts, validation steps, and stage changes without reading raw logs |
118 | | -- confirm Artifacts shows changed files, diff artifacts, validation results, and saved stage outputs |
119 | | -- confirm the selected run stays visually dominant and the create-run panel becomes secondary once a run is active |
120 | | -- confirm the rail and workspace stack cleanly on narrower laptop widths |
121 | | - |
122 | | -### 8. Launch DevUI |
123 | | - |
124 | | -```powershell |
125 | | -python main.py devui --host 127.0.0.1 --port 8080 --no-open |
126 | | -``` |
127 | | - |
128 | | -Then open: |
129 | | - |
130 | | -- `http://127.0.0.1:8080` |
131 | | - |
132 | | -DevUI will discover the entities under [entities](/C:/repo/autogen/entities). |
133 | | - |
134 | | -On Windows, the easiest way to keep the server alive is: |
135 | | - |
136 | | -```powershell |
137 | | -.\start_devui.ps1 |
| 22 | +```mermaid |
| 23 | +flowchart LR |
| 24 | + Op["Operator\n(DevUI / Workbench)"] -->|"prompt"| MAF["autogen\n(MAF Runtime)"] |
| 25 | + MAF --> Gemini["Gemini API\n(primary)"] |
| 26 | + MAF --> Anthropic["Anthropic API\n(fallback)"] |
| 27 | + MAF --> CLI["Local CLIs\n(gemini-cli / claude)"] |
| 28 | + MAF --> Entities["Entities\n(repo_team, copilots)"] |
| 29 | + MAF --> Tools["Repo Tools\n(read / write / search)"] |
| 30 | + MAF --> Checkpoints["Checkpoints\n(FileCheckpointStorage)"] |
| 31 | + Entities --> Out["Run Output\n+ Artifacts"] |
| 32 | + Tools --> Out |
| 33 | + Checkpoints --> Out |
138 | 34 | ``` |
139 | 35 |
|
140 | | -That opens a dedicated PowerShell window and keeps DevUI running there. |
141 | | - |
142 | | -To stop it later: |
| 36 | +## Quickstart |
143 | 37 |
|
144 | | -```powershell |
145 | | -.\stop_devui.ps1 |
| 38 | +```bash |
| 39 | +git clone https://github.com/Coding-Autopilot-System/autogen.git |
| 40 | +cd autogen |
| 41 | +python -m venv .venv |
| 42 | +# Windows: .\.venv\Scripts\Activate.ps1 |
| 43 | +# macOS/Linux: source .venv/bin/activate |
| 44 | +pip install agent-framework python-dotenv |
146 | 45 | ``` |
147 | 46 |
|
148 | | -Runtime logs are written to `.maf-devui.out.log` and `.maf-devui.err.log`. |
149 | | - |
150 | | -## Commands |
151 | | - |
152 | | -- `python main.py doctor` |
153 | | - Prints the effective MAF config without exposing the API key. |
154 | | - |
155 | | -- `python main.py smoke --message "..."` |
156 | | - Runs the repo copilot once through Agent Framework and prints the response. |
157 | | - |
158 | | -- `python main.py probe-models` |
159 | | - Tries the configured Gemini model candidates with a short prompt and prints success/failure per model. |
160 | | - |
161 | | -- `python main.py devui --host 127.0.0.1 --port 8080 --no-open` |
162 | | - Starts Microsoft Agent Framework DevUI using directory discovery. |
163 | | - |
164 | | -- `python -m uvicorn autogen_dashboard.app:create_app --factory --host 127.0.0.1 --port 8000` |
165 | | - Starts the Operator Workbench product UI over the existing dashboard runtime. |
166 | | - |
167 | | -## Human In The Loop |
168 | | - |
169 | | -This starter currently uses tool approval as the first HITL mechanism. |
170 | | - |
171 | | -The agent has a `request_human_approval` tool marked with mandatory approval. In DevUI, when the model decides it needs confirmation for a proposed action, DevUI will pause and ask you to approve or reject the tool call before the run continues. |
172 | | - |
173 | | -That is the simplest supported MAF path for a practical local setup. A richer request/response workflow gate can be added next if you want explicit pause states separate from tool approval. |
174 | | - |
175 | | -## Gemini Quota Fallback |
176 | | - |
177 | | -The main auto-routing MAF agent now uses an ordered fallback chain. |
178 | | - |
179 | | -Default chain: |
180 | | - |
181 | | -1. `gemini:gemini-2.5-pro` |
182 | | -2. `anthropic:claude-sonnet-4-6` when `ANTHROPIC_API_KEY` is configured |
183 | | -3. `gemini:gemini-2.5-flash` |
184 | | -4. `gemini:gemini-2.5-flash-lite` |
185 | | -5. `claude-cli` |
186 | | -6. `codex-cli` |
187 | | -7. `gemini-cli:gemini-2.5-pro` |
188 | | - |
189 | | -That means DevUI can keep answering even when the free-tier Gemini project is exhausted. |
190 | | - |
191 | | -Important limitation: |
192 | | - |
193 | | -- when a turn falls back to a CLI provider, tool calling is unavailable for that turn |
194 | | -- the response is prefixed so you can see that fallback was used |
195 | | - |
196 | | -You can override the chain in `.env` with: |
197 | | - |
198 | | -```env |
199 | | -MAF_FALLBACK_CHAIN=gemini:gemini-2.5-pro,anthropic:claude-sonnet-4-6,gemini:gemini-2.5-flash,gemini:gemini-2.5-flash-lite,claude-cli,codex-cli,gemini-cli:gemini-2.5-pro |
200 | | -``` |
| 47 | +Copy `.env.example` to `.env` and set `GEMINI_API_KEY`. See the [Setup Guide](https://github.com/Coding-Autopilot-System/autogen/wiki/Setup-Guide) for full configuration instructions. |
201 | 48 |
|
202 | 49 | ## Configuration |
203 | 50 |
|
204 | | -The loader in [maf_starter/config.py](/C:/repo/autogen/maf_starter/config.py) reads `.env` from the repo root. |
205 | | - |
206 | | -Primary variables: |
207 | | - |
208 | | -```env |
209 | | -MAF_MODEL=gemini-2.5-flash |
210 | | -MAF_REPO_ROOT=C:\repo\autogen |
211 | | -MAF_ENTITIES_DIR=entities |
212 | | -MAF_CHECKPOINT_DIR=state\maf-checkpoints |
213 | | -MAF_FALLBACK_CHAIN=gemini:gemini-2.5-pro,gemini:gemini-2.5-flash,gemini:gemini-2.5-flash-lite,claude-cli,codex-cli,gemini-cli:gemini-2.5-pro |
214 | | -GEMINI_API_KEY=... |
215 | | -GEMINI_BASE_URL=https://generativelanguage.googleapis.com/v1beta/openai/ |
216 | | -``` |
217 | | - |
218 | | -Compatibility fallbacks: |
219 | | - |
220 | | -- `MAF_MODEL` falls back to `GEMINI_MODEL` |
221 | | -- `MAF_BASE_URL` falls back to `GEMINI_BASE_URL` |
222 | | -- `MAF_API_KEY` falls back to `GEMINI_API_KEY` |
223 | | - |
224 | | -Optional extra API: |
225 | | - |
226 | | -```env |
227 | | -ANTHROPIC_API_KEY= |
228 | | -ANTHROPIC_MODEL=claude-sonnet-4-6 |
229 | | -``` |
230 | | - |
231 | | -## Notes |
232 | | - |
233 | | -- `autogen_dashboard` is now the primary operator-facing product UI. DevUI remains useful for framework-level inspection, but the workbench is the surface intended for daily run management. |
234 | | -- `autogen_starter` remains legacy code. |
235 | | -- Gemini model availability and quota are project-specific. Use `python main.py probe-models` if you want a real answer for your current key instead of guessing from docs. |
236 | | - |
237 | | -## DevUI UI Development |
238 | | - |
239 | | -This repo treats DevUI as a local sample app, not a long-term product UI. |
240 | | - |
241 | | -The practical customization seams are: |
242 | | - |
243 | | -- [maf_starter/routing_policy.py](/C:/repo/autogen/maf_starter/routing_policy.py) for model/provider selection |
244 | | -- [maf_starter/devui_patches.py](/C:/repo/autogen/maf_starter/devui_patches.py) for route metadata and trace payloads |
245 | | -- [maf_starter/devui_overrides.py](/C:/repo/autogen/maf_starter/devui_overrides.py) for injected CSS/JS presentation changes |
| 51 | +| Variable | Required | Default | Description | |
| 52 | +|----------|----------|---------|-------------| |
| 53 | +| `GEMINI_API_KEY` | Yes | -- | Gemini API key for primary model | |
| 54 | +| `MAF_MODEL` | No | `gemini-2.5-flash` | Primary model for agent runs | |
| 55 | +| `MAF_FALLBACK_CHAIN` | No | Auto | Comma-separated provider fallback order | |
| 56 | +| `ANTHROPIC_API_KEY` | No | -- | Anthropic API key for Claude fallback | |
246 | 57 |
|
247 | | -For the full repo-specific guide, see [docs/DEVUI_CUSTOMIZATION.md](/C:/repo/autogen/docs/DEVUI_CUSTOMIZATION.md). |
| 58 | +See the [Configuration Reference](https://github.com/Coding-Autopilot-System/autogen/wiki/Configuration-Reference) for the full variable list. |
248 | 59 |
|
249 | | -## Official References |
| 60 | +## License |
250 | 61 |
|
251 | | -- [Microsoft Agent Framework Overview](https://learn.microsoft.com/en-us/agent-framework/overview/?pivots=programming-language-python) |
252 | | -- [AutoGen to Microsoft Agent Framework Migration Guide](https://learn.microsoft.com/en-us/agent-framework/migration-guide/from-autogen/) |
253 | | -- [DevUI Directory Discovery](https://learn.microsoft.com/en-us/agent-framework/devui/directory-discovery) |
254 | | -- [DevUI Security](https://learn.microsoft.com/en-us/agent-framework/user-guide/devui/security) |
255 | | -- [DevUI Samples](https://learn.microsoft.com/en-us/agent-framework/user-guide/devui/samples) |
256 | | -- [Human in the Loop](https://learn.microsoft.com/en-us/agent-framework/workflows/human-in-the-loop) |
| 62 | +MIT -- see [LICENSE](LICENSE) |
0 commit comments