khwan_prepare
Fetch memory-enriched context and coherence guidance for the incoming user message before replying, receiving an allowed indicator and turn token to record the answer.
Instructions
Pull the memory-enriched context for a turn BEFORE you answer.
Khwan builds context from memory + the brain's constitution + a coherence
gate. No model is called. Ground your reply in the returned context and
respect allowed/reason. Keep the returned turn_token and pass it
to khwan_record after you answer.
Args: input: The user's message / the turn you are about to answer.
Returns: context: ready-to-use messages (memory + constitution) to ground your reply. coherence: optional float — how coherent this turn is with the brain (may be None). allowed: whether Khwan's coherence gate permits answering. reason: why, when not allowed (else None). turn_token: opaque token — pass it verbatim to khwan_record.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |