Back to Prompt Library
planning

Initial AutoGen Agent Setup

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Build Proactive Personalized Assistant with AutoGen & Gemini 2.5 Pro

Format
Code-aware
Lines
33
Sections
7
Linked challenge
Build Proactive Personalized Assistant with AutoGen & Gemini 2.5 Pro

Prompt source

Original prompt text with formatting preserved for inspection.

33 lines
7 sections
No variables
1 code block
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)
```

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Preserve the role framing, objective, and reporting structure so comparison runs stay coherent.

Tune next

Swap in your own domain constraints, anomaly thresholds, and examples before you branch variants.

Verify after

Check whether the prompt asks for the right evidence, confidence signal, and escalation path.