Content Team
Build a content creation team with specialized researchers and writers that collaborate to produce high-quality articles. This example demonstrates team coordination where agents work together on complex tasks.
What You'll Learn
By building this team, you'll understand:
- How to create specialized agents with distinct roles and capabilities
- How teams coordinate multiple agents using the coordinate mode
- How to combine web search tools with writing expertise for content creation
- How to structure team instructions for collaborative workflows
Use Cases
Build content creation platforms, automated journalism systems, research report generators, or marketing content pipelines.
How It Works
The team uses coordinate mode to manage collaboration between specialized agents:
- Research: Researcher agent searches the web using DuckDuckGo for relevant information
- Coordinate: Team leader coordinates task distribution between members
- Write: Writer agent crafts clear, engaging content based on research findings
- Integrate: Team combines research and writing into cohesive articles
The team leader manages the workflow and ensures both agents contribute their expertise.
Code
1from kern.agent import Agent2from kern.models.openai import OpenAIResponses3from kern.team import Team4from kern.tools.duckduckgo import DuckDuckGoTools56# Create individual specialized agents7researcher = Agent(8 name="Researcher",9 role="Expert at finding information",10 tools=[DuckDuckGoTools()],11 model=OpenAIResponses(id="gpt-5.2"),12)1314writer = Agent(15 name="Writer",16 role="Expert at writing clear, engaging content",17 model=OpenAIResponses(id="gpt-5.2"),18)1920# Create a team with these agents21content_team = Team(22 name="Content Team",23 members=[researcher, writer],24 instructions="You are a team of researchers and writers that work together to create high-quality content.",25 model=OpenAIResponses(id="gpt-5.2"),26 show_members_responses=True,27)2829# Run the team with a task30content_team.print_response("Create a short article about quantum computing")What to Expect
The team will create an article by first researching the topic through web search, then writing content based on the findings. The researcher finds relevant information and sources, while the writer transforms this into engaging prose.
The output shows responses from both team members so you can see how they collaborate. The final article combines accurate research with clear, professional writing.
Usage
Set up your virtual environment
1uv venv --python 3.122source .venv/bin/activate1uv venv --python 3.122.venv\Scripts\activateSet your API key
1export OPENAI_API_KEY=xxxInstall dependencies
1uv pip install -U kern-ai openai ddgsRun Team
1python content_team.py1python content_team.pyNext Steps
- Modify the task in
print_response()to create different types of content - Add more specialized agents like editors or fact-checkers to the team
- Adjust
show_members_responsesto control visibility of individual agent outputs - Explore Teams for advanced collaboration patterns