TypeSafe AI cookbook: line-by-line semantic search scoring 218 lines in one request

hackgoofer · x · 2026-09-17

A new take on context engineering with TypeSafe AI's Jev: selectively pick context-relevant lines instead of stuffing whole documents. The cookbook builds a semantic search over GitHub's Terms of Service in three steps — tag each line with an ID, use a Choice question to rank all 218 line IDs against a plain-language query (probabilities sum to 1, so ranking works even with no true answer), and a Noul question in the same request to detect whether the document contains an answer, with exists thresholds classifying missing vs partial matches. Includes SDK setup and a JsonCache replay mode that runs without an API key.

Original post →

More from coding & agent

coding & agent channel →