Experimental

Not built yet. Off by default, and it can help, hurt or do nothing, so always A/B test it.

Retrieval (RAG)

Gets better as you grade. With retrieval on, the SDK adds good past decisions to a new Jev call's state as examples (few-shot). Examples are cached inside the SDK, so most calls get them with no extra network trip.

There are two sources of examples, and you can use either or both:

  • A · Automatic: your best-graded decisions with the same tags, above a score you pick.
  • B · Custom: examples you write or pin by hand.

Walkthrough

Call 1 finds examples in the cache (hit). Then a decision gets graded. Call 2 misses the cache, so the SDK fetches fresh examples from DecideDB once and saves them for the next calls.

plain requestRAG-augmented (examples, and the response to them)

Turn it on per group

Retrieval is set per group_id, so you can turn it on for one feature (say support-bot) and leave every other group untouched. Toggle it in the console under the group, or in code:

app/decidedb_client.py
from decidedb import DecideDB

decidedb = DecideDB(
    group_id="support-bot",
    retrieval={
        "mode": "automatic",     # "automatic" | "custom" | "both"
        "min_score": 0.8,        # only use graded decisions scoring at least this
        "same_tags": True,       # only examples that share this call's tags
        "max_examples": 3,
    },
)

A · Automatic examples

DecideDB picks the examples for you from decisions you already graded. A decision qualifies when it is in the same group, shares the call's tags, and its grade score is at least min_score. The highest scores win.

OptionDefaultWhat it does
modeoffautomatic, custom or both. Off means no retrieval.
min_score0.8Only graded decisions at or above this score are used.
same_tagstrueOnly use examples that share this call's tags.
max_examples3How many examples are added to each call.

B · Custom examples

Hand-pick the examples yourself: write a state and the answer you expect, or pin a real past decision. Custom examples are always included for their group, before automatic ones.

How to configure them: Custom examples.

A/B testing

The original state and the added examples are logged separately, and every call records whether retrieval was on. Compare grades with and without it before you trust it.