Built-in servicesAIDetails
Keeping prompts and answers
The full rules for ai: { keep_content: }. The common case is under
Prompts and answers in logs.
keep_content:takesprompts:andkeep:, required, andstore:.prompts:lists one or more of the app's prompts by name,answer_question, each once.keep:is a duration written out, from1dto3650d.store:is a database,mainwhen left out (a declared one, or the one an app with none has), else the app's only database. Every mistake in it isai.settings_invalid.- The field key is required
(
data.field_encryption_key_requiredatkeep_content:), since what is kept is sealed with it (Encrypted fields). - What is kept. Each
ai.generatecall of a listed prompt that a model answered, injadpo_ai_content, after its last attempt: the prompt's name, the model, when, the messages the last attempt sent, repairs included, and the text of the answer, if it had any. A refused or cut-off answer is kept too. A call with no answer (timed_out,over_budgetbefore sending,too_long,unavailable) keeps nothing, and one given back on a rerun isn't kept again. A row that can't be written makes the callunavailable, as a budget's store does.jadpo ai recordkeeps nothing. - Sealed as
healthdata. The messages, aList<ChatMessage>, and the answer, aText?, are each sealed with the field key, bound to their column and the row, as an encrypted field is. A rotation re-seals them with the sealed fields, andjadpo config rotationcounts them. - Who it was made for is the signed-in caller, a user's or a
service's record. A call made for no one (an address's, a
subscriber's, a schedule's) is kept for no one, and only
keep:ends it. - Exported and erased with them. It is kept beside their sessions,
so
store:must be the store of every entity someone signs in as (ai.settings_invalidotherwise). The person's export lists each call kept for a record of theirs that someone signs in as, underAiContent, with itsid,prompt,model,made_at,messagesandanswer, kept forkeep:sincemade_atand sent to theai:connection. Their erasure deletes it in the same statement as their sessions, and so does their record's retention. - Read nowhere else. No query, route or command reads it, so the export is its only reader, and every export is recorded (Access records).
- Deleted at
keep:. The tick deletes each call oncekeep:has passed since it was made. - Everywhere the app runs: in production, in
jadpo devand injadpo test, each test with its own database. - The personal-data report lists each kept prompt with its store and how long it is kept, and the approval review shows a change to them (The personal-data report).
- A streamed prompt can't be listed yet: its answer is read by the
route after the action has ended (
toolchain.not_built_yet).
Markdown for agents: /docs/keeping-prompts-and-answers.md.Built from Jadpo's main branch at commit 9080dc3.