Skip to content
Jev Hub

[ Use case · Search ]

Can Jev power semantic search?

Re-rank search results by how well each one matches the query.

Updated By Jev Hub

[ TLDR ]Good fit
  • Partly. Jev can't search a catalogue on its own, but it works well as a re-ranker: once a conventional search returns 50 or so candidates, Jev scores how well each one matches the query so the best rise to the top.
  • One builder used this to search property listings from a plain-English brief.

Is Jev a fit for results?

Use Jev when:

  • Queries are written in natural language, not keywords.
  • A conventional search already produces a shortlist of candidates.
  • Each result has a short text description Jev can read.

Skip it when:

  • You need to search millions of items directly. Jev evaluates one item at a time, so narrow the list first.
  • Results are mostly images.

Which questions does Jev answer?

One request per result, 2 questions. Jev answers them in parallel.

  • How well does this listing match what the person asked for? (score. Scale: Not a match → Partly matches → Good match → Exactly what they asked for)
  • Does this listing break a hard requirement in the search, such as price, pets or number of bedrooms? (yes or no. Options: Yes, No)
ONE RESULTJEV ANSWERSHow well it matches?Breaks a must-have?YOUR CODEDrop the breakersSort by matchShow the top
One result, 2 questions, then your code. Jev answers the questions about each result in one request. Your own code reads the answers and their probabilities and decides what happens next.

What does it cost?

About 53¢ a month for 50,000 results of about 110 words each: 1.1¢ per 1,000 at list price, billed by TypeSafe AI. Adjust the numbers in the calculator.

What does TypeSafe's worked example show?

TypeSafe's cookbook builds a search over GitHub's Terms of Service. In one request it scores 218 line IDs against a plain-language query with a Choice question, and uses a yes/no (Noul) question to check whether the document contains an answer at all.

  • One request covers the whole document, so the cost is one read of the text, not one call per line.
  • The yes/no check means the search can say "not in this document" instead of returning the nearest wrong line.

Source: TypeSafe's cookbook Line-by-line search (opens in a new tab). These are the maker's own results on its chosen data; test on yours.

How do you get started?

  1. Test it in the playground. No code needed. Paste a real result into TypeSafe's playground and ask: “How well does this listing match what the person asked for?” with the options Not a match, Partly matches, Good match, Exactly what they asked for. You'll see the answer and its probability. Open the playground (opens in a new tab).
  2. Use an existing tool. We haven't found a ready-made tool for this workload yet. See what people have built: Jev Search, jevgrep: find code by asking what it does, pg-jev: ask your Postgres tables questions in plain language, or browse all community builds.
  3. Integrate it. To run it on every result automatically, call Jev from the system where your results live. The developer details below include the full request.

What have people reported?

  • Natural-language property search: 1 search for 18¢, under 20 seconds. Justine Moore, self-reported.

Self-reported figures are the author's own; we haven't reproduced them. More on the costs page.

Common questions

How do developers set it up?

The request

One request per result with all 2 questions batched over the same state, so Jev reads the state once. Keys below are the names you'll see in the response.

POST api.typesafe.ai/v1/systemone
{
  "model": "jev-latest",
  "state": "Search: \"Quiet 2-bedroom near a park, under $3,000, allows a dog\"\nListing: 2 bed / 1 bath apartment, $2,850 a month. Two blocks from Riverside Park. Top-floor unit, no shared walls. Cats only.",
  "questions": {
    "match": {
      "type": "score",
      "instructions": "How well does this listing match what the person asked for?",
      "criteria": [
        "Not a match",
        "Partly matches",
        "Good match",
        "Exactly what they asked for"
      ]
    },
    "breaks_requirement": {
      "type": "noul",
      "instructions": "Does this listing break a hard requirement in the search, such as price, pets or number of bedrooms?"
    }
  }
}

How to wire it up

  1. Run your normal search first (keyword or vector search) and keep the top 50–100 results.
  2. Send Jev the person's search plus one result at a time, and ask both questions in the same request.
  3. Drop anything with breaks_requirement ≥ 0.5, then sort the rest by the match score.
  4. Show the top results. Cache answers for popular searches so you don't pay twice.

Watch out for

  • Costs multiply: every search checks many results. Price it in the calculator with results per month, not searches per month.
  • Two-word searches give Jev little to judge. For short searches, a normal search may do just as well.

New to writing Jev questions? Read the question design guide.