Patterns¶
Jev is designed to sit inside a larger program. Code owns the control flow, the arithmetic and the side effects; Jev supplies narrow judgments where the program needs to understand language. These patterns show how those pieces fit. They're adapted from TypeSafe's documentation and cookbooks, written with jev4k.
| Pattern | What it does |
|---|---|
| Speculative Fan-Out | Ask every question a code path might need in one request; code picks the relevant answers |
| Routing | Classify a request and send it to the right handler: deterministic code, an LLM, or a person |
| Composite Scoring | Score dimensions separately and combine them with weights you control |
| Verification | Check citations, extractions and tool calls, and escalate only what fails |
| Extraction | Recover exact values: code finds candidates, Jev picks; code does the arithmetic |
| Search & Ranking | Re-rank retrieved passages, find the line that answers a question, filter RAG context |
| Guardrails & Moderation | Screen LLM inputs and outputs, and moderate content, under named policies |
| Classification | Walk deep taxonomies and pick from large option sets in stages |
Principles they share¶
- Keep deterministic work in code. String matching, schema validation, counting, and date math are cheaper and more reliable in code.
- Ask narrow questions. One snap judgment per question; combine answers in code.
- One request per decision. Put the whole unit (a pair, a query and a passage, a claim and its source) in the state, and ask all of its questions together.
- Keep policy in code. Thresholds, weights and precedence are constants you can review and change without new requests.
- Always keep an "unsure" path. A confidence gate, a middle Score level, or a Noul band sends the ambiguous cases to a person or a stronger model.