Registry / llm-agents / autogen-core

autogen-core

JSON →
library0.7.5pypypi✓ verified 23d ago

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.

pip install autogen-core
INSTALL
IMPORT
SIG · AUTOGEN-CORE
A
autogen-core
llm-agentspythonv0.7.5
Install
3.7s avg
Import
879ms
Disk
43MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.7.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.830s · 50.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.7s · import 0.576s · 51MB
43MB installed
● package 43MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Agent
from autogen_core import Agent
from autogen.agentchat import ConversableAgent
AgentRuntime
from autogen_core import AgentRuntime
from autogen.agentchat import ConversableAgent
BaseAgent
from autogen_core import BaseAgent
from autogen.agentchat import ConversableAgent

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.

import os import asyncio from autogen.agentchat import ConversableAgent # Configure LLM (e.g., OpenAI API Key) # For a runnable example, ensure OPENAI_API_KEY is set in your environment llm_config = { "config_list": [ { "model": "gpt-4o-mini", # Or "gpt-4", "gpt-3.5-turbo" "api_key": os.environ.get("OPENAI_API_KEY", "") } ], "temperature": 0.7 } # Create two agents agent_a = ConversableAgent( name="AgentA", system_message="You are a helpful AI assistant. You can chat and respond to queries.", llm_config=llm_config, is_termination_msg=lambda msg: "terminate" in msg["content"].lower(), human_input_mode="NEVER", max_consecutive_auto_reply=3 ) agent_b = ConversableAgent( name="AgentB", system_message="You are an expert in explaining complex concepts clearly.", llm_config=llm_config, is_termination_msg=lambda msg: "terminate" in msg["content"].lower(), human_input_mode="NEVER", max_consecutive_auto_reply=3 ) async def run_chat(): print("\n--- Initiating chat between AgentA and AgentB ---") chat_result = await agent_a.initiate_chat( agent_b, message="Explain the concept of quantum entanglement in simple terms." ) print("\n--- Chat Summary ---") # print(chat_result.chat_history) # Uncomment to see full history if __name__ == "__main__": # Ensure the API key is present for the example to work if not os.environ.get("OPENAI_API_KEY"): print("Warning: OPENAI_API_KEY environment variable not set. LLM calls may fail or raise errors.") print("Please set it for the quickstart to fully function.") asyncio.run(run_chat())
Debug
Known issues
gotchaThe `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.
fix
Consider `pip install autogen` if you need the full AutoGen ecosystem beyond just the core agent communication primitives.
affects: All versions
gotchaDespite 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`.
fix
Always use `from autogen.agentchat import ...` or `from autogen.agentchat.groupchat import ...` for core agent components.
affects: All versions
gotchaMany 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.
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.
affects: All versions
breakingThe 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.
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.
affects: All versions (especially pre-1.0)
Upgrade
Version history
0.7.5latest on PyPI · released Sep 30, 2025
Audit
Dependencies
pythonrequiredRequires Python 3.10 or higher.
Agent activity
24 hits · last 30 days
node
18
OpenAI (training)
1
Resources
autogen-core — pip install autogen-core · libregistry