Skip to main content
To build effective agents, start simple — just a model, tools, and instructions. Once that works, layer in more functionality as needed. It’s also best to begin with well-defined tasks like report generation, data extraction, classification, summarization, knowledge search, and document processing. These early wins help you identify what works, validate user needs, and set the stage for advanced systems. Here’s the simplest possible report generation agent:
hackernews_agent.py
from agno.agent import Agent, RunOutput
from agno.models.anthropic import Claude
from agno.tools.hackernews import HackerNewsTools

agent = Agent(
    model=Claude(id="claude-sonnet-4-5"),
    tools=[HackerNewsTools()],
    instructions="Write a report on the topic. Output only the report.",
    markdown=True,
)
agent.print_response("Trending startups and products.", stream=True)

Run your Agent

When running your agent, use the Agent.print_response() method to print the response in the terminal. This is only for development purposes and not recommended for production use. In production, use the Agent.run() or Agent.arun() methods. For example:
from typing import Iterator
from agno.agent import Agent, RunOutput, RunOutputEvent, RunEvent
from agno.models.anthropic import Claude
from agno.tools.hackernews import HackerNewsTools
from agno.utils.pprint import pprint_run_response

agent = Agent(
    model=Claude(id="claude-sonnet-4-5"),
    tools=[HackerNewsTools()],
    instructions="Write a report on the topic. Output only the report.",
    markdown=True,
)

# Run agent and return the response as a variable
response: RunOutput = agent.run("Trending startups and products.")
# Print the response
print(response.content)

################ STREAM RESPONSE #################
stream: Iterator[RunOutputEvent] = agent.run("Trending products", stream=True)
for chunk in stream:
    if chunk.event == RunEvent.run_content:
        print(chunk.content)

# ################ STREAM AND PRETTY PRINT #################
stream: Iterator[RunOutputEvent] = agent.run("Trending products", stream=True)
pprint_run_response(stream, markdown=True)
Next, continue building your agent by adding functionality as needed. Common questions:
  • How do I run my agent? -> See the running agents documentation.
  • How do I manage sessions? -> See the agent sessions documentation.
  • How do I manage input and capture output? -> See the input and output documentation.
  • How do I add tools? -> See the tools documentation.
  • How do I give the agent context? -> See the context engineering documentation.
  • How do I add knowledge? -> See the knowledge documentation.
  • How do I handle images, audio, video, and files? -> See the multimodal documentation.
  • How do I add guardrails? -> See the guardrails documentation.

Developer Resources

I