Agent with Instructions
Quickstart
1from kern.agent import Agent2from kern.models.openai import OpenAIResponses34# ---------------------------------------------------------------------------5# Agent Instructions6# ---------------------------------------------------------------------------7instructions = """\8You are a concise assistant.9Answer with exactly 3 bullet points when possible.\10"""1112# ---------------------------------------------------------------------------13# Create Agent14# ---------------------------------------------------------------------------15agent = Agent(16 name="Instruction-Tuned Agent",17 model=OpenAIResponses(id="gpt-5.2"),18 instructions=instructions,19)2021# ---------------------------------------------------------------------------22# Run Agent23# ---------------------------------------------------------------------------24if __name__ == "__main__":25 agent.print_response("How can I improve my Python debugging workflow?", stream=True)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_instructions.py