Back to Prompt Library
planning

AutoGen Setup and Agent Definition

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

Linked challenge: Multi-Agent Ad Policy Auditor

Format
Code-aware
Lines
33
Sections
8
Linked challenge
Multi-Agent Ad Policy Auditor

Prompt source

Original prompt text with formatting preserved for inspection.

33 lines
8 sections
No variables
1 code block
Initialize AutoGen and define the core agents for the system: a 'UserTopicAnalyzer' (using Gemini 2.5 Flash), an 'AdStrategist', a 'PrivacyAuditor', and a 'FactChecker'. Configure their roles, system messages, and communication patterns. Consider using `ConversableAgent` for custom logic and `AssistantAgent` for LLM integration.

```python
import autogen

config_list = [
    {
        "model": "gemini-2.5-flash",
        "api_key": "YOUR_GEMINI_API_KEY",
        "api_type": "google",
        "base_url": "https://generativelanguage.googleapis.com/v1beta",
    }
    # Add other LLM configurations as needed
]

llm_config = {"config_list": config_list, "temperature": 0.7}

# Define agents
user_proxy = autogen.UserProxyAgent(
    name="admin",
    human_input_mode="TERMINATE",
    max_consecutive_auto_reply=10,
    is_termination_msg=lambda x: x.get("content", "").rstrip().endswith("TERMINATE"),
    code_execution_config={"last_n_messages": 3, "work_dir": "coding"},
)

user_topic_analyzer = autogen.AssistantAgent(
    name="UserTopicAnalyzer",
    llm_config=llm_config,
    system_message="You are an expert at analyzing user conversation data to extract primary topics and interests. Use Gemini 2.5 Flash to quickly identify key themes for ad targeting.",
)

ad_strategist = autogen.AssistantAgent(
    name="AdStrategist",
    llm_config=llm_config, # Or a different LLM config
    system_message="You are an ad campaign manager. Based on user topics, propose a concise ad strategy, including title, target audience, and key phrases. Await privacy review.",
)

# ... continue defining PrivacyAuditor and FactChecker agents
```

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.