HackerNews:
hackernews_agent.py
Run your Agent
UseAgent.print_response() for development. It prints the response in a readable format in your terminal.
For production, use Agent.run() or Agent.arun():
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Start simple: a model, tools, and instructions.
HackerNews:
from agno.agent import Agent
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)
Agent.print_response() for development. It prints the response in a readable format in your terminal.
For production, use Agent.run() or Agent.arun():
from typing import Iterator
from agno.agent import Agent, RunOutputEvent, RunEvent
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,
)
# Stream the response
stream: Iterator[RunOutputEvent] = agent.run("Trending products", stream=True)
for chunk in stream:
if chunk.event == RunEvent.run_content:
print(chunk.content)
| Task | Guide |
|---|---|
| Run agents | Running agents |
| Debug agents | Debugging agents |
| Manage sessions | Agent sessions |
| Handle input/output | Input and output |
| Add tools | Tools |
| Manage context | Context engineering |
| Add knowledge | Knowledge |
| Handle images, audio, video, files | Multimodal |
| Add guardrails | Guardrails |
| Cache responses during development | Response caching |
Was this page helpful?