Перейти к содержимому
Jev | typesafeAPI & Playground
…

Use Cases / rag-relevance

Jev: релевантность RAG

Ретриверы возвращают near-miss. Запихивание в LLM тратит токены и путает ответы.

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 или noul на каждый chunk по релевантности/keep-drop — компакция остаётся типизированной, а не lossy-переписыванием доказательств.

How to define the decision

Для каждого retrieved chunk: state = query + текст chunk. Noul или Score для релевантности / keep. Батчьте chunks, если worker может параллелить decide.

When to use Jev

  • Post-retrieve keep / truncate / drop
  • Мульти-корпусная маршрутизация перед генерацией
  • Высоконагруженный RAG, где большинство chunks — шум

When not to use Jev

  • Генерация финального ответа пользователю
  • Построение embeddings / индексов само по себе
  • Длинный творческий синтез по многим источникам

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%

Отбрасывайте низкорелевантные chunks до сборки prompt. Пограничные scores → оставьте короткий excerpt или отправьте к более дешёвому re-ranker. Никогда не выдумывайте отсутствующие доказательства.

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 не эмбеддит и не индексирует документы — только судит релевантность переданного текста.
  • Финальная генерация ответа остаётся на генеративном LLM.
  • Fail closed: при ошибке decide пропустите chunk или откатитесь к текущей top-k политике.

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

Есть one-click tool?
Откройте RAG Relevance в Tools, когда доступно, или подключите вопросы релевантности к /api/v1/decide в 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 | Оставить или отбросить retrieved chunks