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:
- Paraphrase-tolerant. “Can’t sign in,” “login not working,” and “stuck on the password screen” all land near the same articles.
- Cross-lingual to a useful degree. Queries in one language can surface results written in another, depending on the model.
- Cross-modal. Because images and text can be embedded into compatible spaces, you can query an image collection with text (“a red leather chair”) or query a text collection with an image, depending on the function type.
- No labels required. Unlike classification, there’s no “right answer” to teach. The function’s quality comes from the coverage and quality of the data you upload, not from labeled training examples.
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:
support-article-searchsimilar-product-finderprior-incident-lookup
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:
- The reference data is the function. Quality comes from what you upload — coverage, granularity, freshness.
- Improvement happens by editing the data, not by reviewing predictions. Adding, removing, or re-segmenting items changes results immediately.
- No zero-shot stage. You need at least some reference data before any query returns useful results.
Next
Add Reference Data — upload the items that the function will search across.