{"id":5120,"library":"autogen-ext","title":"AutoGen Extensions","description":"AutoGen extensions library, version 0.7.5. This library provides additional tools and functionalities to enhance the capabilities of the Microsoft AutoGen multi-agent framework, such as advanced web search, persistent agent memory, and improved communication patterns. It follows the release cadence of its parent `autogen` library, with frequent updates.","status":"active","version":"0.7.5","language":"en","source_language":"en","source_url":"https://github.com/microsoft/autogen-extensions","tags":["AI","agents","multi-agent","autogen","tools"],"install":[{"cmd":"pip install autogen-ext","lang":"bash","label":"Install autogen-ext"}],"dependencies":[{"reason":"Core multi-agent framework dependency, tightly coupled.","package":"autogen","optional":false},{"reason":"Required for LLM interactions.","package":"openai","optional":false},{"reason":"Used for persistent agent memory.","package":"diskcache","optional":true}],"imports":[{"note":"WebSearchTool is part of the autogen-ext library, not directly from autogen's core modules.","wrong":"from autogen.extensions.web_search import WebSearchTool","symbol":"WebSearchTool","correct":"from autogen_extensions.web_search import WebSearchTool"},{"symbol":"AgentMemory","correct":"from autogen_extensions.agent_memory import AgentMemory"}],"quickstart":{"code":"import os\nimport autogen\nfrom autogen_extensions.web_search import WebSearchTool\n\n# Configure LLM (replace with your actual configuration)\nllm_config = {\n    \"model\": \"gpt-4o\", # or \"gpt-4\", \"gpt-3.5-turbo\"\n    \"api_key\": os.environ.get(\"OPENAI_API_KEY\", \"YOUR_OPENAI_API_KEY\"),\n}\n\n# Create an AssistantAgent\nassistant = autogen.AssistantAgent(\n    name=\"assistant\",\n    llm_config=llm_config,\n    is_termination_msg=lambda x: x.get(\"content\", \"\").rstrip().endswith(\"TERMINATE\"),\n)\n\n# Create a UserProxyAgent\nuser_proxy = autogen.UserProxyAgent(\n    name=\"user_proxy\",\n    is_termination_msg=lambda x: x.get(\"content\", \"\").rstrip().endswith(\"TERMINATE\"),\n    human_input_mode=\"NEVER\",\n    max_consecutive_auto_reply=10,\n    llm_config=llm_config, # UserProxyAgent can also use LLM config for self-reflection\n    code_execution_config={\"work_dir\": \"autogen_extension_work_dir\"},\n)\n\n# Register the WebSearchTool (requires SERPER_API_KEY or similar)\n# Get an API key from https://serper.dev or a similar search API provider.\nweb_search_tool = WebSearchTool(config={\"api_key\": os.environ.get(\"SERPER_API_KEY\", None)})\nuser_proxy.register_for_execution(web_search_tool)\nassistant.register_for_llm(web_search_tool)\n\n# Start the conversation\nprint(\"\\n--- Initiating chat with WebSearchTool ---\\n\")\nuser_proxy.initiate_chat(\n    assistant,\n    message=\"What's the capital of France and what are its main attractions? Use web search to find out.\",\n)\nprint(\"\\n--- Chat finished ---\\n\")","lang":"python","description":"This quickstart demonstrates how to integrate the `WebSearchTool` from `autogen-ext` into an AutoGen multi-agent conversation. It requires setting `OPENAI_API_KEY` and `SERPER_API_KEY` (e.g., from Serper.dev) as environment variables or directly in the code."},"warnings":[{"fix":"Pin your `autogen` version to be compatible, e.g., `pip install autogen~=0.2.0`. Always check `autogen-ext`'s `pyproject.toml` or `setup.py` for the exact `autogen` dependency for your `autogen-ext` version.","message":"`autogen-ext` is tightly coupled with specific versions of `autogen`. The current `autogen-ext` (v0.7.5) has a dependency constraint `autogen~=0.2.0` (i.e., `>=0.2.0, <0.3.0`). Using `autogen-ext` with newer versions of `autogen` (e.g., `autogen>=0.3.0` or even later `0.2.x` sub-versions that introduced breaking changes) will likely lead to runtime errors due to API changes in `autogen`.","severity":"breaking","affected_versions":"autogen-ext<=0.7.5` used with `autogen>=0.3.0` (or incompatible `0.2.x` releases)."},{"fix":"Always check tool-specific documentation for required API keys and ensure they are correctly provided, typically through environment variables or directly in the tool's `config` dictionary (e.g., `WebSearchTool(config={\"api_key\": os.environ.get(\"SERPER_API_KEY\")})`).","message":"Tools like `WebSearchTool` often require their own dedicated API keys (e.g., `SERPER_API_KEY` for Serper API), separate from the `OPENAI_API_KEY` used for the LLM itself. Misconfiguring or omitting the tool-specific API key will result in search operations failing silently or with generic errors.","severity":"gotcha","affected_versions":"All versions using tools requiring external service keys."}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}