Autogen Assistant UI
Project description
AutoGen Assistant
AutoGen Assistant is an Autogen-powered AI app (user interface) that can converse with you to help you conduct research, write and execute code, run saved skills, learn new skills (explicitly and by demonstration), and adapt in response to your interactions.
Project Structure:
- autogenra/ code for the backend classes and web api (FastAPI)
- frontend/ code for the webui, built with Gatsby and Tailwind
Getting Started
AutoGen requires access to an LLM. Please see the AutoGen docs on how to configure access to your LLM provider. In this sample, We recommend setting up your OPENAI_API_KEY or AZURE_OPENAI_API_KEY environment variable and then specifying the exact model parameters to be used in the llm_config that is passed to each agent specification. See the get_default_agent_config() method in utils.py to see an example of setting up llm_config. The example below shows how to configure access to an Azure OPENAI LLM.
llm_config = LLMConfig(
config_list=[{
"model": "gpt-4",
"api_key": "<azure_api_key>",
"api_base": "<azure api base>",
"api_type": "azure",
"api_version": "2023-06-01-preview"
}],
temperature=0,
)
export OPENAI_API_KEY=<your_api_key>
Install and Run
To install a prebuilt version of the app from PyPi. We highly recommend using a virtual environment (e.g. miniconda) and python 3.10+ to avoid dependency conflicts.
pip install autogenra
autogenra ui --port 8081 # run the web ui on port 8081
Install from Source
To install the app from source, clone the repository and install the dependencies.
pip install -e .
You will also need to build the app front end. Note that your Gatsby requires node > 14.15.0 . You may need to upgrade your node version as needed.
npm install --global yarn
cd frontend
yarn install
yarn build
The command above will build the frontend ui and copy the build artifacts to the autogenra web ui folder. Note that you may have to run npm install --force --legacy-peer-deps to force resolve some peer dependencies.
Run the web ui:
autogenra ui --port 8081 # run the web ui on port 8081
Navigate to http://localhost:8081/ to view the web ui.
To update the web ui, navigate to the frontend directory, make changes and rebuild the ui.
Capabilities
This demo focuses on the research assistant use case with some generalizations:
-
Skills: The agent is provided with a list of skills that it can leverage while attempting to address a user's query. Each skill is a python function that may be in any file in a folder made availabe to the agents. We separate the concept of global skills available to all agents
backend/files/global_utlis_dirand user level skillsbackend/files/user/<user_hash>/utils_dir, relevant in a multi user environment. Agents are aware skills as they are appended to the system message. A list of example skills is available in thebackend/global_utlis_dirfolder. Modify the file or create a new file with a function in the same directory to create new global skills. -
Conversation Persistence: Conversation history is persisted in an sqlite database
database.sqlite. -
Default Agent Workflow: The default a sample workflow with two agents - a user proxy agent and an assistant agent.
Example Usage
Let us use a simple query demonstrating the capabilities of the research assistant.
Plot a chart of NVDA and TESLA stock price YTD. Save the result to a file named nvda_tesla.png
The agents responds by writing and executing code to create a python program to generate the chart with the stock prices.
Note than there could be multiple turns between the
AssistantAgentand theUserProxyAgentto produce and execute the code in order to complete the task.
Note: You can also view the debug console that generates useful information to see how the agents are interacting in the background.
FAQ
- How do I add more skills to the research assistant? This can be done by adding a new file with documented functions to
autogenra/web/skills/globaldirectory. - How do I specify the agent configuration (e.g. temperature, model, agent system message, model etc). You can do either from the UI interface or by modifying the default agent configuration in
utils.py(get_default_agent_config()method) - How do I reset the conversation? You can reset the conversation by deleting the
database.sqlitefile. You can also delete user files by deleting theautogenra/web/files/user/<user_id_md5hash>folder. - How do I view messages generated by agents? You can view the messages generated by the agents in the debug console. You can also view the messages in the
database.sqlitefile.
Acknowledgements
Based on the AutoGen project. Adapted in October 2023 from a research prototype (original credits: Gagan Bansal, Adam Fourney, Victor Dibia, Piali Choudhury, Saleema Amershi, Ahmed Awadallah, Chi Wang)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file autogenra-0.0.3a0.tar.gz.
File metadata
- Download URL: autogenra-0.0.3a0.tar.gz
- Upload date:
- Size: 2.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33d7627cc30fa9cd4e229b2a75cfbf3d29025ee7a116f430d3ee596528eb0725
|
|
| MD5 |
45cb255583c0d5372b279ddd6876d7f2
|
|
| BLAKE2b-256 |
92d535d24749b8043cd2457f46051165b90f90c90bccba273a3e592078ae7052
|
File details
Details for the file autogenra-0.0.3a0-py3-none-any.whl.
File metadata
- Download URL: autogenra-0.0.3a0-py3-none-any.whl
- Upload date:
- Size: 2.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7677fc08f8cbd71b54bb4062058f15b8decb3850b0c32f767dd0d34f4f1d3608
|
|
| MD5 |
96d018f5a2f3085811ebeb5c23b271d3
|
|
| BLAKE2b-256 |
53cb2a31c7552cd2b510442728977d6b4df6fcdc4ea26e54a15f288e29c90df3
|