Skip to main content

Live Demo

A single-page semantic search app over Hacker News, showcasing Rivestack pgvector in action.

Try the demo

Search 30 days of HN stories and comments with natural language.

Source code

Full source code: backend, frontend, and Kubernetes deployment.

What it does

Type a question, get semantically relevant Hacker News posts and comments, with real-time performance stats on every query.
  • ~4,000 stories and ~40,000 chunks indexed from the last 30 days of HN
  • HNSW index for fast cosine similarity search
  • Performance stats displayed on every query: vector query time, embedding time, chunks searched, index type
  • Daily cron job keeps a rolling 30-day window of fresh data

Architecture

Performance

Typical query performance on a shared Rivestack instance:
These numbers are from a shared Rivestack instance. Dedicated instances deliver significantly faster performance.

Run it yourself

1. Create a Rivestack database

Sign up at app.rivestack.io and create a database. pgvector is enabled by default on the initial appdb database. For new databases, add it through the dashboard or Terraform.

2. Clone and configure

Edit backend/.env with your Rivestack DATABASE_URL and an OPENAI_API_KEY.

3. Run with Docker Compose

4. Load data

This fetches 30 days of HN stories, generates embeddings, and stores them in your Rivestack database. The first load runs in the background and takes a few minutes. Open http://localhost:8080 and start searching.