Skip to content

Commit e673c43

Browse files
victordibiaekzhu
andauthored
Add Documentation for AGS (#4711)
* enable download of team specs * add docs v1 for ags to documentation website * update docs readme/image * Update python/packages/autogen-core/docs/src/user-guide/autogenstudio-user-guide/usage.md Co-authored-by: Eric Zhu <[email protected]> * Update python/packages/autogen-core/docs/src/user-guide/autogenstudio-user-guide/index.md Co-authored-by: Eric Zhu <[email protected]> --------- Co-authored-by: Eric Zhu <[email protected]>
1 parent 7c0bbf6 commit e673c43

File tree

7 files changed

+348
-5
lines changed

7 files changed

+348
-5
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
myst:
3+
html_meta:
4+
"description lang=en": |
5+
FAQ for AutoGen Studio - A low code tool for building and debugging multi-agent systems
6+
---
7+
8+
# FAQ
9+
10+
## Q: How do I specify the directory where files(e.g. database) are stored?
11+
12+
A: You can specify the directory where files are stored by setting the `--appdir` argument when running the application. For example, `autogenstudio ui --appdir /path/to/folder`. This will store the database (default) and other files in the specified directory e.g. `/path/to/folder/database.sqlite`.
13+
14+
## Q: Can I use other models with AutoGen Studio?
15+
16+
Yes. AutoGen standardizes on the openai model api format, and you can use any api server that offers an openai compliant endpoint. In the AutoGen Studio UI, each agent has an `model_client` field where you can input your model endpoint details including `model`, `api key`, `base url`, `model type` and `api version`. For Azure OpenAI models, you can find these details in the Azure portal. Note that for Azure OpenAI, the `model name` is the deployment id or engine, and the `model type` is "azure".
17+
For other OSS models, we recommend using a server such as vllm, LMStudio, Ollama, to instantiate an openai compliant endpoint.
18+
19+
## Q: The server starts but I can't access the UI
20+
21+
A: If you are running the server on a remote machine (or a local machine that fails to resolve localhost correctly), you may need to specify the host address. By default, the host address is set to `localhost`. You can specify the host address using the `--host <host>` argument. For example, to start the server on port 8081 and local address such that it is accessible from other machines on the network, you can run the following command:
22+
23+
```bash
24+
autogenstudio ui --port 8081 --host 0.0.0.0
25+
```
26+
27+
## Q: Can I export my agent workflows for use in a python app?
28+
29+
Yes. In the Team Builder view, you select a team and download its specification. This file can be imported in a python application using the `TeamManager` class. For example:
30+
31+
```python
32+
33+
from autogenstudio.teammanager import TeamManager
34+
35+
tm = TeamManager()
36+
result_stream = tm.run(task="What is the weather in New York?", team_config="team.json") # or wm.run_stream(..)
37+
38+
```
39+
40+
<!-- ## Q: Can I deploy my agent workflows as APIs?
41+
42+
Yes. You can launch the workflow as an API endpoint from the command line using the `autogenstudio` commandline tool. For example:
43+
44+
```bash
45+
autogenstudio serve --workflow=workflow.json --port=5000
46+
```
47+
48+
Similarly, the workflow launch command above can be wrapped into a Dockerfile that can be deployed on cloud services like Azure Container Apps or Azure Web Apps. -->
49+
50+
## Q: Can I run AutoGen Studio in a Docker container?
51+
52+
A: Yes, you can run AutoGen Studio in a Docker container. You can build the Docker image using the provided [Dockerfile](https://github.com/microsoft/autogen/blob/autogenstudio/samples/apps/autogen-studio/Dockerfile) and run the container using the following commands:
53+
54+
```bash
55+
FROM python:3.10
56+
57+
WORKDIR /code
58+
59+
RUN pip install -U gunicorn autogenstudio
60+
61+
RUN useradd -m -u 1000 user
62+
USER user
63+
ENV HOME=/home/user \
64+
PATH=/home/user/.local/bin:$PATH \
65+
AUTOGENSTUDIO_APPDIR=/home/user/app
66+
67+
WORKDIR $HOME/app
68+
69+
COPY --chown=user . $HOME/app
70+
71+
CMD gunicorn -w $((2 * $(getconf _NPROCESSORS_ONLN) + 1)) --timeout 12600 -k uvicorn.workers.UvicornWorker autogenstudio.web.app:app --bind "0.0.0.0:8081"
72+
```
73+
74+
Using Gunicorn as the application server for improved performance is recommended. To run AutoGen Studio with Gunicorn, you can use the following command:
75+
76+
```bash
77+
gunicorn -w $((2 * $(getconf _NPROCESSORS_ONLN) + 1)) --timeout 12600 -k uvicorn.workers.UvicornWorker autogenstudio.web.app:app --bind
78+
```
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
myst:
3+
html_meta:
4+
"description lang=en": |
5+
User Guide for AutoGen Studio - A low code tool for building and debugging multi-agent systems
6+
---
7+
8+
# AutoGen Studio
9+
10+
[![PyPI version](https://badge.fury.io/py/autogenstudio.svg)](https://badge.fury.io/py/autogenstudio)
11+
[![Downloads](https://static.pepy.tech/badge/autogenstudio/week)](https://pepy.tech/project/autogenstudio)
12+
13+
AutoGen Studio is a low-code interface built to help you rapidly prototype AI agents, enhance them with tools, compose them into teams and interact with them to accomplish tasks. It is built on [AutoGen AgentChat](https://microsoft.github.io/autogen) - a high-level API for building multi-agent applications.
14+
15+
![AutoGen Studio](https://media.githubusercontent.com/media/microsoft/autogen/refs/heads/main/python/packages/autogen-studio/docs/ags_screen.png)
16+
17+
Code for AutoGen Studio is on GitHub at [microsoft/autogen](https://github.com/microsoft/autogen/tree/main/python/packages/autogen-studio)
18+
19+
```{caution}
20+
AutoGen Studio is meant to help you rapidly prototype multi-agent workflows and demonstrate an example of end user interfaces built with AutoGen. It is not meant to be a production-ready app. Developers are encouraged to use the AutoGen framework to build their own applications, implementing authentication, security and other features required for deployed applications.
21+
```
22+
23+
## Capabilities - What Can You Do with AutoGen Studio?
24+
25+
AutoGen Studio offers four main interfaces to help you build and manage multi-agent systems:
26+
27+
1. **Team Builder**
28+
29+
- A visual interface for creating agent teams through declarative specification (JSON) or drag-and-drop
30+
- Supports configuration of all core components: teams, agents, tools, models, and termination conditions
31+
- Fully compatible with AgentChat's component definitions
32+
33+
2. **Playground**
34+
35+
- Interactive environment for testing and running agent teams
36+
- Features include:
37+
- Live message streaming between agents
38+
- Visual representation of message flow through a control transition graph
39+
- Interactive sessions with teams using UserProxyAgent
40+
- Full run control with the ability to pause or stop execution
41+
42+
3. **Gallery**
43+
44+
- Central hub for discovering and importing community-created components
45+
- Enables easy integration of third-party components
46+
47+
4. **Deployment**
48+
- Export and run teams in python code
49+
- Setup and test endpoints based on a team configuration
50+
- Run teams in a docker container
51+
52+
This revision improves clarity by:
53+
54+
- Organizing capabilities into clearly numbered sections
55+
- Using more precise language
56+
- Breaking down complex features into digestible points
57+
- Maintaining consistent formatting and structure
58+
- Eliminating awkward phrasing and grammatical issues
59+
- Adding context about how each interface serves users
60+
61+
### Roadmap
62+
63+
Review project roadmap and issues [here](https://github.com/microsoft/autogen/issues/4006) .
64+
65+
## Contribution Guide
66+
67+
We welcome contributions to AutoGen Studio. We recommend the following general steps to contribute to the project:
68+
69+
- Review the overall AutoGen project [contribution guide](https://github.com/microsoft/autogen/blob/main/CONTRIBUTING.md)
70+
- Please review the AutoGen Studio [roadmap](https://github.com/microsoft/autogen/issues/4006) to get a sense of the current priorities for the project. Help is appreciated especially with Studio issues tagged with `help-wanted`
71+
- Please use the tag [`proj-studio`](https://github.com/microsoft/autogen/issues?q=is%3Aissue%20state%3Aopen%20label%3Aproj-studio) tag for any issues, questions, and PRs related to Studio
72+
- Please initiate a discussion on the roadmap issue or a new issue to discuss your proposed contribution.
73+
- Submit a pull request with your contribution!
74+
- If you are modifying AutoGen Studio, it has its own devcontainer. See instructions in `.devcontainer/README.md` to use it
75+
76+
## A Note on Security
77+
78+
AutoGen Studio is a research prototype and is **not meant to be used** in a production environment. Some baseline practices are encouraged e.g., using Docker code execution environment for your agents.
79+
80+
However, other considerations such as rigorous tests related to jailbreaking, ensuring LLMs only have access to the right keys of data given the end user's permissions, and other security features are not implemented in AutoGen Studio.
81+
82+
If you are building a production application, please use the AutoGen framework and implement the necessary security features.
83+
84+
## Acknowledgements and Citation
85+
86+
AutoGen Studio is based on the [AutoGen](https://microsoft.github.io/autogen) project. It was adapted from a research prototype built in October 2023 (original credits: Victor Dibia, Gagan Bansal, Adam Fourney, Piali Choudhury, Saleema Amershi, Ahmed Awadallah, Chi Wang).
87+
88+
If you use AutoGen Studio in your research, please cite the following paper:
89+
90+
```
91+
@inproceedings{autogenstudio,
92+
title={AUTOGEN STUDIO: A No-Code Developer Tool for Building and Debugging Multi-Agent Systems},
93+
author={Dibia, Victor and Chen, Jingya and Bansal, Gagan and Syed, Suff and Fourney, Adam and Zhu, Erkang and Wang, Chi and Amershi, Saleema},
94+
booktitle={Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing: System Demonstrations},
95+
pages={72--79},
96+
year={2024}
97+
}
98+
```
99+
100+
## Next Steps
101+
102+
To begin, follow the [installation instructions](installation.md) to install AutoGen Studio.
103+
104+
```{toctree}
105+
:maxdepth: 1
106+
:hidden:
107+
108+
installation
109+
usage
110+
faq
111+
```
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
myst:
3+
html_meta:
4+
"description lang=en": |
5+
User Guide for AutoGen Studio - A low code tool for building and debugging multi-agent systems
6+
---
7+
8+
# Installation
9+
10+
There are two ways to install AutoGen Studio - from PyPi or from source. We **recommend installing from PyPi** unless you plan to modify the source code.
11+
12+
1. **Install from PyPi**
13+
14+
We recommend using a virtual environment (e.g., conda) to avoid conflicts with existing Python packages. With Python 3.10 or newer active in your virtual environment, use pip to install AutoGen Studio:
15+
16+
```bash
17+
pip install -U autogenstudio
18+
```
19+
20+
2. **Install from Source**
21+
22+
> Note: This approach requires some familiarity with building interfaces in React.
23+
24+
If you prefer to install from source, ensure you have Python 3.10+ and Node.js (version above 14.15.0) installed. Here's how you get started:
25+
26+
- Clone the AutoGen Studio repository and install its Python dependencies:
27+
28+
```bash
29+
pip install -e .
30+
```
31+
32+
- Navigate to the `samples/apps/autogen-studio/frontend` directory, install dependencies, and build the UI:
33+
34+
```bash
35+
npm install -g gatsby-cli
36+
npm install --global yarn
37+
cd frontend
38+
yarn install
39+
yarn build
40+
```
41+
42+
For Windows users, to build the frontend, you may need alternative commands to build the frontend.
43+
44+
```bash
45+
46+
gatsby clean && rmdir /s /q ..\\autogenstudio\\web\\ui 2>nul & (set \"PREFIX_PATH_VALUE=\" || ver>nul) && gatsby build --prefix-paths && xcopy /E /I /Y public ..\\autogenstudio\\web\\ui
47+
48+
```
49+
50+
### Running the Application
51+
52+
Once installed, run the web UI by entering the following in a terminal:
53+
54+
```bash
55+
autogenstudio ui --port 8081 --appdir /path/to/folder
56+
```
57+
58+
This will start the application on the specified port. Open your web browser and go to `http://localhost:8081/` to begin using AutoGen Studio.
59+
60+
AutoGen Studio also takes several parameters to customize the application:
61+
62+
- `--host <host>` argument to specify the host address. By default, it is set to `localhost`.
63+
- `--appdir <appdir>` argument to specify the directory where the app files (e.g., database and generated user files) are stored. By default, it is set to the a `.autogenstudio` directory in the user's home directory.
64+
- `--port <port>` argument to specify the port number. By default, it is set to `8080`.
65+
- `--upgrade-database` argument to upgrade the database schema (assuming there are changes in the version you are installing). By default, it is set to `False`.
66+
- `--reload` argument to enable auto-reloading of the server when changes are made to the code. By default, it is set to `False`.
67+
- `--database-uri` argument to specify the database URI. Example values include `sqlite:///database.sqlite` for SQLite and `postgresql+psycopg://user:password@localhost/dbname` for PostgreSQL. If this is not specified, the database URI defaults to a `database.sqlite` file in the `--appdir` directory.
68+
69+
Now that you have AutoGen Studio installed and running, you are ready to explore its capabilities, including defining and modifying agent workflows, interacting with agents and sessions, and expanding agent skills.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
myst:
3+
html_meta:
4+
"description lang=en": |
5+
Usage for AutoGen Studio - A low code tool for building and debugging multi-agent systems
6+
---
7+
8+
# Usage
9+
10+
The expected usage behavior is that developers use the provided Team Builder interface to to define teams - create agents, attach tools and models to agents, and define termination conditions. Once the team is defined, users can run the team in the Playground to interact with the team to accomplish tasks.
11+
12+
![AutoGen Studio](https://media.githubusercontent.com/media/microsoft/autogen/refs/heads/main/python/packages/autogen-studio/docs/ags_screen.png)
13+
14+
## Building an Agent Team
15+
16+
AutoGen Studio is tied very closely with all of the component abstractions provided by AutoGen AgentChat. This includes - {py:class}`~autogen_agentchat.teams`, {py:class}`~autogen_agentchat.agents`, {py:class}`~autogen_core.models`, {py:class}`~autogen_core.tools`, {py:class}`~autogen_agentchat.conditions`.
17+
18+
Users can define these components in the Team Builder interface either via a declarative specification or by dragging and dropping components from a component library.
19+
20+
## Testing an Agent Team
21+
22+
AutoGen Studio Playground allows users to interactively test teams on tasks and review resulting artifacts (such as images, code, and documents).
23+
24+
Users can also review the “inner monologue” of team as they address tasks, and view profiling information such as costs associated with the run (such as number of turns, number of tokens etc.), and agent actions (such as whether tools were called and the outcomes of code execution).
25+
26+
## Importing and Reusing Team Configurations
27+
28+
AutoGen Studio provides a Gallery view where users can import components from 3rd party community sources. This allows users to reuse and share team configurations with others.
29+
30+
- Gallery -> New Gallery -> Import
31+
- Set as default gallery
32+
- Reuse components in Team Builder
33+
34+
### Using AutoGen Studio Teams in a Python Application
35+
36+
An exported team can be easily integrated into any Python application using the `TeamManager` class with just two lines of code. Underneath, the `TeamManager` rehydrates the workflow specification into AutoGen agents that are subsequently used to address tasks.
37+
38+
```python
39+
40+
from autogenstudio.teammanager import TeamManager
41+
42+
tm = TeamManager()
43+
result_stream = tm.run(task="What is the weather in New York?", team_config="team.json") # or wm.run_stream(..)
44+
45+
```
46+
47+
<!-- ### Deploying AutoGen Studio Teams as APIs
48+
49+
The team can be launched as an API endpoint from the command line using the autogenstudio commandline tool.
50+
51+
```bash
52+
autogenstudio serve --workflow=workflow.json --port=5000
53+
```
54+
55+
Similarly, the workflow launch command above can be wrapped into a Dockerfile that can be deployed on cloud services like Azure Container Apps or Azure Web Apps. -->

python/packages/autogen-core/docs/src/user-guide/index.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
:hidden:
66
77
agentchat-user-guide/index
8+
autogenstudio-user-guide/index
89
core-user-guide/index
910
extensions-user-guide/index
1011
```
@@ -19,6 +20,18 @@ extensions-user-guide/index
1920
:class-item: api-card
2021
:::
2122

23+
:::{grid-item-card} {fas}`people-group;pst-color-primary` <br> AutoGen AgentChat
24+
:link: autogenstudio-user-guide/index
25+
:link-type: doc
26+
:class-item: api-card
27+
:::
28+
29+
:::{grid-item-card} {fas}`display;pst-color-primary` <br> AutoGen Studio
30+
:link: autogenstudio-user-guide/index
31+
:link-type: doc
32+
:class-item: api-card
33+
:::
34+
2235
:::{grid-item-card} {fas}`cube;pst-color-primary` <br> AutoGen Core
2336
:link: core-user-guide/index
2437
:link-type: doc
@@ -27,9 +40,8 @@ extensions-user-guide/index
2740

2841
::::
2942

30-
3143
<script type="text/javascript">
3244
setTimeout(function() {
3345
window.location.href = "agentchat-user-guide/quickstart.html";
3446
}, 0);
35-
</script>
47+
</script>
Lines changed: 2 additions & 2 deletions
Loading

python/packages/autogen-studio/frontend/src/components/views/team/builder/builder.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
} from "@xyflow/react";
1919
import "@xyflow/react/dist/style.css";
2020
import { Button, Layout, message, Modal, Switch, Tooltip } from "antd";
21-
import { Cable, Code2, Save } from "lucide-react";
21+
import { Cable, Code2, Download, Save } from "lucide-react";
2222
import { useTeamBuilderStore } from "./store";
2323
import { ComponentLibrary } from "./library";
2424
import { ComponentTypes, Team } from "../../../types/datamodel";
@@ -292,6 +292,24 @@ export const TeamBuilder: React.FC<TeamBuilderProps> = ({
292292
</span>
293293
</div>
294294
<div>
295+
<Tooltip title="Download Team Configuration">
296+
<Button
297+
type="text"
298+
icon={<Download size={18} />}
299+
className="p-1.5 hover:bg-primary/10 rounded-md text-primary/75 hover:text-primary"
300+
onClick={() => {
301+
const json = JSON.stringify(syncToJson(), null, 2);
302+
const blob = new Blob([json], { type: "application/json" });
303+
const url = URL.createObjectURL(blob);
304+
const a = document.createElement("a");
305+
a.href = url;
306+
a.download = "team-config.json";
307+
a.click();
308+
URL.revokeObjectURL(url);
309+
}}
310+
/>
311+
</Tooltip>
312+
295313
<Tooltip title="Save Changes">
296314
<Button
297315
type="text"

0 commit comments

Comments
 (0)