Create a Search Function

A Search function lets you upload a collection of reference items — text, images, or both — and then query that collection by meaning. Send in a query and you get back the items from your collection that are most similar to it, ranked by how close the match is.

The workflow is simple: create a Search function → upload data → query with text or an image.

What “semantic search” actually means

Search functions in Nyckel are powered by semantic search, which is worth understanding before you start, because it behaves differently from the keyword search most people are used to.

Traditional search matches on words. If you search a help center for “can’t log in” and the relevant article is titled “Authentication troubleshooting,” keyword search misses it — none of your query words appear in the article.

Semantic search matches on meaning. Behind the scenes, Nyckel turns every item you upload — and every query you send — into a numeric representation called an embedding that captures what the item is about, not just which words it contains. Items whose embeddings sit close together in this representation are semantically related, even when they share no words.

That gives Search functions a few useful properties:

The trade-off: similarity scores are relative, not probabilities. A score of 0.82 isn’t 82% likely to be right — it’s “closer than 0.74 but further than 0.91.” You build intuition for the right cutoffs by looking at real queries against your own data.

What you’ll build

A live endpoint that, given a query, returns a ranked list of items from your reference data with similarity scores.

Total time: ~10 minutes (plus however long it takes to assemble your reference data).

1. Open the console and create a function

Go to the Nyckel console and sign in. Click New function.

2. Pick an input type

Search functions take text or image inputs, depending on what kind of collection you want to search.

3. Pick the function type

Select Search.

4. Name the function

Use a short, descriptive name that reflects what the function searches. Examples:

Click Create.

What’s different from classification and Box Detect

Search functions don’t have labels and don’t learn from corrections on individual queries. Instead:

Next

Add Reference Data — upload the items that the function will search across.