Getting started
Quickstart
Go from zero to live semantic search on your website in about five minutes. No search infrastructure, vector database, or crawler of your own required.
1. Create a collection
Sign in to the dashboard and create a collection from your sitemap. Hopfield discovers your pages, extracts the main content, chunks it, and generates embeddings automatically.
- Sitemap URL: usually
https://your-site.com/sitemap.xml. - Include/exclude patterns: optional globs like
/docs/**to control what gets indexed. - Schedule: re-crawl on an interval or cron so the index stays fresh.
You can also add individual pages or manual records at any time. See the indexing API.
2. Run the first ingest
Open the collection’s Ingestion tab and click Run ingest. You’ll see each URL fetched and indexed live. When it finishes, the Records tab lists every indexed document.
3. Create a public API key
Under Search → Settings, create a public API key and add your site’s origin to its allowlist. Public keys are read-only and safe to embed in client-side code.
4. Add search to your site
The fastest path is the React widget, a modal search dialog with typeahead and keyboard shortcuts:
import "@hopfield/react/styles.css";
import { Search } from "@hopfield/react";
export function SiteSearch() {
return <Search publicApiKey="hp_public_..." />;
}Not using React? The same index is available through Vue, Node, plain HTTP, or a Shopify theme snippet.
5. Query it directly (optional)
curl "https://hopfield.io/api/search/query?q=how+to+reset+password" \
-H "x-hopfield-public-api-key: hp_public_..."