khwan_prepare
Retrieve memory-enriched context before answering a message. Get coherence-gated permission and a turn token to pass when recording your response.
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 |