library_context_prepare
Append a user turn and return a bounded semantic-paging envelope for subsequent model calls, structuring context within token limits.
Instructions
Durably append a user turn, then return the complete bounded semantic-paging envelope for the next model call. Send only the returned messages to the model.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| focus | No | ||
| event_id | No | Optional caller idempotency key for this turn. | |
| metadata | No | JSON catalog metadata or exact-match catalog filters. | |
| max_books | No | ||
| protected | No | ||
| collection | No | Optional library collection/namespace; defaults to the configured collection. | |
| importance | No | ||
| session_id | No | codex | |
| token_budget | No | ||
| user_message | Yes | ||
| system_prompt | No | ||
| strict_freshness | No | ||
| recent_token_budget | No | ||
| protected_token_budget | No |