Initial AutoGen Agent Setup

planningChallenge

Prompt Content

Set up a basic AutoGen environment. Define at least three agents: a `UserProxy` agent, a `ContextAnalyst` agent (which understands user history and current context), and an `ActionPlanner` agent (which decides what tools to use or what information to retrieve). Ensure they can communicate. Provide Python code for initialization.

```python
import autogen

# Configuration for LLM (replace with your actual Gemini setup)
config_list = [
    {
        "model": "gemini-2.5-pro",
        "api_key": "YOUR_GEMINI_API_KEY", # Or via Google Vertex AI setup
        "base_url": "..." # if using custom endpoint
    }
]

# User Proxy Agent
user_proxy = autogen.UserProxyAgent(
    name="user_proxy",
    human_input_mode="NEVER",
    max_consecutive_auto_reply=10,
    is_termination_msg=lambda x: x.get("content", "").rstrip().endswith("TERMINATE"),
    code_execution_config=False, # Disable code execution for this challenge
)

# Context Analyst Agent
context_analyst = autogen.AssistantAgent(
    name="context_analyst",
    llm_config={"config_list": config_list},
    system_message="You are an expert at understanding user intent, extracting preferences from history, and identifying relevant context. Your goal is to provide insights to the ActionPlanner."
)

# Action Planner Agent
action_planner = autogen.AssistantAgent(
    name="action_planner",
    llm_config={"config_list": config_list},
    system_message="You are an expert planner. Based on context from the ContextAnalyst, you decide what actions to take or what information to retrieve. You can suggest tools or information needs. Conclude your plan with 'PLAN_COMPLETE'."
)

# (Further agents and group chat setup will go here)
```

Try this prompt

Open the workspace to execute this prompt with free credits, or use your own API keys for unlimited usage.

Usage Tips

Copy the prompt and paste it into your preferred AI tool (Claude, ChatGPT, Gemini)

Customize placeholder values with your specific requirements and context

For best results, provide clear examples and test different variations