{"id":3891,"library":"autogen-core","title":"AutoGen Core","description":"AutoGen Core provides the foundational interfaces and agent runtime implementation for the AutoGen multi-agent conversation framework. It offers core components like `ConversableAgent` and `GroupChat`, enabling basic agent communication and management. While `autogen-core` focuses on the underlying framework, the broader 'autogen' package typically provides a more complete, high-level multi-agent system, tools, and UI. Current version: 0.7.5. Release cadence is frequent, often tied to the broader AutoGen project updates.","status":"active","version":"0.7.5","language":"en","source_language":"en","source_url":"https://github.com/microsoft/autogen","tags":["AI","agents","multi-agent","LLM","orchestration"],"install":[{"cmd":"pip install autogen-core","lang":"bash","label":"Install autogen-core"}],"dependencies":[{"reason":"Requires Python 3.10 or higher.","package":"python","optional":false}],"imports":[{"note":"`autogen-core` provides components under the `autogen.agentchat` namespace, not `autogen_core` directly.","wrong":"from autogen_core.agentchat import ConversableAgent","symbol":"ConversableAgent","correct":"from autogen.agentchat import ConversableAgent"},{"note":"`autogen-core` provides components under the `autogen.agentchat` namespace, not `autogen_core` directly.","wrong":"from autogen_core.agentchat import UserProxyAgent","symbol":"UserProxyAgent","correct":"from autogen.agentchat import UserProxyAgent"},{"note":"As of recent versions (e.g., autogen-core 0.2+), `GroupChat` and `GroupChatManager` were moved to the `autogen.agentchat.groupchat` submodule.","wrong":"from autogen.agentchat import GroupChat","symbol":"GroupChat","correct":"from autogen.agentchat.groupchat import GroupChat"},{"note":"As of recent versions (e.g., autogen-core 0.2+), `GroupChat` and `GroupChatManager` were moved to the `autogen.agentchat.groupchat` submodule.","wrong":"from autogen.agentchat import GroupChatManager","symbol":"GroupChatManager","correct":"from autogen.agentchat.groupchat import GroupChatManager"}],"quickstart":{"code":"import os\nimport asyncio\nfrom autogen.agentchat import ConversableAgent\n\n# Configure LLM (e.g., OpenAI API Key)\n# For a runnable example, ensure OPENAI_API_KEY is set in your environment\nllm_config = {\n    \"config_list\": [\n        {\n            \"model\": \"gpt-4o-mini\", # Or \"gpt-4\", \"gpt-3.5-turbo\"\n            \"api_key\": os.environ.get(\"OPENAI_API_KEY\", \"\")\n        }\n    ],\n    \"temperature\": 0.7\n}\n\n# Create two agents\nagent_a = ConversableAgent(\n    name=\"AgentA\",\n    system_message=\"You are a helpful AI assistant. You can chat and respond to queries.\",\n    llm_config=llm_config,\n    is_termination_msg=lambda msg: \"terminate\" in msg[\"content\"].lower(),\n    human_input_mode=\"NEVER\",\n    max_consecutive_auto_reply=3\n)\n\nagent_b = ConversableAgent(\n    name=\"AgentB\",\n    system_message=\"You are an expert in explaining complex concepts clearly.\",\n    llm_config=llm_config,\n    is_termination_msg=lambda msg: \"terminate\" in msg[\"content\"].lower(),\n    human_input_mode=\"NEVER\",\n    max_consecutive_auto_reply=3\n)\n\nasync def run_chat():\n    print(\"\\n--- Initiating chat between AgentA and AgentB ---\")\n    chat_result = await agent_a.initiate_chat(\n        agent_b,\n        message=\"Explain the concept of quantum entanglement in simple terms.\"\n    )\n    print(\"\\n--- Chat Summary ---\")\n    # print(chat_result.chat_history) # Uncomment to see full history\n\nif __name__ == \"__main__\":\n    # Ensure the API key is present for the example to work\n    if not os.environ.get(\"OPENAI_API_KEY\"):\n        print(\"Warning: OPENAI_API_KEY environment variable not set. LLM calls may fail or raise errors.\")\n        print(\"Please set it for the quickstart to fully function.\")\n    asyncio.run(run_chat())\n","lang":"python","description":"This quickstart demonstrates a basic conversation between two `ConversableAgent` instances using `autogen-core`. Agents are configured with an LLM (e.g., OpenAI) and communicate asynchronously. Ensure the `OPENAI_API_KEY` environment variable is set for the LLM configuration to be valid."},"warnings":[{"fix":"Consider `pip install autogen` if you need the full AutoGen ecosystem beyond just the core agent communication primitives.","message":"The `autogen-core` library provides the `autogen.agentchat` module. For most users building multi-agent applications, installing the broader `autogen` package (`pip install autogen`) is recommended as it includes `autogen-core` along with additional high-level agents, tools, and features. Installing `autogen-core` alone only provides the foundational agent chat capabilities.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always use `from autogen.agentchat import ...` or `from autogen.agentchat.groupchat import ...` for core agent components.","message":"Despite being named `autogen-core`, its modules are exposed under the `autogen` namespace, specifically `autogen.agentchat`. For example, `ConversableAgent` is imported via `from autogen.agentchat import ConversableAgent`, not `from autogen_core.agentchat import ConversableAgent`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Set required API keys (e.g., `export OPENAI_API_KEY='your-key'`) in your environment or provide them explicitly in `llm_config` within your code.","message":"Many core functionalities and examples for `autogen-core` agents implicitly rely on Language Model (LLM) providers (e.g., OpenAI, Azure OpenAI). Ensure `llm_config` is correctly set, typically requiring an API key like `OPENAI_API_KEY` to be configured in your environment variables for the LLM client to authenticate.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Pin your `autogen-core` version to a specific minor release (`autogen-core==0.7.x`) and regularly consult the official changelog and migration guides when upgrading. Test thoroughly after updates.","message":"The AutoGen ecosystem is under active and rapid development. While efforts are made to maintain backward compatibility for `autogen-core`, internal API structures and even module placements (e.g., `GroupChat` moving to a submodule) can change between minor versions. This can lead to unexpected import errors or behavior changes.","severity":"breaking","affected_versions":"All versions (especially pre-1.0)"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}