The endpoint
Minimal test with curl
Start with an empty conversation — no history, no answered questions yet:Example response
Using the returned question — two patterns
NBQ returns exactly one question:{ external_id, text }. You have two ways to use it:
Pattern A — show it directly
Render
next_question.text straight to the user. Simplest integration — NBQ drives the wording entirely.Pattern B — hand it to your agent
Pass
next_question.text to your own LLM as “the next question to ask” and let your agent phrase it naturally. NBQ decides what to ask; your agent decides how.external_id to answered_question_ids on the next call so it is never repeated.
The conversation loop
After the first call, repeat this cycle for each turn:Record the answer
Update your conversation state — either append the reply to
conversation_history, or update your context summary. Send at least one of the two on every call.When
exhausted is true, next_question will be null. Your application should handle this to gracefully close or continue the conversation flow.