Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.xhipai.com/llms.txt

Use this file to discover all available pages before exploring further.

Hacker News

Fetch top stories and look up user details from Hacker News. Uses the public HN Firebase API — no API key required.

Quick Start

import { Agent, openai, HackerNewsToolkit } from "@agentium/core";

const hn = new HackerNewsToolkit();

const agent = new Agent({
  name: "hn-reader",
  model: openai("gpt-4o"),
  instructions: "Use Hacker News tools to find top stories and user info.",
  tools: [...hn.getTools()],
});

const result = await agent.run(
  "Summarize the top 3 stories on Hacker News with user details."
);

Config

enableGetTopStories
boolean
default:"true"
Enable the hackernews_top_stories tool.
enableGetUserDetails
boolean
default:"true"
Enable the hackernews_user tool.

Tools

ToolDescription
hackernews_top_storiesFetch top stories from HN. Returns title, URL, score, author, and comment count. Accepts numStories (default 10, max 30).
hackernews_userLook up a HN user by username. Returns karma, creation date, about, and submission count.