Skip to content

Docs

Cookbook: Line-by-Line Search

Semantic search over GitHub's Terms of Service: one request ranks all 218 lines with a Choice while a Noul checks whether the document contains an answer at all, including when it should say no.
Format
Docs
Reading time
2 min
Published by
TypeSafe AI
Last verified
Sep 2026

Highlights

  • 218 tagged lines (43,980 characters) ranked in a single request, with an existence check riding along.
  • An absent answer still scored one line at 0.86 while the exists question read 0.14, showing why both thresholds are tuned.
  • Choice caps at 255 options, so longer documents need a two-pass window search.

Quickstart

python
response = client.system_one(
    state=DOCUMENT,  # 218 lines tagged "L000| ...", searched in one request
    questions={
        "where": Choice(instructions=f'Which line contains the answer to: "{query}"?',
                        criteria={line_id(i): None for i in range(len(LINES))}),
        "exists": Noul(instructions=f'Does any line address or answer: "{query}"?'),
    },
    model="jev-1.12",
)
relevance = response.answers["where"].probabilities  # one score per line id
exists = response.answers["exists"].noul  # FOUND, ABSENT = 0.7, 0.35

Watch out

The existence and line thresholds were tuned on these examples, so re-tune both on your own corpus before trusting the no-answer path.

Questions about this entry

Short answers drawn from the linked project or page.

Reactions & coverage

Posts, threads, and videos about this entry from around the web.

X: LinkedIn bookmarks search

X: 1,066 reaction videos, searchable

X: Intent-based search in a Chrome extension

X: Margin, bookmark search

From the Jev guides

Original write-ups on what this entry is for.

From the Jev AI model community

Posts from builders shipping with Jev right now.

Follow @typesafeai