Saltar al contenido
Jev

Use Cases / rag-relevance

Jev RAG Relevance

Retrievers return near-misses. Stuffing them into the LLM wastes tokens and confuses answers.

Try a related template free on this host — 5 anonymous real-API runs with no signup — then ship the same schema with a prepaid jv_live_ key. See is Jev free? and playground.

Why Jev

Score or noul each chunk for relevance/keep-drop so compaction stays typed — not a lossy rewrite of the evidence.

How to define the decision

For each retrieved chunk, state = query + chunk text. Ask a Noul or Score for relevance / keep. Batch chunks when your worker can parallelize decide calls.

When to use Jev

  • Post-retrieve keep / truncate / drop
  • Multi-corpus routing before generation
  • High-volume RAG where most chunks are noise

When not to use Jev

  • Generating the final user-facing answer
  • Embedding / index construction itself
  • Long creative synthesis across many sources

Sample input and output

From the live tool template. Run it in the playground for a real API response — sample labels below are illustrative until you click Run.

Input

query: How do I rotate my API key?

passage: To rotate a key, open Settings > API keys, click Revoke, then Create new key.

Sample display fields

  • relevant: yes · 95%
  • relevance: direct answer · 92%

Drop low-relevance chunks before prompt assembly. Borderline scores → keep a smaller excerpt or send to a cheaper re-ranker. Never invent missing evidence.

Failure modes and human fallback

  • Upstream or network errors: retry with backoff; do not invent a decision.
  • Low confidence: route to a human queue or safer default — never auto-act on money/destructive tools.
  • Schema drift: keep a golden fixture set in CI so label changes fail the build before production.
  • Jev does not embed or index documents — only judges relevance of text you pass.
  • Final answer generation stays on a generative LLM.
  • Fail closed: if decide errors, skip the chunk or fall back to your current top-k policy.

API example

Same prepaid jv_live_ balance as tools. Output tokens are free on this host's metering model.

curl
curl https://jevtypesafe.org/api/v1/decide \
  -H "Authorization: Bearer jv_live_YOUR_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{"state":"RAG check\nQuery: How do I rotate my API key?\nPassage:\nTo rotate a key, open Settings > API keys, click Revoke, then Create new key.","questions":{"relevant":{"type":"noul","instructions":"Does this passage help answer the query?"},"relevance":{"type":"choice","instructions":"How does the passage relate to the query?","criteria":{"direct answer":"directly answers","related":"related but incomplete","tangential":"weakly related","irrelevant":"does not help"}},"supports_claim":{"type":"noul","instructions":"Does the passage support answering without inventing facts?"}}}'

FAQ

Is there a one-click tool?
Open RAG Relevance under Tools when available, or wire relevance questions to /api/v1/decide in your retriever worker.

Related use cases

Ready to build?

Free anonymous tool runs, then prepaid packs and a jv_live_ key — independent host, not affiliated with TypeSafe AI.

Jev RAG Relevance | Keep or Drop Retrieved Chunks