{"id":14825,"library":"pyautogen","title":"AutoGen","description":"AutoGen is a framework that allows for the development of LLM applications using multiple agents that can converse with each other to solve tasks. The `pyautogen` PyPI package (current version 0.10.0) acts as a proxy, primarily installing `autogen-agentchat` to provide the core multi-agent conversation capabilities. It has a relatively rapid release cadence, with minor versions often released monthly or more frequently, introducing new features and breaking changes.","status":"active","version":"0.10.0","language":"en","source_language":"en","source_url":"https://github.com/microsoft/autogen","tags":["AI","Agents","LLM","Multi-agent","Orchestration","Generative AI"],"install":[{"cmd":"pip install pyautogen","lang":"bash","label":"Install pyautogen"},{"cmd":"pip install pyautogen[blend]","lang":"bash","label":"Install with blend for local LLM support"}],"dependencies":[{"reason":"Core multi-agent conversation library. `pyautogen` is a proxy package installing this.","package":"autogen-agentchat","optional":false}],"imports":[{"note":"`pyautogen` is the PyPI package, but the actual modules are under the `autogen` namespace.","wrong":"from pyautogen import UserProxyAgent","symbol":"UserProxyAgent","correct":"from autogen import UserProxyAgent"},{"note":"`pyautogen` is the PyPI package, but the actual modules are under the `autogen` namespace.","wrong":"from pyautogen import AssistantAgent","symbol":"AssistantAgent","correct":"from autogen import AssistantAgent"},{"symbol":"config_list_from_json","correct":"from autogen import config_list_from_json"},{"symbol":"GroupChat","correct":"from autogen.groupchat import GroupChat"},{"symbol":"GroupChatManager","correct":"from autogen.groupchat import GroupChatManager"}],"quickstart":{"code":"import autogen\nimport os\n\n# Configure API key from environment variable or direct config_list\nconfig_list = [\n    {\n        \"model\": \"gpt-4o\",\n        \"api_key\": os.environ.get(\"OPENAI_API_KEY\", None)\n    }\n]\n\n# Define agents\nassistant = autogen.AssistantAgent(\n    name=\"Assistant\",\n    llm_config={\n        \"config_list\": config_list,\n        \"temperature\": 0.7\n    }\n)\n\nuser_proxy = autogen.UserProxyAgent(\n    name=\"UserProxy\",\n    human_input_mode=\"NEVER\", # Set to \"ALWAYS\" or \"TERMINATE\" for human interaction\n    max_consecutive_auto_reply=10,\n    is_termination_msg=lambda x: x.get(\"content\", \"\").rstrip().endswith(\"TERMINATE\"),\n    code_execution_config={\n        \"work_dir\": \"coding\", # Create a 'coding' directory for code execution\n        \"use_docker\": False # Set to True to use Docker for safer execution\n    }\n)\n\n# Start a chat\nuser_proxy.initiate_chat(\n    assistant,\n    message=\"What is the capital of France?\"\n)","lang":"python","description":"This quickstart demonstrates setting up two basic agents: an `AssistantAgent` powered by GPT-4o and a `UserProxyAgent` to initiate the conversation and manage execution. It shows how to configure LLM settings using an environment variable for API keys and sets up basic code execution and termination conditions. Remember to set the `OPENAI_API_KEY` environment variable."},"warnings":[{"fix":"Always use `import autogen` and `from autogen import ...` for all modules and classes.","message":"The PyPI package is `pyautogen`, but the modules are imported from the `autogen` namespace (e.g., `import autogen`). Importing from `pyautogen` will fail.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult the official AutoGen documentation or GitHub README for the specific version you are using to verify the `llm_config` and `config_list` format.","message":"The structure of `llm_config` and `config_list` has changed multiple times between minor versions (e.g., 0.1.x, 0.2.x, 0.6.x, 0.9.x). Ensure your configuration matches the exact version's documentation.","severity":"breaking","affected_versions":"Frequent changes across 0.x.x versions"},{"fix":"Prefer configuring models via the `llm_config` dictionary when initializing agents. Avoid using `autogen.oai.Completion` directly unless specifically following an advanced pattern in recent documentation.","message":"The `autogen.oai.Completion` module and related utilities for direct OpenAI API calls were moved or refactored. In newer versions, the primary way to interact with models is through agent `llm_config`.","severity":"breaking","affected_versions":"Pre-0.2.x to Post-0.2.x, and later refactors"},{"fix":"Explicitly set `human_input_mode=\"NEVER\"` (for no human input), `\"TERMINATE\"` (for human input only at termination), or `\"ALWAYS\"` (for human input at every turn) during `UserProxyAgent` initialization.","message":"`UserProxyAgent`'s `human_input_mode` defaults to `ALWAYS` or `TERMINATE` depending on the version, which can pause execution indefinitely waiting for user input. For fully autonomous execution, set `human_input_mode=\"NEVER\"`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure `config_list` explicitly includes `api_key` values, either directly or by referencing environment variables (`os.environ.get(\"KEY\")`) or by ensuring `OAI_CONFIG_LIST` file is correctly formatted and discoverable.","message":"API key management requires a `config_list` where models and keys are defined. While environment variables (e.g., `OPENAI_API_KEY`) are common, they must still be referenced correctly within `config_list` or an `OAI_CONFIG_LIST` JSON file.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[],"ecosystem":"pypi"}