Apollo Promoter AINL Module Contracts
This page documents the reusable AINL modules introduced while thinning apollo-x-bot Python prompt logic.
Apollo Promoter AINL Module Contracts
This page documents the reusable AINL modules introduced while thinning apollo-x-bot Python prompt logic.
modules/common/promoter_persona_prompt.ainl
- Frame in:
ppp_mode("post"or"reply", optional; defaults to"post")
- Env:
PROMOTER_PERSONA_PROFILE(default,fity)
- Returns:
- Persona instruction string (empty string for
default)
- Persona instruction string (empty string for
- Notes:
fityis intentionally AINL/graph-centric (concrete wiring, adapters, deterministic workflows) rather than generic “agent” hype.
modules/llm/promoter_reply_prompt_bundle.ainl
- Frame in:
prb_mode("tweet"or"thread", optional; defaults to"tweet")prb_text(source text for user prompt body)
- Returns object:
reply_system_promptreply_user_promptreply_fallback_text
- Notes:
- Applies persona instructions from
promoter_persona_prompt.ainl. - Uses
PROMOTER_CANONICAL_GITHUB_URLwhen composing fallback/link text. - Reply prompts are tuned to be concrete and opinionated (mention AINL explicitly; reference node wiring/failure modes when useful).
- Applies persona instructions from
modules/llm/promoter_process_tweet_payload.ainl
- Frame in:
ppt_tweet(tweet object from poll pipeline)
- Returns object:
payload(tweet object)reply_system_promptreply_user_promptreply_fallback_text
- Notes:
- Delegates prompt composition to
promoter_reply_prompt_bundle.ainlwithprb_mode="tweet".
- Delegates prompt composition to
modules/llm/promoter_thread_continue_payload.ainl
- Frame in:
ptc_tweets(conversation tweet array)ptc_reply_to_tweet_idptc_conversation_id
- Returns object:
tweetsreply_to_tweet_idconversation_idreply_system_promptreply_user_promptreply_fallback_text
- Notes:
- Delegates prompt composition to
promoter_reply_prompt_bundle.ainlwithprb_mode="thread".
- Delegates prompt composition to
Gateway Expectations
Python handlers should treat these prompt fields as first-class payload inputs and only use internal prompt defaults as fallback safety for non-AINL callers.
Policy Keys and Cost-Saving Behavior
- Policy KV keys:
promoter_daily_block_flagpromoter_daily_fallback_model_flagpromoter_reply_fallback_model_flagpromoter_reply_skip_target_<user_id>
- Value format:
- JSON string object with
until_tsandaction - Legacy scalar values are treated as stale and cleared by guards/cleanup
- JSON string object with
- AINL short-circuit behavior:
ainl-x-promoterchecks skip-target and fallback flags beforepromoter.gate_evalin the reply loop to avoid unnecessary calls.- Daily fallback flag causes static daily payload path and records
daily_post_fallback_model_active. - Daily block guard treats
kv.get(...).body.value = nullas not blocked; only non-empty flag values activate the defer path.
- Dashboard/ops:
GET /v1/promoter.statsincludes:policy_actions_normalized_last_24hcost_avoidance_last_24h(llm_calls_avoided,x_calls_avoided_est)
POST /v1/promoter.policy_cleanupclears stale policy flags and recordspolicy_flags_cleanup.
