Get custom summaries of Hacker News stories in your inbox

Render docs · Inngest Agent Kit docs
Learn how to build and deploy a Hacker News agent with Inngest, Render, and Next.js.
Read our blog post for full details about this agent.
This Hacker News Agent periodically generates a summary of popular articles on Hacker News, and emails you a report.
To use it, you:
Specify questions you want answered about specific interests.
For example, you can specify “Next.js” as an interest, and ask “What are the latest open source libraries?”
Specify the frequency at which you want summaries for each question. (E.g. every hour, once a day, once a week)
The Agent will do the rest.

packages/indexer: A cron job that indexes Hacker News content into a vector database.
This job is deployed using a Render Cron Job, and the vector database is a Render PostgreSQL database that has the pgvector extension enabled.
packages/app: A web app that includes the UI to configure topics and questions for the Hacker News agent, and the backend logic for the agents.
This app is written in Next.js and hosted as a web service on Render. The app uses Inngest’s AgentKit to create and orchestrate agents. To use Inngest’s terminology, we’ll refer to the combination of routing logic, agents, and tools as the AgentKit Network.
To run this project, you need the following accounts:
Before you get started, please fork this repo. By having your own copy of the repo, you can freely make changes to it.
Then git clone your forked repo to your local machine.
The PostgreSQL database is used to store Hacker News stories. It serves as the vector database for the AgentKit Network.
To set up this database, we’ll create a new PostgreSQL database on Render, enable the pgvector extension on the database, and initialize it with our project’s schema.
Follow these steps:
Create a Project on Render. Name it “Hacker News Agent”.
Create a new PostgreSQL database on Render.
Enable the pgvector extension and initialize the database with the project’s schema.
3.1. Locate the schema.sql file in this repo. (This file contains the commands to enable the pgvector extension and set up this project’s schema.)
3.2. Copy your database’s external database URL from the Render dashboard.
3.3. Run the following command in your terminal from the root of the project, but replace the dummy PostgreSQL URL with your URL from Step 3.2:
psql -Atx postgresql://<redacted>@<redacted>.render.com/<redacted> -f packages/indexer/schema.sql
The Indexer service fetches Hacker News stories and stores them in the PostgreSQL vector database.
We will set up the Indexer service as a cron job on Render. (Render offers a Cron Job service type.)
This cron job is packaged as a Docker image that is configured with Playwright and its Chromium binary. For your convenience, we’ve made this Docker image publicly available on Docker Hub.
docker.io/wittydeveloper/inngest-render-indexer:0.6.0 * * * *.DATABASE_URL: The internal URL of your PostgreSQL database (here’s how to find it).OPENAI_API_KEY: Your OpenAI API key.The Docker image is built from the Dockerfile at the root of this project.
See the packages/indexer directory for the source code.
The Next.js app serves the UI that lets you configure the Hacker News agent with “interests” you want to track. The app’s backend hosts the logic of the AgentKit Network.
To set up the app, we’ll create a new web service on Render and configure it to run the Next.js application. The code is located in the packages/app directory.
| Field | Value |
|---|---|
| Language | Node |
| Root Directory | packages/app/ |
| Build Command | pnpm install; pnpm build |
| Start Command | pnpm start |
| Instance type | Starter (this app runs too slowly on the Free plan) |
DATABASE_URL: The external URL of your PostgreSQL vector database (here’s how to find it). (Note: technically we should use the internal URL here, but our code currently does not parse the internal DB url.)INNGEST_EVENT_KEY: The Event Key of your Inngest project.INNGEST_SIGNING_KEY: The Signing Key of your Inngest project.OPENAI_API_KEY: Your OpenAI API Key.RESEND_API_KEY: Your Resend API Key.APP_PASSWORD: A custom password. You must enter this password to gain access to your app.After the deploy finishes, your service will be accessible at the onrender.com URL displayed in the dashboard.
Each time you deploy a new app that uses Inngest, or update your Inngest functions, you must sync the app with Inngest.
Inngest offers several ways to sync an app. Here, we’ll sync the app manually through the Inngest dashboard.
https://<your-app-name>.onrender.com/api/inngestYou’re now ready to try out your Hacker News Agent.
Go to your Render Web Service dashboard and click on the URL of your web service (ex: https://agenkit-render-tutorial.onrender.com).
Log into your app using the APP_PASSWORD you specified. You’ll then see the homepage.
Add an interest and an email address where you want email updates to be sent. Then add a question for your Hacker News Agent to answer for you and specify the frequency at which you want the Agent to update you.

Manually trigger a run of your Indexer cron job.

Try out the app. You can sit back and wait for the next time your Agent runs, which will be determined by the frequency you specified for your question(s). If you want an instant result, click “[ preview ]” next to any question in the UI.
Install dependencies by running the following command from the root of the project:
pnpm install
packages/indexer)Run the indexer locally
Note: You’ll need to set up the
.env.localfile.
pnpm build
pnpm start
Push a new Docker image version
Example:
docker build -t docker.io/wittydeveloper/inngest-render-indexer:0.5 .
docker push docker.io/wittydeveloper/inngest-render-indexer:0.5
packages/app)Note: You’ll need to set up the
.env.localfile.
Don’t forget to set theAPP_PASSWORDpassword
Run the Next.js app locally
pnpm dev
Start the Inngest Dev Server
npx inngest-cli@latest dev