Agent with Tools
Quickstart
1from kern.agent import Agent2from kern.models.openai import OpenAIResponses3from kern.tools.duckduckgo import DuckDuckGoTools45# ---------------------------------------------------------------------------6# Create Agent7# ---------------------------------------------------------------------------8agent = Agent(9 name="Tool-Enabled Agent",10 model=OpenAIResponses(id="gpt-5.2"),11 tools=[DuckDuckGoTools()],12)1314# ---------------------------------------------------------------------------15# Run Agent16# ---------------------------------------------------------------------------17if __name__ == "__main__":18 agent.print_response(19 "Find one recent AI safety headline and summarize it.", stream=True20 )Run the Example
1# Clone and setup repo2git clone https://github.com/kern-ai/kern.git3cd kern/cookbook/02_agents/01_quickstart45# Create and activate virtual environment6./scripts/demo_setup.sh7source .venvs/demo/bin/activate89python agent_with_tools.py