Asking questions

Ask in plain language. You get exact passages with sources, or an honest no. Both are normal results your code can branch on.

A grounded answer

r = sc.query("What is the termination notice period?")

r.not_covered          # False
for q in r.quotes:
    q.text             # the passage, word for word from your document
    q.source_id        # which document it came from
r.version              # which version of the graph answered

The honest no

t = sc.query("What does clause 99.9 say?")

t.not_covered          # True
t.quotes               # empty. Nothing invented, zero tokens spent.

not_covered is a field, not an exception. It means no supporting evidence was returned; it is not proof that no relevant passage exists. Your code decides what happens next, for example asking the user to add the missing document.

The shape your agent wants

r = sc.query(question)
if r.not_covered:
    reply = "No supporting passage returned."
else:
    reply = format_answer(r.quotes)   # passages + sources, checkable

Answers are repeatable. The same question against the same version returns the same passages, which is what makes an answer from months ago auditable today.

Next: Versions →