Pular para o conteúdo
Jev | typesafeAPI & Playground
…

Use Cases / rag-relevance

Jev Relevância RAG

Retrievers devolvem near-misses. Enfiá-los no LLM desperdiça tokens e confunde respostas.

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 ou noul cada chunk por relevância/keep-drop para a compactação permanecer tipada — não uma reescrita com perda da evidência.

How to define the decision

Para cada chunk recuperado, state = query + texto do chunk. Peça Noul ou Score de relevância / keep. Agrupe chunks em batch se o worker puder paralelizar chamadas decide.

When to use Jev

  • Post-retrieve keep / truncate / drop
  • Roteamento multi-corpus antes da geração
  • RAG de alto volume em que a maioria dos chunks é ruído

When not to use Jev

  • Gerar a resposta final voltada ao usuário
  • Construção de embeddings / índice em si
  • Síntese criativa longa entre muitas fontes

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%

Descarte chunks de baixa relevância antes de montar o prompt. Scores limítrofes → mantenha um trecho menor ou envie a um re-ranker mais barato. Nunca invente evidência faltante.

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 não embute nem indexa documentos — só julga relevância do texto que você passa.
  • A geração da resposta final fica em um LLM generativo.
  • Fail closed: se decide falhar, pule o chunk ou volte à política top-k atual.

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

Existe uma ferramenta one-click?
Abra RAG Relevance em Tools quando disponível, ou ligue perguntas de relevância a /api/v1/decide no worker do retriever.

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.