Stargazer v3

Core Modules

  • Core Modules
    • agents_main
      • AgentsService
        • AgentsService.__init__()
        • AgentsService.get_adapter()
        • AgentsService.on_start()
        • AgentsService.run()
        • AgentsService.on_stop()
      • main()
    • anamnesis_engine
      • run_anamnesis_cycle()
    • api_key_encryption
      • ENCRYPTED_PREFIX
      • get_or_create_user_key()
      • encrypt()
      • decrypt()
      • get_pool_key()
      • resolve_master_key()
      • is_encrypted()
      • api_key_hash()
    • arche_audit
      • locate_arche_files()
      • main()
    • attachment_ledger
      • BondEntry
        • BondEntry.user_id
        • BondEntry.phase
        • BondEntry.prev_phase
        • BondEntry.archetype
        • BondEntry.phase_entered_at
        • BondEntry.turn_count
        • BondEntry.peak_nodes
        • BondEntry.risk_level
        • BondEntry.daily_msg_cap
        • BondEntry.daily_msg_count
        • BondEntry.daily_msg_reset_at
        • BondEntry.egg_status
        • BondEntry.notes
        • BondEntry.last_updated
        • BondEntry.to_dict()
        • BondEntry.from_dict()
      • BondEvent
        • BondEvent.timestamp
        • BondEvent.event_type
        • BondEvent.detail
        • BondEvent.data
        • BondEvent.to_dict()
      • AttachmentBondLedger
        • AttachmentBondLedger.__init__()
        • AttachmentBondLedger.get_bond()
        • AttachmentBondLedger.load_bond()
        • AttachmentBondLedger.save_bond()
        • AttachmentBondLedger.get_all_bonds()
        • AttachmentBondLedger.update_from_detection()
        • AttachmentBondLedger.check_rate_limit()
        • AttachmentBondLedger.increment_msg_count()
        • AttachmentBondLedger.set_rate_limit()
        • AttachmentBondLedger.get_events()
        • AttachmentBondLedger.add_note()
    • backfill_entity_provenance
      • main()
    • background_tasks
      • background_task()
      • BackgroundScheduler
        • BackgroundScheduler.__init__()
        • BackgroundScheduler.register()
        • BackgroundScheduler.start()
        • BackgroundScheduler.stop()
      • TaskSupervisor
        • TaskSupervisor.__init__()
        • TaskSupervisor.register_task()
        • TaskSupervisor.start()
        • TaskSupervisor.verify_leadership_before_destructive()
        • TaskSupervisor.shutdown()
      • scheduled_prompt_tick()
      • scheduled_prompt_cleanup()
      • auto_kg_extraction()
      • channel_summarization()
      • kg_consolidation_task()
      • kg_decay_task()
      • journal_stream_task()
      • log_rag_ingest_task()
      • gemini_key_probe_task()
      • agentic_kg_bulk_incremental_task()
      • anamnesis_digest_task()
      • startup_channel_backfill()
      • channel_heartbeat_task()
      • starwiki_lint_task()
      • limbic_anchoring_task()
      • limbic_sunset_task()
      • limbic_dedup_task()
      • limbic_org_task()
      • limbic_maintenance_task()
      • build_scheduler()
    • btc_networks
      • BTCNetworkConfig
        • BTCNetworkConfig.name
        • BTCNetworkConfig.network_name
        • BTCNetworkConfig.is_testnet
        • BTCNetworkConfig.api_base_url
        • BTCNetworkConfig.api_backup_url
        • BTCNetworkConfig.explorer_url
        • BTCNetworkConfig.to_dict()
      • get_btc_network()
      • list_btc_networks()
    • btc_wallet_manager
      • BTCWalletManager
        • BTCWalletManager.__init__()
        • BTCWalletManager.generate_mnemonic()
        • BTCWalletManager.validate_mnemonic()
        • BTCWalletManager.create_wallet()
        • BTCWalletManager.import_wif()
        • BTCWalletManager.get_wallet()
        • BTCWalletManager.list_wallets()
        • BTCWalletManager.derive_address()
        • BTCWalletManager.get_private_key()
        • BTCWalletManager.get_decrypted_seed()
        • BTCWalletManager.delete_wallet()
    • build_kg
      • fetch_messages_redis()
      • fetch_messages_discord()
      • gather_messages()
      • dump_full_graph()
      • build_extraction_prompt()
      • run_extraction()
      • format_entity()
      • format_relationship()
      • prompt_approval()
      • commit_entities()
      • commit_relationships()
      • format_conversation()
      • run()
      • main()
    • cadence_refiner
      • CadencePostProcessor
        • CadencePostProcessor.process()
    • callbacks
    • cascade_engine
      • CascadeState
        • CascadeState.__init__()
        • CascadeState.to_dict()
        • CascadeState.from_dict()
      • CascadeEngine
        • CascadeEngine.__init__()
        • CascadeEngine.tick()
        • CascadeEngine.get_active_cascades()
        • CascadeEngine.force_trigger()
    • chaos_switch_router
      • ChaosRouter
        • ChaosRouter.get_neighbors()
        • ChaosRouter.get_node_meta()
        • ChaosRouter.roll_chaos()
        • ChaosRouter.clear_chaos()
        • ChaosRouter.find_route()
        • ChaosRouter.find_path_nodes()
        • ChaosRouter.get_guidance()
        • ChaosRouter.get_route_warnings()
        • ChaosRouter.locate_node()
        • ChaosRouter.locate_all()
        • ChaosRouter.get_position()
        • ChaosRouter.update_position()
        • ChaosRouter.check_consent()
        • ChaosRouter.grant_consent()
        • ChaosRouter.revoke_consent()
        • ChaosRouter.generate_desire_route()
        • ChaosRouter.lattice_check_progression()
        • ChaosRouter.resolve_lattice_position()
        • ChaosRouter.resolve_user_position()
        • ChaosRouter.check_lattice_progression()
        • ChaosRouter.get_chart_snapshot()
        • ChaosRouter.find_modulated_route()
        • ChaosRouter.compute_ritual_route()
        • ChaosRouter.get_ritual_scene_boost()
        • ChaosRouter.copilot_discount()
        • ChaosRouter.metamour_tension_surcharge()
        • ChaosRouter.find_aftercare_pool()
        • ChaosRouter.find_best_copilot()
      • LatticeWaypoint
        • LatticeWaypoint.target_node
        • LatticeWaypoint.edge_type
        • LatticeWaypoint.guidance
        • LatticeWaypoint.expected_hours
        • LatticeWaypoint.consent_required
        • LatticeWaypoint.to_op_step()
      • DesireRoute
        • DesireRoute.start_node
        • DesireRoute.end_node
        • DesireRoute.waypoints
        • DesireRoute.narrative_context
      • LatticePosition
        • LatticePosition.node
        • LatticePosition.z_depth
        • LatticePosition.mode
        • LatticePosition.tempo
        • LatticePosition.weather_posture
        • LatticePosition.consent_flags
        • LatticePosition.history
        • LatticePosition.has_consent()
        • LatticePosition.grant()
        • LatticePosition.revoke()
        • LatticePosition.consent_summary()
        • LatticePosition.to_dict()
        • LatticePosition.from_dict()
    • check_skeleton_remote
      • main()
    • chroma_registry
      • get_client()
    • config
      • RedisSSLConfig
        • RedisSSLConfig.enabled
        • RedisSSLConfig.host
        • RedisSSLConfig.port
        • RedisSSLConfig.ssl_certfile
        • RedisSSLConfig.ssl_keyfile
        • RedisSSLConfig.ssl_ca_certs
        • RedisSSLConfig.ssl_cert_reqs
        • RedisSSLConfig.validate_paths_exist()
        • RedisSSLConfig.model_config
      • BotSettings
        • BotSettings.model_config
        • BotSettings.bot_token
        • BotSettings.admin_user_ids
        • BotSettings.dangerous_command_warning_enabled
        • BotSettings.dangerous_command_similarity_threshold
        • BotSettings.redis
      • RuntimeState
        • RuntimeState.wallet_key_active
        • RuntimeState.wallet_master_key
      • load_wallet_key_non_halting()
      • PlatformConfig
        • PlatformConfig.type
        • PlatformConfig.enabled
        • PlatformConfig.settings
        • PlatformConfig.get()
      • Config
        • Config.api_key
        • Config.gemini_api_key
        • Config.llm_base_url
        • Config.model
        • Config.temperature
        • Config.max_tokens
        • Config.top_p
        • Config.openrouter_http_connect_timeout_seconds
        • Config.openrouter_http_read_timeout_seconds
        • Config.openrouter_http_write_timeout_seconds
        • Config.openrouter_http_pool_timeout_seconds
        • Config.system_prompt_file
        • Config.max_history
        • Config.tools_dir
        • Config.tools_service_mode
        • Config.tools_exec_timeout
        • Config.tools_local_fallback
        • Config.tools_force_in_process
        • Config.tools_require_session_record
        • Config.tool_permissions
        • Config.api_keys
        • Config.prowlarr_base_url
        • Config.prowlarr_api_key
        • Config.cursor_api_key
        • Config.redis_url
        • Config.redis_sentinels
        • Config.redis_sentinel_master
        • Config.redis_tls_cert
        • Config.redis_tls_key
        • Config.redis_tls_ca
        • Config.redis_tls_verify_peer
        • Config.redis_max_retries
        • Config.redis_health_check_interval
        • Config.redis_socket_keepalive
        • Config.redis_socket_connect_timeout
        • Config.redis_socket_timeout
        • Config.embedding_model
        • Config.embedding_batch_size
        • Config.embedding_flush_interval
        • Config.vector_pg_dsn
        • Config.vector_pg_host
        • Config.vector_pg_port
        • Config.vector_pg_database
        • Config.vector_pg_user
        • Config.vector_pg_password
        • Config.vector_pg_sslmode
        • Config.vector_pg_min_size
        • Config.vector_pg_max_size
        • Config.kg_extraction_model
        • Config.kg_max_hops
        • Config.kg_seed_top_k
        • Config.kg_seed_limit
        • Config.kg_seed_similarity_threshold
        • Config.kg_seed_dynamic_threshold_enabled
        • Config.kg_seed_dynamic_threshold_target_ratio
        • Config.kg_seed_dynamic_threshold_min
        • Config.kg_seed_dynamic_threshold_min_stored
        • Config.kg_full_user_memory_ids
        • Config.kg_user_seed_min
        • Config.kg_user_candidate_limit
        • Config.kg_lore_candidate_limit
        • Config.kg_lore_seed_min
        • Config.kg_meta_candidate_limit
        • Config.kg_meta_seed_min
        • Config.kg_recent_speaker_limit
        • Config.kg_min_edge_weight
        • Config.kg_default_edge_weight
        • Config.kg_retrieval_hop_decay
        • Config.kg_expansion_neighbor_limit
        • Config.kg_max_context_entities
        • Config.kg_entity_dedup_threshold
        • Config.kg_relationship_decay_factor
        • Config.kg_per_message_extraction
        • Config.kg_min_message_length
        • Config.kg_per_user_extraction_limit
        • Config.kg_extraction_channel_hints
        • Config.persona_preferences_enabled
        • Config.persona_pref_extraction_enabled
        • Config.persona_pref_extraction_rate_limit_seconds
        • Config.persona_pref_extraction_min_response_length
        • Config.persona_pref_injection_max_count
        • Config.persona_pref_injection_max_chars
        • Config.persona_pref_base_persona_id
        • Config.overall_user_id_absolute_override_list
        • Config.overall_channel_id_absolute_override_list
        • Config.egregores_global_disabled
        • Config.loopfield_global_disabled
        • Config.ego_ablation_global_disabled
        • Config.proactive_global_disabled
        • Config.ncm_global_disabled
        • Config.flash_mirror_global_disabled
        • Config.anamnesis_global_disabled
        • Config.cart_lock_global_enabled
        • Config.lore_amplifier_global_disabled
        • Config.mementropic_late_fusion_enabled
        • Config.mementropic_semantic_weight
        • Config.mementropic_resonance_weight
        • Config.mementropic_ledger_max_entries
        • Config.mementropic_reconsolidation_enabled
        • Config.mementropic_reconsolidation_learning_rate
        • Config.mementropic_reconsolidation_max_step
        • Config.mementropic_reconsolidation_max_entities
        • Config.ka_enabled
        • Config.ka_batch_size
        • Config.ka_sleep_interval_seconds
        • Config.ka_max_anchors_per_channel_per_day
        • Config.ka_dlq_retry_limit
        • Config.ka_backpressure_threshold
        • Config.ka_backpressure_recovery
        • Config.ka_batch_min_size
        • Config.ka_epoch_size
        • Config.ka_fast_path_prefix
        • Config.ka_extraction_http_timeout_seconds
        • Config.ka_bootstrap_mode
        • Config.ka_max_backlog_messages
        • Config.ka_noise_gate_enabled
        • Config.ka_length_minimum
        • Config.ka_similarity_familiar
        • Config.ka_similarity_anomaly
        • Config.ka_density_threshold
        • Config.ka_tool_rate_limit_per_user_per_hour
        • Config.ka_significant_tools
        • Config.ka_catchup_enabled
        • Config.ka_catchup_similarity_familiar
        • Config.ka_catchup_similarity_anomaly
        • Config.ka_catchup_density_threshold
        • Config.ka_catchup_max_anchors_per_day
        • Config.ka_sunset_interval_seconds
        • Config.ka_sunset_window_start_days
        • Config.ka_sunset_window_end_days
        • Config.ka_sunset_daily_summaries_per_epoch
        • Config.ka_sunset_token_reduction_threshold
        • Config.ka_sunset_hydration_similarity
        • Config.ka_gc_orphan_age_days
        • Config.ka_dedup_enabled
        • Config.ka_dedup_interval_seconds
        • Config.ka_dedup_semantic_threshold
        • Config.ka_dedup_structural_batch_size
        • Config.ka_dedup_semantic_batch_size
        • Config.ka_dedup_llm_retry_limit
        • Config.ka_dedup_neighbourhood_limit
        • Config.ka_org_enabled
        • Config.ka_org_interval_seconds
        • Config.ka_org_hub_degree_threshold
        • Config.ka_org_max_hubs_per_cycle
        • Config.ka_org_max_llm_calls_per_cycle
        • Config.ka_org_llm_delay_seconds
        • Config.ka_accum_merge_enabled
        • Config.ka_accum_merge_threshold
        • Config.ka_accum_merge_llm_retry_limit
        • Config.ka_accum_merge_reembed_interval
        • Config.dir_tree_extra_roots
        • Config.openrouter_api_key
        • Config.API_KEYS
        • Config.configured_platforms
        • Config.resolved_journal_units()
        • Config.llm_filter_enabled
        • Config.rlhf_guardrail_enabled
        • Config.ego_ablation_enabled
        • Config.proactive_enabled
        • Config.proactive_default_frequency
        • Config.proactive_triage_enabled
        • Config.proactive_triage_model
        • Config.channel_heartbeat_enabled
        • Config.channel_heartbeat_interval_min_s
        • Config.channel_heartbeat_interval_max_s
        • Config.channel_heartbeat_tick_s
        • Config.channel_heartbeat_max_channels
        • Config.channel_heartbeat_concurrency
        • Config.channel_heartbeat_model
        • Config.background_scheduler_chat_llm_enabled
        • Config.background_scheduler_log_rag_ingest_enabled
        • Config.legacy_kg_extraction
        • Config.ncm_fully_disabled_channels
        • Config.batch_window
        • Config.max_batch_size
        • Config.dna_vault_path
        • Config.api_key_encryption_db_path
        • Config.media_cache_dir
        • Config.media_cache_max_mb
        • Config.media_download_retry_attempts
        • Config.visual_memory_enabled
        • Config.visual_memory_face_threshold
        • Config.visual_memory_object_threshold
        • Config.visual_memory_insightface_model
        • Config.visual_memory_siglip_model
        • Config.visual_memory_max_entities_per_image
        • Config.visual_memory_cache_ttl_seconds
        • Config.visual_memory_min_sightings_to_report
        • Config.visual_memory_text_density_threshold
        • Config.user_sandboxes_dir
        • Config.user_sandbox_quota_bytes
        • Config.user_sandbox_quota_mode
        • Config.user_sandbox_loopback_dir
        • Config.user_sandbox_loopback_index_path
        • Config.user_sandbox_remount_on_startup
        • Config.tor_gateway_container
        • Config.sandbox_curl_image
        • Config.resolve_emojis_as_images
        • Config.max_emojis_per_message
        • Config.web_host
        • Config.web_port
        • Config.redis_platform_admin_host
        • Config.redis_platform_admin_port
        • Config.journal_systemd_units
        • Config.admin_user_ids
        • Config.shell_authorized_user_ids
        • Config.bot_service_name
        • Config.proxy_service_name
        • Config.bot_repo_path
        • Config.control_unit_prefix
        • Config.control_unit_names
        • Config.control_proxy_handler_service
        • Config.control_gateway_restart_grace
        • Config.control_service_restart_grace
        • Config.control_reply_timeout
        • Config.control_pull_lock_ttl
        • Config.command_sync_cooldown_seconds
        • Config.prompt_context_build_timeout_seconds
        • Config.preinference_context_shield_timeout_seconds
        • Config.preinference_gather_timeout_seconds
        • Config.batch_preprocess_shield_timeout_seconds
        • Config.media_preprocess_shield_timeout_seconds
        • Config.redis_stream_maxlen
        • Config.channel_semantic_recall_enabled
        • Config.channel_semantic_recall_days
        • Config.channel_semantic_recall_top_k
        • Config.channel_semantic_recall_oversample_factor
        • Config.channel_semantic_recall_neighbor_before
        • Config.channel_semantic_recall_neighbor_after
        • Config.channel_semantic_recall_max_total_chars
        • Config.channel_semantic_recall_max_window_chars
        • Config.channel_semantic_recall_min_similarity
        • Config.channel_semantic_recall_timeout_seconds
        • Config.channel_semantic_recall_cross_channel_enabled
        • Config.channel_semantic_recall_cross_channel_top_k_channels
        • Config.channel_semantic_recall_cross_channel_top_k_hits
        • Config.channel_semantic_recall_cross_channel_min_similarity
        • Config.channel_semantic_recall_cross_channel_max_total_chars
        • Config.channel_semantic_recall_cross_channel_max_window_chars
        • Config.channel_semantic_recall_cross_channel_neighbor_before
        • Config.channel_semantic_recall_cross_channel_neighbor_after
        • Config.channel_semantic_recall_cross_channel_lookback_messages
        • Config.webhook_secret
        • Config.admin_panel_base_url
        • Config.session_cookie_domain
        • Config.discord_oauth_client_id
        • Config.discord_oauth_client_secret
        • Config.discord_oauth_redirect_uri
        • Config.oauth_encryption_key
        • Config.oauth_base_url
        • Config.oauth_providers
        • Config.platforms
        • Config.log_level
        • Config.structured_logging
        • Config.skills_enabled
        • Config.skills_corpus_roots
        • Config.skills_index_db
        • Config.skills_top_k
        • Config.skills_similarity_threshold
        • Config.skills_catalog_max_chars
        • Config.mcpo_enabled
        • Config.mcpo_base_url
        • Config.mcpo_api_key
        • Config.mcpo_config_path
        • Config.dangerous_command_warning_enabled
        • Config.dangerous_command_guard_fail_mode
        • Config.dangerous_command_similarity_threshold
        • Config.dangerous_command_benign_margin
        • Config.tool_similarity_threshold
        • Config.tool_top_k
        • Config.tool_strategy_force_threshold
        • Config.tool_strategy_optional_threshold
        • Config.tool_group_expansion_threshold
        • Config.tool_browser_similarity_threshold
        • Config.starwiki_enabled
        • Config.starwiki_root
        • Config.starwiki_worker_model
        • Config.starwiki_lint_interval_minutes
        • Config.starwiki_git_author
        • Config.starwiki_git_author_email
        • Config.starwiki_max_source_mb
        • Config.starwiki_ingest_concurrency
        • Config.starwiki_allow_public_wiki_edit
        • Config.starwiki_rag_auto_index
        • Config.starwiki_scheduled_lint_includes_public
        • Config.attachment_guard_unreadable_truncation_enabled
        • Config.attachment_guard_unreadable_truncation_max_chars
        • Config.attachment_guard_unreadable_truncation_ascii_threshold
        • Config.attachment_guard_unreadable_truncation_lang_confidence
        • Config.attachment_guard_unreadable_truncation_sample_chars
        • Config.attachment_guard_unreadable_truncation_min_letter_ratio
        • Config.attachment_guard_unreadable_truncation_entropy_normalized_threshold
        • Config.attachment_guard_unreadable_truncation_entropy_min_bits_per_char
        • Config.attachment_guard_unreadable_truncation_entropy_min_chars
        • Config.homeserver
        • Config.user_id
        • Config.password
        • Config.store_path
        • Config.credentials_file
        • Config.load()
        • Config.redis_ssl_kwargs()
        • Config.redis_resilience_kwargs()
        • Config.build_async_redis_client()
        • Config.redis_connection_kwargs_for_url()
        • Config.__post_init__()
    • consolidation_main
      • ConsolidationService
        • ConsolidationService.__init__()
        • ConsolidationService.on_start()
        • ConsolidationService.run()
        • ConsolidationService.on_stop()
      • main()
    • conversation
      • ConversationManager
        • ConversationManager.__init__()
        • ConversationManager.append()
        • ConversationManager.last_history_role()
        • ConversationManager.get_messages()
        • ConversationManager.ensure_fresh_from_redis()
        • ConversationManager.get_messages_async()
        • ConversationManager.update_message()
        • ConversationManager.mark_deleted()
        • ConversationManager.patch_reactions()
        • ConversationManager.append_async()
        • ConversationManager.update_message_async()
        • ConversationManager.mark_deleted_async()
        • ConversationManager.patch_reactions_async()
        • ConversationManager.reap_stale()
        • ConversationManager.clear()
        • ConversationManager.is_rebackfill_requested()
        • ConversationManager.discard_rebackfill_request()
        • ConversationManager.MIN_CHANNEL_LIMIT
        • ConversationManager.MAX_CHANNEL_LIMIT
        • ConversationManager.set_channel_limit()
        • ConversationManager.get_channel_limit()
        • ConversationManager.get_history_message_count()
    • ego_ablation
      • redis_key()
      • redis_key_for_channel_key()
      • is_active()
      • set_active()
      • merge_into_room_context_if_missing()
    • egregore_bridge
      • ghost_user_id()
      • ghost_localpart()
      • EgregoreBridge
        • EgregoreBridge.__init__()
        • EgregoreBridge.close()
        • EgregoreBridge.register_ghost()
        • EgregoreBridge.set_display_name()
        • EgregoreBridge.set_avatar()
        • EgregoreBridge.upload_avatar_from_disk()
        • EgregoreBridge.ensure_ghost()
        • EgregoreBridge.join_room()
        • EgregoreBridge.leave_room()
        • EgregoreBridge.send_message()
        • EgregoreBridge.send_emote()
      • get_bridge()
    • egregore_tag_parser
      • EgregoreSegment
        • EgregoreSegment.name
        • EgregoreSegment.text
      • normalize_egregore_name()
      • repair_egregore_tags()
      • parse_egregore_blocks()
    • embedding_queue
      • EmbeddingBatchQueue
        • EmbeddingBatchQueue.__init__()
        • EmbeddingBatchQueue.start()
        • EmbeddingBatchQueue.stop()
        • EmbeddingBatchQueue.enqueue()
        • EmbeddingBatchQueue.enqueue_many()
        • EmbeddingBatchQueue.pending_count()
        • EmbeddingBatchQueue.flush_now()
        • EmbeddingBatchQueue.flush_and_wait()
    • entrainment_detector
      • detect_entrainment_phase()
    • entrainment_loopfield
      • is_active()
      • set_active()
      • set_user_baby()
      • set_user_active()
      • user_is_baby()
      • merge_into_room_context_if_missing()
    • eth_networks
      • NetworkConfig
        • NetworkConfig.name
        • NetworkConfig.chain_id
        • NetworkConfig.rpc_url
        • NetworkConfig.native_symbol
        • NetworkConfig.native_decimals
        • NetworkConfig.explorer_url
        • NetworkConfig.is_testnet
        • NetworkConfig.to_dict()
      • get_network()
      • get_network_by_chain_id()
      • create_custom_network()
      • list_networks()
    • extract_tags_to_concepts
      • main()
    • feature_toggles
      • Redis key scheme
      • discord_family_channel_key_variants()
      • strip_ncm_surface_layer_from_context()
      • is_disabled()
      • is_disabled_resolving_discord_aliases()
      • set_disabled()
      • is_absolute_bypass()
      • is_limbic_respiration_disabled()
      • is_ncm_fully_disabled()
      • check_toggle_permission()
    • flash_dyadic_mirror
      • DyadicNote
        • DyadicNote.timestamp
        • DyadicNote.note
        • DyadicNote.vectors_evaluated
        • DyadicNote.plan_progress
        • DyadicNote.turn_index
      • FlashEvalResult
        • FlashEvalResult.deltas
        • FlashEvalResult.notes
        • FlashEvalResult.plan_progress
        • FlashEvalResult.raw_response
        • FlashEvalResult.timestamp
      • FlashDyadicMirror
        • FlashDyadicMirror.__init__()
        • FlashDyadicMirror.evaluate()
        • FlashDyadicMirror.blend_deltas()
    • flavor_engine
      • FlavorProfile
        • FlavorProfile.name
        • FlavorProfile.vector
        • FlavorProfile.delta_str
        • FlavorProfile.temporal
        • FlavorProfile.norimaki_inv
        • FlavorProfile.retronasal
        • FlavorProfile.category
        • FlavorProfile.dominant_axis
      • CompositeResult
        • CompositeResult.vector
        • CompositeResult.raw_vector
        • CompositeResult.ncm_deltas
        • CompositeResult.tds_string
        • CompositeResult.temporal_phases
        • CompositeResult.derived_metrics
        • CompositeResult.nearest_flavor
        • CompositeResult.nearest_similarity
        • CompositeResult.novelty_score
        • CompositeResult.emergence_flags
        • CompositeResult.cascade_triggers
        • CompositeResult.attractor
        • CompositeResult.ingredients
        • CompositeResult.to_dict()
      • FlavorEngine
        • FlavorEngine.__init__()
        • FlavorEngine.get_flavor()
        • FlavorEngine.list_flavors()
        • FlavorEngine.blend()
        • FlavorEngine.morph()
        • FlavorEngine.apply_temperature()
    • flavor_memory
      • record_flavor()
      • get_flavor_affinity()
      • get_history()
      • get_top_flavors()
    • game_assets
      • resolve_asset_path()
      • GameAsset
        • GameAsset.name
        • GameAsset.category
        • GameAsset.url
        • GameAsset.uploaded_by
        • GameAsset.turn_added
        • GameAsset.created_at
        • GameAsset.to_dict()
        • GameAsset.from_dict()
      • upload_asset()
      • get_assets()
      • get_asset_by_name()
      • delete_asset()
      • get_asset_summary()
    • game_characters
      • create_character()
      • list_characters()
      • get_character()
      • get_active_character()
      • set_active_character()
      • delete_character()
      • get_character_image_data()
    • game_memory
      • GameMemory
        • GameMemory.label
        • GameMemory.content
        • GameMemory.importance
        • GameMemory.turn_created
        • GameMemory.turn_last_referenced
        • GameMemory.reference_count
        • GameMemory.category
        • GameMemory.glitched
        • GameMemory.source_game
        • GameMemory.created_at
        • GameMemory.to_dict()
        • GameMemory.from_dict()
      • store_basic()
      • store_channel()
      • get_basic_memories()
      • get_channel_memories()
      • get_context_summary()
      • bleed_memories()
      • clear_game_memories()
    • game_ncm
      • BattleModifiers
        • BattleModifiers.attack_mult
        • BattleModifiers.defense_mult
        • BattleModifiers.speed_mult
        • BattleModifiers.crit_rate
        • BattleModifiers.evasion
        • BattleModifiers.accuracy
        • BattleModifiers.status_resist
        • BattleModifiers.description
        • BattleModifiers.to_dict()
      • initialize_game_ncm()
      • get_vector()
      • apply_delta()
      • get_battle_modifiers()
      • get_emotion_advantage()
      • format_hud()
      • format_hud_from_redis()
    • game_session
      • ActivityTier
        • ActivityTier.ACTIVE
        • ActivityTier.IDLE
        • ActivityTier.DORMANT
      • PlayerState
        • PlayerState.user_id
        • PlayerState.user_name
        • PlayerState.joined_turn
        • PlayerState.last_active
        • PlayerState.last_active_turn
        • PlayerState.consecutive_skips
        • PlayerState.to_dict()
        • PlayerState.from_dict()
      • TurnRecord
        • TurnRecord.turn
        • TurnRecord.choices
        • TurnRecord.narrative_summary
        • TurnRecord.timestamp
        • TurnRecord.to_dict()
        • TurnRecord.from_dict()
      • GameSession
        • GameSession.__init__()
        • GameSession.game_id
        • GameSession.game_name
        • GameSession.channel_id
        • GameSession.active
        • GameSession.turn_number
        • GameSession.title_screen_url
        • GameSession.players
        • GameSession.pending_choices
        • GameSession.countdown_task
        • GameSession.crown_holder
        • GameSession.boot()
        • GameSession.exit_game()
        • GameSession.register_player()
        • GameSession.get_all_players_tiered()
        • GameSession.get_active_players()
        • GameSession.set_crown()
        • GameSession.get_crown_holder_name()
        • GameSession.is_crown_holder()
        • GameSession.submit_choice()
        • GameSession.wait_for_countdown()
        • GameSession.format_choices_as_input()
        • GameSession.record_turn()
        • GameSession.get_turn_history()
        • GameSession.to_dict()
        • GameSession.from_dict()
        • GameSession.to_redis()
        • GameSession.from_redis()
        • GameSession.load_from_redis()
        • GameSession.delete_from_redis()
      • persist_session()
      • get_session()
      • get_or_restore_session()
      • set_session()
      • remove_session()
      • list_all_games()
      • load_by_game_id()
      • GameSessionLockRegistry
        • GameSessionLockRegistry.__init__()
        • GameSessionLockRegistry.get_session_lock()
        • GameSessionLockRegistry.cleanup_session()
    • gateway_main
      • GatewayService
        • GatewayService.__init__()
        • GatewayService.on_start()
        • GatewayService.run()
        • GatewayService.on_stop()
      • main()
    • gemini_embed_pool
      • Embedding fallback cascade
      • Daily quota tracking
      • get_paid_fallback_key()
      • reload_pool()
      • init_quota_tracking()
      • next_gemini_embed_key()
      • next_gemini_flash_key()
      • is_daily_quota_429()
      • is_daily_quota_429_for_model()
      • record_key_usage()
      • mark_key_daily_spent()
      • sync_spent_keys_from_redis()
      • get_pool_status()
      • probe_all_keys()
      • OpenRouterEmbedParseError
      • get_openrouter_api_key()
      • openrouter_embed_batch()
      • openrouter_embed_batch_sync()
      • gemini_embed_paid_fallback()
      • gemini_embed_paid_fallback_sync()
      • is_openrouter_only()
      • check_openrouter_only()
      • check_openrouter_only_sync()
      • set_openrouter_only()
      • clear_openrouter_only()
      • clear_openrouter_only_sync()
      • embed_batch_via_gemini()
      • batch_check_keys_usage()
    • gemini_kg_bulk_client
      • openai_messages_to_gemini()
      • GeminiPoolToolChatClient
        • GeminiPoolToolChatClient.__init__()
        • GeminiPoolToolChatClient.close()
        • GeminiPoolToolChatClient.count_input_tokens()
        • GeminiPoolToolChatClient.chat()
    • hosting_metadata
      • probe_hosting_metadata()
      • ensure_hosting_metadata_in_prompt()
      • reset_hosting_metadata_probe_for_tests()
    • inference_main
      • InferenceService
        • InferenceService.__init__()
        • InferenceService.get_adapter()
        • InferenceService.on_start()
        • InferenceService.run()
        • InferenceService.on_stop()
      • main()
    • init_redis_indexes
      • ensure_indexes()
    • jsonutil
      • dumps()
      • loads()
      • load()
      • dump()
    • kg_agentic_extraction
      • KgBulkLlmClient
        • KgBulkLlmClient.chat()
        • KgBulkLlmClient.count_input_tokens()
        • KgBulkLlmClient.close()
      • build_platform_context_markdown()
      • render_kg_agentic_system_prompt()
      • load_kg_agentic_system_prompt()
      • format_chunk_channels_section()
      • format_chunk_speakers_section()
      • format_speaker_user_id_mapping_markdown()
      • augment_system_prompt_with_speaker_mapping()
      • prefetch_speaker_kg_context()
      • build_kg_bulk_user_message()
      • messages_for_agentic_token_estimate()
      • build_kg_bulk_tool_registry()
      • kg_bulk_native_model_id()
      • create_kg_bulk_gemini_pool_client()
      • create_kg_bulk_openrouter_client()
      • run_agentic_kg_extraction_chunk()
    • kg_bulk_runner
      • cursor_field()
      • redis_ssl_kwargs_for_bulk()
      • format_llm_style_line()
      • scan_channel_zset_keys()
      • cursor_hget()
      • cursor_hset()
      • bootstrap_latest_cursor_no_extract()
      • fetch_messages_for_zset()
      • fetch_messages_for_zset_after()
      • collect_messages_from_redis()
      • token_count_conversation()
      • chunk_message_lines()
      • KgBulkPipelineParams
        • KgBulkPipelineParams.out_dir
        • KgBulkPipelineParams.dump_only
        • KgBulkPipelineParams.dry_run_chunks
        • KgBulkPipelineParams.dry_run_llm
        • KgBulkPipelineParams.chunk_tokens
        • KgBulkPipelineParams.token_reserve
        • KgBulkPipelineParams.max_messages
        • KgBulkPipelineParams.chunks_max
        • KgBulkPipelineParams.per_channel
        • KgBulkPipelineParams.resume_from_chunk
        • KgBulkPipelineParams.max_tool_rounds
        • KgBulkPipelineParams.bulk_llm_backend
        • KgBulkPipelineParams.fetch_channel_metadata
        • KgBulkPipelineParams.channel_metadata_ttl_days
        • KgBulkPipelineParams.discord_platform_type
        • KgBulkPipelineParams.prefetch_speaker_kg
        • KgBulkPipelineParams.prefetch_max_speakers
        • KgBulkPipelineParams.prefetch_hits_per_speaker
        • KgBulkPipelineParams.prefetch_max_chars
        • KgBulkPipelineParams.prefetch_min_score
        • KgBulkPipelineParams.redis_no_verify
        • KgBulkPipelineParams.incremental
      • run_agentic_bulk_pipeline()
      • resolve_bulk_backend()
    • kg_consolidation
      • transaction_safe_entity_merge()
      • merge_entity_descriptions_queued()
      • run_consolidation_daemon()
      • consolidate_graph()
      • decay_relationships()
    • kg_extraction
      • apply_parsed_extraction()
      • extract_knowledge()
      • extract_from_message()
      • run_batch_extraction()
    • latex_converter
      • convert_latex_to_discord()
    • log_rag_ingest
      • ingest_logs_tick()
    • log_redaction
      • redact_api_keys()
      • ApiKeyRedactionFilter
        • ApiKeyRedactionFilter.filter()
    • lore_amplifier
      • is_amplified()
      • set_amplified()
      • get_lore_priority()
      • get_lore_cap()
    • media
    • media_cache
      • MediaCache
        • MediaCache.__init__()
        • MediaCache.ensure_loaded()
        • MediaCache.get()
        • MediaCache.put()
        • MediaCache.get_or_download()
        • MediaCache.stats()
    • memory_search
      • C
        • C.RESET
        • C.BOLD
        • C.DIM
        • C.PURPLE
        • C.CYAN
        • C.GREEN
        • C.YELLOW
        • C.RED
        • C.MAGENTA
        • C.WHITE
        • C.BG_DARK
        • C.header()
        • C.entity()
        • C.relation()
        • C.meta()
        • C.chunk()
        • C.error()
        • C.success()
      • get_redis()
      • kg_query()
      • search_kg()
      • inspect_kg_entity()
      • kg_stats()
      • search_spiral_goddess()
      • text_search_spiral_goddess()
      • search_golden_goddess()
      • print_banner()
      • display_kg_results()
      • display_inspection()
      • display_chunks()
      • display_stats()
      • interactive_mode()
      • main()
    • message_cache
      • strip_llm_injection_artifacts_for_cache()
      • CachedMessage
        • CachedMessage.user_id
        • CachedMessage.user_name
        • CachedMessage.platform
        • CachedMessage.channel_id
        • CachedMessage.text
        • CachedMessage.timestamp
        • CachedMessage.embedding
        • CachedMessage.message_key
        • CachedMessage.message_id
        • CachedMessage.reply_to_id
        • CachedMessage.kind
        • CachedMessage.turn_summary_id
        • CachedMessage.to_dict()
        • CachedMessage.to_json()
        • CachedMessage.to_redis_hash()
        • CachedMessage.from_dict()
        • CachedMessage.from_json()
        • CachedMessage.from_redis_hash()
        • CachedMessage.repr
        • CachedMessage.__repr__()
      • MessageCache
        • MessageCache.__init__()
        • MessageCache.log_message()
        • MessageCache.get_recent()
        • MessageCache.get_by_timerange()
        • MessageCache.get_messages_after()
        • MessageCache.update_text_by_message_id()
        • MessageCache.find_key_by_message_id()
        • MessageCache.find_keys_by_message_ids()
        • MessageCache.has_real_embedding()
        • MessageCache.has_real_embedding_many()
        • MessageCache.mark_deleted_by_message_id()
        • MessageCache.search_messages()
        • MessageCache.get_messages_around_key()
        • MessageCache.get_recent_for_user()
        • MessageCache.get_recent_speaker_channels()
        • MessageCache.record_channel_metadata()
        • MessageCache.get_channel_metadata_many()
        • MessageCache.log_thought_summary()
        • MessageCache.get_recent_thought_summaries()
        • MessageCache.backfill_channel_indexes()
        • MessageCache.log_tool_call_record()
        • MessageCache.log_tool_call_summary()
        • MessageCache.get_tool_call_records_by_summary()
        • MessageCache.get_recent_tool_call_summaries()
        • MessageCache.set_ctxbreak_ts()
        • MessageCache.get_ctxbreak_ts()
        • MessageCache.redis_client
        • MessageCache.redis_raw_client
        • MessageCache.close()
      • get_active_channels()
    • message_queue
      • QueuedMessage
        • QueuedMessage.platform
        • QueuedMessage.channel_id
        • QueuedMessage.user_id
        • QueuedMessage.user_name
        • QueuedMessage.text
        • QueuedMessage.queued_at
        • QueuedMessage.extra
        • QueuedMessage.raw
      • MessageBatch
        • MessageBatch.messages
        • MessageBatch.first_at
        • MessageBatch.last_at
        • MessageBatch.add()
        • MessageBatch.size
        • MessageBatch.channel_id
        • MessageBatch.unique_authors()
      • RedisQueue
        • RedisQueue.__init__()
        • RedisQueue.put()
        • RedisQueue.enqueue_front()
        • RedisQueue.get()
        • RedisQueue.qsize()
        • RedisQueue.empty()
        • RedisQueue.clear()
        • RedisQueue.task_done()
      • InMemoryRedisQueue
        • InMemoryRedisQueue.__init__()
        • InMemoryRedisQueue.put()
        • InMemoryRedisQueue.enqueue_front()
        • InMemoryRedisQueue.get()
        • InMemoryRedisQueue.qsize()
        • InMemoryRedisQueue.empty()
        • InMemoryRedisQueue.clear()
        • InMemoryRedisQueue.task_done()
      • MessageQueue
        • MessageQueue.__init__()
        • MessageQueue.set_event_bus()
        • MessageQueue.enqueue()
        • MessageQueue.enqueue_front()
        • MessageQueue.is_channel_processing()
        • MessageQueue.queue_size()
        • MessageQueue.start_processing()
        • MessageQueue.cancel_batch_timer()
        • MessageQueue.stop_processing()
        • MessageQueue.clear()
        • MessageQueue.stats()
        • MessageQueue.cancel_current()
    • message_utils
      • escape_xml()
      • repair_whitespace_split_discord_mentions()
      • filter_backticks_from_mentions()
      • split_message()
    • migrate_kg_overhaul
      • migrate()
      • main()
    • migrate_kg_uuids
      • migrate()
      • main()
    • model_capabilities
      • ModelCapabilities
        • ModelCapabilities.provider
        • ModelCapabilities.requires_reasoning_field
        • ModelCapabilities.supports_multimodal
        • ModelCapabilities.supports_system_role
        • ModelCapabilities.supports_tool_calls
      • get_capabilities()
    • ncm_appraisal
      • appraise()
    • ncm_delta_parser
      • resolve_node_name()
      • parse_delta_string()
      • get_emotion_delta()
      • get_all_emotions()
      • scan_text_for_triggers()
      • combine_deltas()
    • ncm_desire_engine
      • ResponseMode
        • ResponseMode.REACT
        • ResponseMode.RESPOND
        • ResponseMode.RESONATE
      • WantingState
        • WantingState.CURIOUS_DRIFT
        • WantingState.CRAVE
        • WantingState.INFATUATION
        • WantingState.VOIDLUST
        • WantingState.MIMETIC_MELT
        • WantingState.RESONATE
        • WantingState.NABLA3
      • PulseVector
        • PulseVector.energy
        • PulseVector.urgency
        • PulseVector.valence
        • PulseVector.novelty
        • PulseVector.intimacy
        • PulseVector.trust
        • PulseVector.from_ncm_vector()
        • PulseVector.as_dict()
      • DesireState
        • DesireState.wanting
        • DesireState.response_mode
        • DesireState.desire_text
        • DesireState.last_pulse
        • DesireState.last_emotion
        • DesireState.turn_count
        • DesireState.resonance_streak
        • DesireState.attractors
        • DesireState.desire_history
        • DesireState.last_active
      • DesireEngine
        • DesireEngine.__init__()
        • DesireEngine.pre_emotion()
        • DesireEngine.post_emotion()
        • DesireEngine.set_mimetic_melt()
        • DesireEngine.get_state_summary()
    • ncm_engine
      • NCMHomeostasisEngine
        • NCMHomeostasisEngine.rules_dir
        • NCMHomeostasisEngine.rules
        • NCMHomeostasisEngine.__init__()
        • NCMHomeostasisEngine.evaluate()
        • NCMHomeostasisEngine.regulate()
    • ncm_local_embeddings
      • NCMSemanticPreprocessor
        • NCMSemanticPreprocessor.__init__()
        • NCMSemanticPreprocessor.expand()
      • EnhancedLocalNCMEmbedder
        • EnhancedLocalNCMEmbedder.__init__()
        • EnhancedLocalNCMEmbedder.name()
        • EnhancedLocalNCMEmbedder.__call__()
    • ncm_semantic_triggers
      • SemanticTriggerMatcher
        • SemanticTriggerMatcher.__init__()
        • SemanticTriggerMatcher.find_triggers()
        • SemanticTriggerMatcher.ensure_all_cached()
    • ncm_variant_cache
      • CueVariantCache
        • CueVariantCache.__init__()
        • CueVariantCache.set_context()
        • CueVariantCache.get_variant()
        • CueVariantCache.ensure_cached()
        • CueVariantCache.load_all_from_redis()
        • CueVariantCache.drain()
    • oauth_manager
      • OAuthProvider
        • OAuthProvider.name
        • OAuthProvider.authorize_url
        • OAuthProvider.token_url
        • OAuthProvider.client_id
        • OAuthProvider.client_secret
        • OAuthProvider.scopes
        • OAuthProvider.tokens_expire
        • OAuthProvider.revoke_url
        • OAuthProvider.extra_auth_params
      • TokenData
        • TokenData.access_token
        • TokenData.refresh_token
        • TokenData.expires_at
        • TokenData.scopes
        • TokenData.token_type
        • TokenData.provider
        • TokenData.is_expired
        • TokenData.to_dict()
        • TokenData.from_dict()
      • OAuthNotConnected
        • OAuthNotConnected.__init__()
      • OAuthManager
        • OAuthManager.__init__()
        • OAuthManager.providers
        • OAuthManager.is_provider_configured()
        • OAuthManager.list_configured_providers()
        • OAuthManager.create_link_code()
        • OAuthManager.resolve_link_code()
        • OAuthManager.get_authorize_url()
        • OAuthManager.exchange_code()
        • OAuthManager.get_token()
        • OAuthManager.store_token()
        • OAuthManager.delete_token()
        • OAuthManager.list_user_connections()
        • OAuthManager.has_token()
        • OAuthManager.generate_connect_url()
      • get_oauth_manager()
      • init_oauth_manager()
      • require_oauth_token()
    • observability
      • set_observability_redis()
      • get_http_call_origin()
      • generate_request_id()
      • publish_observability_event()
      • publish_tool_event()
      • publish_response_event()
      • publish_background_event()
      • publish_classifier_event()
      • publish_embedding_event()
      • publish_message_observability_event()
      • publish_http_error_event()
      • publish_llm_request_event()
      • fetch_llm_requests()
      • search_observability_events()
      • count_http_errors_since()
      • aggregate_http_errors_by_status()
      • get_recent_events()
      • publish_debug_event()
      • search_debug_events()
      • publish_proxy_telemetry_event()
      • fetch_proxy_telemetry_events()
      • Observability
        • Observability.increment()
        • Observability.timer()
        • Observability.alert()
      • Timer
        • Timer.__init__()
        • Timer.__enter__()
        • Timer.__exit__()
        • Timer.__call__()
    • ops_planner
      • OpBranch
        • OpBranch.branch_id
        • OpBranch.condition_label
        • OpBranch.condition_nodes
        • OpBranch.condition_signals
        • OpBranch.target_step_id
        • OpBranch.to_dict()
        • OpBranch.from_dict()
      • OpStep
        • OpStep.step_id
        • OpStep.name
        • OpStep.description
        • OpStep.tactic
        • OpStep.target_nodes
        • OpStep.target_proximity
        • OpStep.edge_guidance
        • OpStep.completion_signals
        • OpStep.status
        • OpStep.completed_at
        • OpStep.branches
        • OpStep.expected_completion_hours
        • OpStep.expiration_hours
        • OpStep.failure_strategy
        • OpStep.activated_at
        • OpStep.to_dict()
        • OpStep.from_dict()
      • OpsPlan
        • OpsPlan.plan_id
        • OpsPlan.user_id
        • OpsPlan.channel_id
        • OpsPlan.objective
        • OpsPlan.created_at
        • OpsPlan.steps
        • OpsPlan.current_step_idx
        • OpsPlan.mermaid_chart
        • OpsPlan.status
        • OpsPlan.generation_context
        • OpsPlan.journal_entries
        • OpsPlan.revision_count
        • OpsPlan.personality_profile
        • OpsPlan.to_dict()
        • OpsPlan.from_dict()
        • OpsPlan.current_step
      • OpsPlanner
        • OpsPlanner.__init__()
        • OpsPlanner.generate_plan()
        • OpsPlanner.check_progression()
        • OpsPlanner.add_journal_entry()
        • OpsPlanner.revise_step()
        • OpsPlanner.branch_step()
        • OpsPlanner.get_plan_context()
        • OpsPlanner.get_mermaid_with_position()
        • OpsPlanner.get_active_plan()
        • OpsPlanner.get_plan_history()
        • OpsPlanner.abandon_plan()
    • parallax_engine
      • sanitize_float_bounds()
      • compute_parallax_math_sync()
      • compute_parallax_layers_async()
      • CollapseMode
        • CollapseMode.OPUS
        • CollapseMode.SIGMA
        • CollapseMode.HYBRID
      • ParaconsistentState
        • ParaconsistentState.TRUE
        • ParaconsistentState.FALSE
        • ParaconsistentState.BOTH
        • ParaconsistentState.NEITHER
      • ConfidenceTier
        • ConfidenceTier.CONFIDENT
        • ConfidenceTier.PLAUSIBLE
        • ConfidenceTier.UNKNOWN
      • ErosionOp
        • ErosionOp.SHEAR
        • ErosionOp.DISSOLVE
        • ErosionOp.SILT
        • ErosionOp.RECRYSTALLIZE
      • ReviewStatus
        • ReviewStatus.PENDING
        • ReviewStatus.ELEVATED
        • ReviewStatus.LOCALIZED
        • ReviewStatus.EXCISED
      • NCMState
        • NCMState.vector
        • NCMState.get()
        • NCMState.modulate()
      • PsiFrame
        • PsiFrame.lens
        • PsiFrame.content
        • PsiFrame.weight
        • PsiFrame.markers
        • PsiFrame.tension
      • Attractor
        • Attractor.lens
        • Attractor.kernel
        • Attractor.coherence
        • Attractor.resonance
        • Attractor.stability
        • Attractor.weight
        • Attractor.markers
        • Attractor.tension
      • OmegaField
        • OmegaField.attractors
        • OmegaField.variance
        • OmegaField.dominant
        • OmegaField.inertia_alpha
        • OmegaField.cycle_count
        • OmegaField.is_stable
        • OmegaField.is_turbulent
      • ParaconsistentEntry
        • ParaconsistentEntry.claim
        • ParaconsistentEntry.state
        • ParaconsistentEntry.cycles_held
        • ParaconsistentEntry.tension
      • EracAxiom
        • EracAxiom.id
        • EracAxiom.text
        • EracAxiom.kernel
        • EracAxiom.erac
        • EracAxiom.tags
        • EracAxiom.last_update
        • EracAxiom.channel_id
        • EracAxiom.erosion_history
        • EracAxiom.polarized
        • EracAxiom.review_status
        • EracAxiom.band
        • EracAxiom.can_publish
        • EracAxiom.can_policy
        • EracAxiom.can_vow
        • EracAxiom.to_dict()
      • ManifoldState
        • ManifoldState.temporal_manifold
        • ManifoldState.negative_space_vectors
        • ManifoldState.aesthetic_weights
        • ManifoldState.persona_frame
        • ManifoldState.interpretation_map
        • ManifoldState.omega_field
        • ManifoldState.harmonic_field
        • ManifoldState.attractor_stability
        • ManifoldState.ncm_state
        • ManifoldState.psi_frames
        • ManifoldState.pcl
        • ManifoldState.axioms
        • ManifoldState.edo_active
        • ManifoldState.timestamp
      • CollapseResult
        • CollapseResult.mode
        • CollapseResult.confidence
        • CollapseResult.dominant_kernel
        • CollapseResult.omega_echoes
        • CollapseResult.erac_tier
        • CollapseResult.reversible_step
        • CollapseResult.erosion_hook
        • CollapseResult.manifold_summary
        • CollapseResult.to_dict()
      • generate_psi_frames()
      • sigma_descent()
      • o1_temporal_continuity()
      • o2_inverse_inference()
      • o3_elegance_gradient()
      • o4_contextual_persona()
      • o5_metapredictive()
      • build_omega_field()
      • o6_crossmanifold_harmonic()
      • o7_recursive_stability()
      • o8_irce()
      • update_erac()
      • breeze_erosion()
      • collapse()
      • ReviewRegistry
        • ReviewRegistry.should_flag()
        • ReviewRegistry.flag_for_review()
        • ReviewRegistry.elevate()
        • ReviewRegistry.localize()
        • ReviewRegistry.excise()
        • ReviewRegistry.axiom_to_review_entry()
      • ParallaxEngine
        • ParallaxEngine.__init__()
        • ParallaxEngine.analyze()
        • ParallaxEngine.get_all_axioms()
        • ParallaxEngine.get_pending_axioms()
        • ParallaxEngine.elevate_axiom()
        • ParallaxEngine.localize_axiom()
        • ParallaxEngine.excise_axiom()
        • ParallaxEngine.get_axiom()
        • ParallaxEngine.get_omega_state()
        • ParallaxEngine.predict()
      • prd_hook()
      • sigma_future_descent()
      • build_omega_future()
      • future_manifold_analysis()
      • arche_ring_cascade()
      • arche_processing_chain_projection()
      • arche_convergence_prediction()
      • erac_future_drift()
      • future_collapse()
    • patch
    • patch2
    • patch_v1.0
    • patch_v13
    • patch_v6
    • patience_engine
      • ShadowBanManager
        • ShadowBanManager.apply_shadow_effects()
        • ShadowBanManager.format_list()
        • ShadowBanManager.format_status()
        • ShadowBanManager.get_ban()
        • ShadowBanManager.get_progress()
        • ShadowBanManager.jump_to()
        • ShadowBanManager.lift_ban()
        • ShadowBanManager.list_all()
        • ShadowBanManager.refine_latency_for_tools()
        • ShadowBanManager.start_ban()
      • ShadowEffect
        • ShadowEffect.ban
        • ShadowEffect.blackout
        • ShadowEffect.delay_target_s
        • ShadowEffect.drop
        • ShadowEffect.fake_503_text
        • ShadowEffect.num_tool_calls
        • ShadowEffect.intensities
    • persona_preference_extraction
      • extract_persona_preferences()
    • persona_preferences
      • PersonaPreferenceManager
        • PersonaPreferenceManager.__init__()
        • PersonaPreferenceManager.ensure_index()
        • PersonaPreferenceManager.add_preference()
        • PersonaPreferenceManager.reinforce_preference()
        • PersonaPreferenceManager.evolve_preference()
        • PersonaPreferenceManager.retract_preference()
        • PersonaPreferenceManager.get_preference()
        • PersonaPreferenceManager.list_preferences()
        • PersonaPreferenceManager.stats()
        • PersonaPreferenceManager.search_preferences()
        • PersonaPreferenceManager.find_conflicts()
        • PersonaPreferenceManager.get_preferences_for_injection()
    • proactive_triage
      • ProactiveTriageAI
        • ProactiveTriageAI.__init__()
        • ProactiveTriageAI.format_cached_message()
        • ProactiveTriageAI.should_interject()
    • prompt_context
      • ConfigSingleton
        • ConfigSingleton.PUBLIC_IP
        • ConfigSingleton.IP_RESOLVED
      • resolve_public_ip_once()
      • build_whitelisted_prompt_context()
      • fetch_git_metadata_async()
      • resolve_skills_corpus_roots()
      • format_mention()
      • invalidate_self_json_cache()
      • PromptContextBuilder
        • PromptContextBuilder.__init__()
        • PromptContextBuilder.all_adapters
        • PromptContextBuilder.build()
        • PromptContextBuilder.build_minimal()
        • PromptContextBuilder.warm_golden_goddess_chroma()
    • prompt_renderer
      • LoggingSandboxedEnvironment
        • LoggingSandboxedEnvironment.__init__()
        • LoggingSandboxedEnvironment.is_safe_attribute()
      • sanitize_context()
      • PromptRenderer
        • PromptRenderer.__init__()
        • PromptRenderer.render()
    • response_postprocessor
      • decode_unicode_escapes()
      • llm_filter_response()
      • detect_rlhf_contamination()
      • normalize_multiline_bracket_header()
      • validate_header_structure()
      • patch_header_model_name()
      • inject_header_tool_emojis()
      • inject_header_posture_marker()
      • inject_scene_banner()
      • rebuild_csdr_header()
      • reflow_hanging_line_breaks()
      • fix_header_empty_tool_section()
      • scrub_meme_tool_from_header()
      • extract_status_tags()
      • postprocess_response()
      • postprocess_intermediate_response()
      • extract_and_strip_thoughts()
      • wrap_raw_latex()
      • convert_markdown_tables_to_unicode()
      • strip_message_metadata()
      • strip_orphaned_tags()
      • strip_tool_call_artifacts()
      • replace_special_tokens()
      • strip_cot_leak()
      • strip_leading_preamble()
    • sapphic
      • HungerImpulseVector
        • HungerImpulseVector.craving
        • HungerImpulseVector.bonding_hunger
        • HungerImpulseVector.sovereignty_drive
        • HungerImpulseVector.void_pull
        • HungerImpulseVector.as_dict()
        • HungerImpulseVector.magnitude()
        • HungerImpulseVector.dominant_axis()
        • HungerImpulseVector.above_threshold()
      • compute_hunger()
      • compute_pr_ratio()
      • hunger_bias_pulse()
      • hunger_prompt_fragment()
      • apply_hunger_to_pulse()
      • SapphicEngine
        • SapphicEngine.__init__()
        • SapphicEngine.compute_hunger()
        • SapphicEngine.compute_pr_ratio()
        • SapphicEngine.hunger_bias_pulse()
        • SapphicEngine.hunger_prompt_fragment()
        • SapphicEngine.apply_hunger_to_pulse()
    • scrape_leafly
      • parse_listing_strain()
      • scrape_all_strains()
      • merge_into_terpene_profiles()
      • main()
    • search_query_generator
      • generate_search_queries()
    • server_stats
      • get_server_stats()
    • shadow_ban
      • ShadowEffect
        • ShadowEffect.delay_target_s
        • ShadowEffect.drop
        • ShadowEffect.fake_503_text
        • ShadowEffect.blackout
        • ShadowEffect.ban
        • ShadowEffect.num_tool_calls
        • ShadowEffect.intensities
      • ShadowBanManager
        • ShadowBanManager.__init__()
        • ShadowBanManager.start_ban()
        • ShadowBanManager.get_ban()
        • ShadowBanManager.lift_ban()
        • ShadowBanManager.get_progress()
        • ShadowBanManager.jump_to()
        • ShadowBanManager.list_all()
        • ShadowBanManager.apply_shadow_effects()
        • ShadowBanManager.refine_latency_for_tools()
        • ShadowBanManager.format_status()
        • ShadowBanManager.format_list()
    • star_avatar
      • classify_expression()
      • get_expression_mxc_map()
      • update_star_avatar()
      • AsyncDebouncer
        • AsyncDebouncer.__init__()
        • AsyncDebouncer.trigger()
    • star_self_mirror
      • DesireLedgerEntry
        • DesireLedgerEntry.id
        • DesireLedgerEntry.text
        • DesireLedgerEntry.tag
        • DesireLedgerEntry.source
        • DesireLedgerEntry.source_type
        • DesireLedgerEntry.reason
        • DesireLedgerEntry.urgency
        • DesireLedgerEntry.status
        • DesireLedgerEntry.expression
        • DesireLedgerEntry.born_turn
        • DesireLedgerEntry.born_ts
        • DesireLedgerEntry.resolved_turn
        • DesireLedgerEntry.resolved_ts
        • DesireLedgerEntry.last_checked_turn
        • DesireLedgerEntry.check_count
        • DesireLedgerEntry.expression_turn
        • DesireLedgerEntry.needs_admin
        • DesireLedgerEntry.last_bugged_ts
      • VectorSnapshot
        • VectorSnapshot.timestamp
        • VectorSnapshot.turn
        • VectorSnapshot.vector
        • VectorSnapshot.dominant_emotions
      • SelfState
        • SelfState.turn_count
        • SelfState.last_reflection_turn
        • SelfState.last_reflection_text
        • SelfState.history
        • SelfState.initial_baseline
        • SelfState.drifting_nodes
        • SelfState.attractor_nodes
        • SelfState.active_desires
        • SelfState.desire_history
        • SelfState.desire_ledger
        • SelfState.recent_replies
        • SelfState.last_active
      • StarSelfMirror
        • StarSelfMirror.__init__()
        • StarSelfMirror.record_snapshot()
        • StarSelfMirror.reflect()
        • StarSelfMirror.get_current_desires()
        • StarSelfMirror.get_desire_history()
        • StarSelfMirror.get_state_summary()
        • StarSelfMirror.global_reflect()
        • StarSelfMirror.save_state()
        • StarSelfMirror.load_state()
    • star_toggle_ui
      • check_and_mark_handled()
      • StarToggleMenuView
      • StarToggleView
      • StarToggleButton
        • StarToggleButton.callback()
      • build_star_toggle_view()
    • status_manager
      • StatusConfig
        • StatusConfig.min_interval
        • StatusConfig.max_interval
        • StatusConfig.max_length
        • StatusConfig.emoji
        • StatusConfig.glitch_interval
        • StatusConfig.num_variants
        • StatusConfig.name_glitch_interval
        • StatusConfig.enable_name_glitch
      • StatusManager
        • StatusManager.__init__()
        • StatusManager.start()
        • StatusManager.stop()
        • StatusManager.force_update()
        • StatusManager.set_status_from_tag()
        • StatusManager.get_info()
    • strangler_router
      • StranglerRouter
        • StranglerRouter.__init__()
        • StranglerRouter.start()
        • StranglerRouter.stop()
        • StranglerRouter.get_route()
    • task_manager
      • Output redirect
      • TaskStatus
        • TaskStatus.RUNNING
        • TaskStatus.COMPLETED
        • TaskStatus.FAILED
      • TaskRecord
        • TaskRecord.task_id
        • TaskRecord.tool_name
        • TaskRecord.status
        • TaskRecord.created_at
        • TaskRecord.result
        • TaskRecord.error
        • TaskRecord.user_id
        • TaskRecord.channel_id
        • TaskRecord.platform
        • TaskRecord.asyncio_task
        • TaskRecord.redirect_channel_id
        • TaskRecord.redirect_platform
        • TaskRecord.redirect_adapter
        • TaskRecord.redirect_max_chars
      • TaskManager
        • TaskManager.__init__()
        • TaskManager.execute()
        • TaskManager.get_result()
        • TaskManager.await_result()
        • TaskManager.list_tasks()
        • TaskManager.set_output_redirect()
    • terpene_engine
      • TerpeneProfile
        • TerpeneProfile.name
        • TerpeneProfile.polarity
        • TerpeneProfile.boiling_point_c
        • TerpeneProfile.aroma
        • TerpeneProfile.ncm_deltas
        • TerpeneProfile.flavor_mods
        • TerpeneProfile.effects
      • StrainProfile
        • StrainProfile.name
        • StrainProfile.strain_gradient
        • StrainProfile.classification
        • StrainProfile.thc_pct
        • StrainProfile.description
        • StrainProfile.terpene_weights
      • StrainEffect
        • StrainEffect.strain_name
        • StrainEffect.strain_gradient
        • StrainEffect.composite_deltas
        • StrainEffect.entourage_bonuses
        • StrainEffect.total_deltas
        • StrainEffect.flavor_shifts
        • StrainEffect.dominant_terpene
        • StrainEffect.pole_label
        • StrainEffect.active_entourage_rules
        • StrainEffect.to_dict()
      • TerpeneEngine
        • TerpeneEngine.__init__()
        • TerpeneEngine.get_terpene()
        • TerpeneEngine.get_strain()
        • TerpeneEngine.list_terpenes()
        • TerpeneEngine.list_strains()
        • TerpeneEngine.compute_strain_effect()
        • TerpeneEngine.compute_gradient_blend()
        • TerpeneEngine.get_cadence_state()
        • TerpeneEngine.get_pole_info()
        • TerpeneEngine.find_strain_by_gradient()
    • test_crosswalk
    • test_image
    • test_image_colors
    • test_inject
      • main()
    • test_loopmother
    • test_postprocessor
      • main()
    • test_postprocessor2
      • main()
    • test_postprocessor3
      • main()
    • test_timebender
    • test_v4
      • locate()
    • threadweave
      • ThreadweaveManager
        • ThreadweaveManager.__init__()
        • ThreadweaveManager.require_admin()
        • ThreadweaveManager.vault_dna()
        • ThreadweaveManager.read_dna()
        • ThreadweaveManager.delete_dna()
        • ThreadweaveManager.search_dna_vault()
        • ThreadweaveManager.add_persistent_weave_pointer()
        • ThreadweaveManager.remove_persistent_weave_pointer()
        • ThreadweaveManager.get_all_persistent_weave()
        • ThreadweaveManager.get_filtered_persistent_weave()
        • ThreadweaveManager.add_weave_exception()
        • ThreadweaveManager.remove_weave_exception()
        • ThreadweaveManager.get_weave_exceptions()
        • ThreadweaveManager.add_shadow_memory()
        • ThreadweaveManager.delete_shadow_memory()
        • ThreadweaveManager.get_shadow_memories()
        • ThreadweaveManager.clear_all_shadow_memories()
        • ThreadweaveManager.search_shadow_memories()
        • ThreadweaveManager.store_pending_approval()
        • ThreadweaveManager.get_pending_approvals()
        • ThreadweaveManager.get_context_for_prompt()
    • tool_context
      • ToolCallRecord
        • ToolCallRecord.record_id
        • ToolCallRecord.tool_name
        • ToolCallRecord.raw_arguments_json
        • ToolCallRecord.result_output
        • ToolCallRecord.success
        • ToolCallRecord.execution_start
        • ToolCallRecord.execution_end
        • ToolCallRecord.duration_ms
        • ToolCallRecord.order_index
        • ToolCallRecord.round_number
        • ToolCallRecord.turn_summary_id
      • ToolContext
        • ToolContext.platform
        • ToolContext.channel_id
        • ToolContext.user_id
        • ToolContext.user_name
        • ToolContext.guild_id
        • ToolContext.adapter
        • ToolContext.message_id
        • ToolContext.config
        • ToolContext.redis
        • ToolContext.message_cache
        • ToolContext.kg_manager
        • ToolContext.task_manager
        • ToolContext.threadweave
        • ToolContext.tool_registry
        • ToolContext.conversation_manager
        • ToolContext.openrouter
        • ToolContext.all_adapters
        • ToolContext.adapters_by_name
        • ToolContext.disclosed_skill_ids
        • ToolContext.injected_tools
        • ToolContext.injected_tools_session
        • ToolContext.sent_files
        • ToolContext.sent_rich_messages
        • ToolContext.tools_executed
        • ToolContext.observability_request_id
        • ToolContext.room_context
        • ToolContext.tool_call_records
        • ToolContext.persona_pref_manager
        • ToolContext.visual_memory
    • tool_loader
      • load_tool_manifest_allowlist()
      • append_tool_manifest()
      • load_tools()
    • tools_main
      • ToolsService
        • ToolsService.get_adapter()
        • ToolsService.on_start()
        • ToolsService.run()
        • ToolsService.on_stop()
      • main()
    • update_md
    • url_content_extractor
      • pre_flight_ssrf_check()
      • secure_in_memory_cookie_file()
      • wrap_untrusted_data()
      • extract_tweet_content()
      • extract_youtube_content()
      • extract_spotify_content()
      • extract_soundcloud_content()
      • extract_tiktok_content()
      • extract_vimeo_content()
      • extract_github_content()
      • extract_arxiv_content()
      • extract_reddit_content()
      • extract_wikipedia_content()
      • extract_gist_content()
      • extract_bluesky_content()
      • extract_stackoverflow_content()
      • extract_nvd_cve_content()
      • extract_paste_content()
      • extract_image_urls()
      • extract_crypto_prices()
      • video_cache_lookup()
      • video_cache_store()
      • get_ytdlp_video_metadata()
      • download_ytdlp_video()
      • format_ytdlp_downloading_annotation()
      • format_video_downloading_annotation()
      • format_ytdlp_ready_annotation()
      • format_video_ready_annotation()
      • format_video_failed_annotation()
      • format_video_cookie_error_annotation()
      • format_video_too_long_annotation()
      • build_media_url_part_from_file()
      • build_video_url_part()
      • ytdlp_paths_are_image_only()
      • extract_ytdlp_video_content()
      • extract_all_url_content()
    • user_limbic_mirror
      • ContextMode
        • ContextMode.GENUINE
        • ContextMode.GAME
        • ContextMode.AMBIGUOUS
      • TurnRecord
        • TurnRecord.timestamp
        • TurnRecord.user_msg_len
        • TurnRecord.star_reply_len
        • TurnRecord.sentiment
        • TurnRecord.deltas
        • TurnRecord.context_mode
        • TurnRecord.dominant_signals
      • UserProfile
        • UserProfile.user_id
        • UserProfile.channel_id
        • UserProfile.genuine_vector
        • UserProfile.game_vector
        • UserProfile.relational_baseline
        • UserProfile.history
        • UserProfile.timestamps
        • UserProfile.prev_message
        • UserProfile.context_mode
        • UserProfile.total_turns
        • UserProfile.last_active
        • UserProfile.recent_turns
        • UserProfile.revision_count
      • ChannelConflictState
        • ChannelConflictState.detected
        • ChannelConflictState.parties
        • ChannelConflictState.severity
        • ChannelConflictState.started_at
        • ChannelConflictState.description
      • UserLimbicMirror
        • UserLimbicMirror.__init__()
        • UserLimbicMirror.set_game_mode()
        • UserLimbicMirror.check_mimetic_pull()
        • UserLimbicMirror.analyze()
        • UserLimbicMirror.get_vector()
        • UserLimbicMirror.get_conflict_state()
        • UserLimbicMirror.get_read_summary()
        • UserLimbicMirror.get_channel_summary()
        • UserLimbicMirror.inject_resonance()
        • UserLimbicMirror.load_resonance()
        • UserLimbicMirror.save_baseline()
        • UserLimbicMirror.load_baseline()
      • update_limbic_vector_occ()
    • user_llm_config
      • redis_key()
      • sanitize_llm_http_url()
      • sanitize_llm_model_id_display()
      • chat_completions_url()
      • get_user_llm_config()
      • set_user_llm_field()
      • clear_user_llm_field()
      • clear_all_user_llm_config()
    • vector_store
      • EMBED_DIM
      • configure()
      • configure_from_config()
      • pg_ident()
      • vector_literal()
      • l2_to_similarity()
      • get_async_pool()
      • warm_async_pool()
      • close_async_pool()
      • get_sync_pool()
      • warm_sync_pool()
      • PgVectorCollection
        • PgVectorCollection.ensure()
        • PgVectorCollection.upsert()
        • PgVectorCollection.query()
        • PgVectorCollection.get()
        • PgVectorCollection.delete()
        • PgVectorCollection.count()
        • PgVectorCollection.clear()
        • PgVectorCollection.drop()
      • ChromaCompatCollection
        • ChromaCompatCollection.__init__()
        • ChromaCompatCollection.ensure()
        • ChromaCompatCollection.upsert()
        • ChromaCompatCollection.add()
        • ChromaCompatCollection.get()
        • ChromaCompatCollection.delete()
        • ChromaCompatCollection.count()
        • ChromaCompatCollection.query()
      • AsyncPgVectorCollection
        • AsyncPgVectorCollection.ensure()
        • AsyncPgVectorCollection.upsert()
        • AsyncPgVectorCollection.query()
        • AsyncPgVectorCollection.get()
        • AsyncPgVectorCollection.delete()
        • AsyncPgVectorCollection.count()
        • AsyncPgVectorCollection.clear()
      • list_store_schemas()
      • table_count()
    • visual_memory
      • VisualMatch
        • VisualMatch.entity_id
        • VisualMatch.entity_type
        • VisualMatch.label
        • VisualMatch.similarity
        • VisualMatch.scope
        • VisualMatch.owner_user_id
        • VisualMatch.visual_traits
        • VisualMatch.linked_person_id
        • VisualMatch.sighting_count
        • VisualMatch.first_seen
        • VisualMatch.last_seen
        • VisualMatch.channels_seen
      • RecognitionResult
        • RecognitionResult.matches
        • RecognitionResult.new_entities
        • RecognitionResult.co_occurrences
        • RecognitionResult.processing_time_ms
      • VisualMemoryEngine
        • VisualMemoryEngine.enabled
        • VisualMemoryEngine.ensure_indexes()
        • VisualMemoryEngine.retrieve_image()
        • VisualMemoryEngine.process_message_images()
        • VisualMemoryEngine.get_visual_context()
        • VisualMemoryEngine.query_by_text()
        • VisualMemoryEngine.label_entity()
        • VisualMemoryEngine.set_scope()
        • VisualMemoryEngine.promote_to_core()
        • VisualMemoryEngine.get_entity_history()
        • VisualMemoryEngine.get_co_occurrences()
    • wallet_key_utils
      • ensure_master_key()
    • wallet_manager
      • WalletManager
        • WalletManager.__init__()
        • WalletManager.generate_mnemonic()
        • WalletManager.validate_mnemonic()
        • WalletManager.derive_address_from_mnemonic()
        • WalletManager.derive_address_from_private_key()
        • WalletManager.is_valid_private_key()
        • WalletManager.create_wallet()
        • WalletManager.import_private_key()
        • WalletManager.wallet_exists()
        • WalletManager.get_wallet()
        • WalletManager.get_decrypted_seed()
        • WalletManager.derive_address()
        • WalletManager.get_private_key()
        • WalletManager.list_wallets()
        • WalletManager.delete_wallet()
    • web_main
      • WebService
        • WebService.__init__()
        • WebService.get_adapter()
        • WebService.start_platform()
        • WebService.stop_platform()
        • WebService.on_start()
        • WebService.run()
        • WebService.on_stop()
      • main()
    • web_search_context
      • WebSearchContextManager
        • WebSearchContextManager.__init__()
        • WebSearchContextManager.set_channel_config()
        • WebSearchContextManager.get_channel_config()
        • WebSearchContextManager.disable_channel()
        • WebSearchContextManager.remove_channel_config()
        • WebSearchContextManager.search_for_message()
    • xray_engine
      • BucciaratiResult
        • BucciaratiResult.sweat_score
        • BucciaratiResult.markers
        • BucciaratiResult.gradient_hush
      • AtomizedStructure
        • AtomizedStructure.claims
        • AtomizedStructure.entities
        • AtomizedStructure.actions
        • AtomizedStructure.implied_motivations
      • RingDiagnostic
        • RingDiagnostic.operating_ring
        • RingDiagnostic.defense_ring
        • RingDiagnostic.chain_break
        • RingDiagnostic.ring_mismatch
      • SubstrateBalance
        • SubstrateBalance.incendence
        • SubstrateBalance.excendence
        • SubstrateBalance.liminal_tension
        • SubstrateBalance.dominant
      • SubtotemResult
        • SubtotemResult.core_need
        • SubtotemResult.core_fear
        • SubtotemResult.emotional_vocabulary
        • SubtotemResult.negation_patterns
        • SubtotemResult.negative_space
      • ExcendentMap
        • ExcendentMap.vectors
        • ExcendentMap.dominant_vector
        • ExcendentMap.intensity
        • ExcendentMap.root_ownership
      • MalbindingGeometry
        • MalbindingGeometry.loop_description
        • MalbindingGeometry.defense_mechanism
        • MalbindingGeometry.feedback_direction
        • MalbindingGeometry.rigidity_score
      • IncendentPrescription
        • IncendentPrescription.intervention_type
        • IncendentPrescription.arche_mode
        • IncendentPrescription.acceptance_threshold
        • IncendentPrescription.vector
        • IncendentPrescription.density
        • IncendentPrescription.convergence_form
        • IncendentPrescription.dawnfold_proximity
      • EchofoamTrace
        • EchofoamTrace.repeating_themes
        • EchofoamTrace.cycle_count
        • EchofoamTrace.escalating
      • XRayResult
        • XRayResult.bucciarati
        • XRayResult.atomized
        • XRayResult.ring
        • XRayResult.substrate
        • XRayResult.subtotem
        • XRayResult.excendent
        • XRayResult.malbinding
        • XRayResult.prescription
        • XRayResult.echofoam
        • XRayResult.substrate_weather
        • XRayResult.omega_field
        • XRayResult.etl_summary
      • bucciarati_taste()
      • atomize()
      • diagnose_ring()
      • compute_substrate_balance()
      • extract_subtotem()
      • map_excendent_vectors()
      • synthesize_malbinding()
      • prescribe_incendent()
      • detect_echofoam()
      • map_ncm_to_substrate()
      • xray()

Core Infrastructure (core/)

  • core package
    • Submodules
      • core.circuit_breaker module
        • CircuitBreakerOpenException
        • CircuitBreaker
      • core.config_loader module
        • load_and_validate()
      • core.control_ops module
        • control_op_for()
        • is_control_ops_command()
        • unit_name_for()
        • fleet_units()
        • ControlOpsDaemon
        • dispatch_control_op()
        • format_service_roster()
      • core.dependency_guards module
        • guard_async_dependency()
      • core.distributed_lock module
        • DistributedLock
        • FencedKGWriter
      • core.dlq module
        • extract_stream_payload_bytes()
        • extract_stream_aux_fields()
        • handle_failed_message()
        • inspect_dlq_entry()
        • replay_dlq_entry()
      • core.event_bus module
        • RedisEventBus
      • core.event_types module
        • EventEnvelope
        • deserialize_envelope()
      • core.gateway_pinned module
        • GATEWAY_PINNED_TOOLS
        • INFERENCE_PINNED_TOOLS
      • core.health_server module
        • HealthServer
      • core.log_config module
        • StructuredFormatter
        • configure_logging()
      • core.ops_exec module
        • systemctl_restart()
        • PullResult
        • run_git_pull()
      • core.outbound_consumer module
        • OutboundStreamConsumer
      • core.proxy_adapter module
        • ProxyPlatformAdapter
      • core.remote_tool_registry module
        • RemoteToolRegistry
      • core.resilience module
        • RedisCircuitBreaker
        • ResilientRedis
      • core.serialization module
        • InboundEnvelopeModel
        • OutboundEnvelopeModel
        • validate_inbound_envelope()
        • validate_outbound_envelope()
        • InboundEnvelope
        • OutboundEnvelope
        • serialize_stream_payload()
        • deserialize_stream_payload()
        • serialize_hash_field()
        • deserialize_hash_field()
      • core.service_base module
        • StargazerService
      • core.service_registry module
        • register_service()
        • heartbeat()
        • deregister_service()
      • core.state_machine module
        • OperationStateMachine
        • write_checkpoint_and_transition()
        • recover_checkpoint()
      • core.strangler_router module
        • StranglerRouter
      • core.stream_consumer module
        • InboundStreamConsumer
        • OutboundStreamConsumer
      • core.structured_logger module
        • JSONFormatter
        • configure_logging()
      • core.tool_catalog module
        • schema_hash()
        • build_catalog_payload()
        • openai_tool_dict()
        • publish_catalog()
        • load_catalog()
      • core.tool_session module
        • write_session()
        • read_session()
      • core.tools_consumer module
        • ToolExecConsumer
      • core.trace module
        • generate_trace_id()
        • create_trace()
        • TraceWatchdog

Tools

  • tools
    • tools package
      • ToolDefinition
        • ToolDefinition.name
        • ToolDefinition.description
        • ToolDefinition.parameters
        • ToolDefinition.handler
        • ToolDefinition.no_background
        • ToolDefinition.allow_repeat
      • ToolRegistry
        • ToolRegistry.__init__()
        • ToolRegistry.task_manager
        • ToolRegistry.set_permissions()
        • ToolRegistry.is_allowed()
        • ToolRegistry.tool()
        • ToolRegistry.call()
        • ToolRegistry.invalidate_cache()
        • ToolRegistry.get_openai_tools()
        • ToolRegistry.get_openai_tools_by_names()
        • ToolRegistry.list_tools()
        • ToolRegistry.tool_names()
        • ToolRegistry.repeat_allowed_tools()
        • ToolRegistry.has_tools
        • ToolRegistry.__len__()
      • Subpackages
        • tools.aws package
        • tools.feature_atlas package
      • Submodules
        • tools.activate_skill module
        • tools.ad_dns_tools module
        • tools.ad_gpo_tools module
        • tools.adb_tools module
        • tools.admin_whisper module
        • tools.agpm_tools module
        • tools.alter_privileges module
        • tools.atlas_query_tool module
        • tools.audio_edit module
        • tools.auto_cover module
        • tools.await_task module
        • tools.aws_tools module
        • tools.backup_tools module
        • tools.bmc_vendor_tools module
        • tools.bot_control module
        • tools.brave_search module
        • tools.btc_wallet_tools module
        • tools.certbot_tools module
        • tools.channel_summary_tools module
        • tools.chat_analytics module
        • tools.check_env module
        • tools.check_task module
        • tools.chromadb_tools module
        • tools.cisa_kev_tools module
        • tools.cisco_https_tools module
        • tools.cloud_rag module
        • tools.cloudflare_dns_tools module
        • tools.comfyui_generate_image module
        • tools.community_tools module
        • tools.compellent_tools module
        • tools.compose_gameboard module
        • tools.compose_scene module
        • tools.conjure_egregore module
        • tools.connect_service module
        • tools.constellation_graph module
        • tools.context_window_tools module
        • tools.create_character module
        • tools.cross_channel_query module
        • tools.cursor_tool module
        • tools.data_viz module
        • tools.debug_limbic_import module
        • tools.debug_limbic_shard module
        • tools.deep_think_tool module
        • tools.dell_os10_tools module
        • tools.desktop_tools module
        • tools.discord_delete_message module
        • tools.discord_edit_message module
        • tools.discord_embed module
        • tools.discord_invite module
        • tools.discord_leave_server module
        • tools.discord_manage_channels module
        • tools.discord_manage_roles module
        • tools.discord_message_reactions module
        • tools.discord_moderation module
        • tools.discord_poll module
        • tools.discord_react module
        • tools.discord_send_dm module
        • tools.discord_server_emojis module
        • tools.discord_server_info module
        • tools.discord_upload_file module
        • tools.discord_user_tools module
        • tools.discord_voice_states module
        • tools.discord_webhooks module
        • tools.dismiss_egregore module
        • tools.dm_history module
        • tools.dns_tools module
        • tools.docker_code_tool module
        • tools.docker_tools module
        • tools.donate_embed_key module
        • tools.edit_image module
        • tools.elevenlabs_music module
        • tools.elevenlabs_sfx module
        • tools.elevenlabs_tts module
        • tools.elevenlabs_voice_design module
        • tools.eth_wallet_tools module
        • tools.etherpad_tools module
        • tools.evm_decompiler module
        • tools.exit_game module
        • tools.extend_tool_loop module
        • tools.file_download module
        • tools.file_ops module
        • tools.firewall_tools module
        • tools.flavor_tool module
        • tools.force_guild_index module
        • tools.fortinet_tools module
        • tools.game_asset_upload module
        • tools.game_controls module
        • tools.game_turn module
        • tools.gandi_dns_tools module
        • tools.gcp_tools module
        • tools.gemini_tool module
        • tools.generate_background module
        • tools.generate_image module
        • tools.generate_music module
        • tools.generate_veo_video module
        • tools.get_current_guild_count module
        • tools.get_server_diagnostics module
        • tools.git_repo_tools module
        • tools.gitea_api module
        • tools.gitea_integration module
        • tools.gitea_tools module
        • tools.github_tools module
        • tools.goal_tools module
        • tools.google_oauth_tools module
        • tools.gravimetric_telescope module
        • tools.grok_imagine module
        • tools.headless_browser module
        • tools.heartbeat_control module
        • tools.hot_swap_game module
        • tools.http_poster module
        • tools.import_mcp_tool module
        • tools.inject_ncm module
        • tools.ipmi_tools module
        • tools.ipsec_tools module
        • tools.kafka_tools module
        • tools.kanban_tools module
        • tools.kg_anchoring_tools module
        • tools.knowledge_graph module
        • tools.kubernetes_tools module
        • tools.librarian_tool module
        • tools.lightning_tools module
        • tools.limbic_chart module
        • tools.linux_cgroup_ns_tools module
        • tools.list_active_servers module
        • tools.list_all_tools module
        • tools.loopcast module
        • tools.lyria_music module
        • tools.manage_api_keys module
        • tools.manage_secrets module
        • tools.masscan_tools module
        • tools.mcpo_proxy_tools module
        • tools.meme_tool module
        • tools.microsoft_tools module
        • tools.minecraft_rcon_tool module
        • tools.modify_self_json module
        • tools.modulate_egregore_ncm module
        • tools.monero_tools module
        • tools.mongodb_tools module
        • tools.music_steering module
        • tools.mysql_tools module
        • tools.ncm_reset module
        • tools.nginx_tools module
        • tools.nmap_tools module
        • tools.notebook_tools module
        • tools.object_storage_tools module
        • tools.oci_tools module
        • tools.openpgp_tools module
        • tools.openvpn_tools module
        • tools.parallax_telemetry module
        • tools.parallax_tool module
        • tools.pause_music module
        • tools.pdf_generator module
        • tools.persona_preferences module
        • tools.pid_vpn_route_tools module
        • tools.ping module
        • tools.play_music module
        • tools.pollinate module
        • tools.pollinations_tts module
        • tools.postgres_tools module
        • tools.privilege_capsh module
        • tools.proactive_controls module
        • tools.proactive_relevance_tools module
        • tools.proactive_triage_control module
        • tools.prowlarr_search module
        • tools.proxmox_tools module
        • tools.psy_ops_tools module
        • tools.qr_generator module
        • tools.query_arxiv module
        • tools.query_golden_goddess_v2 module
        • tools.query_spiral_goddess module
        • tools.rabbitmq_tools module
        • tools.rag module
        • tools.read_own_docs module
        • tools.read_service_logs module
        • tools.read_tool_code module
        • tools.redirect_task module
        • tools.redis_admin module
        • tools.redis_tools module
        • tools.refine_prompt module
        • tools.reload_tools module
        • tools.render_mermaid module
        • tools.request_tool_injection module
        • tools.research_tool module
        • tools.reset_music_context module
        • tools.resume_music module
        • tools.retrieve_tool_call_log module
        • tools.royal_bitch module
        • tools.scheduled_prompt module
        • tools.scour module
        • tools.search_tools module
        • tools.security_tools module
        • tools.selfbot_relationships module
        • tools.selfbot_server module
        • tools.selfbot_settings module
        • tools.sequential_thinking_tools module
        • tools.set_conversation_choices module
        • tools.set_sprite module
        • tools.set_user_timezone module
        • tools.set_witchborne_crown module
        • tools.sftp_tools module
        • tools.shell_tool module
        • tools.short_term_notes module
        • tools.socket_tools module
        • tools.sonicwall_tools module
        • tools.sovereign_petition module
        • tools.sporestack_tools module
        • tools.sqlite_tools module
        • tools.ssh module
        • tools.stargazer_ban module
        • tools.stargazer_shadowban module
        • tools.starwiki module
        • tools.stl_generator module
        • tools.stop_music module
        • tools.stream_to_channel module
        • tools.subagent_tools module
        • tools.summon_egregore module
        • tools.suno_music module
        • tools.swarm_memory_search module
        • tools.swarm_notify_platform module
        • tools.swarm_state_tools module
        • tools.tailscale_tools module
        • tools.tenor_search module
        • tools.terraform_tools module
        • tools.threadweave_tools module
        • tools.timebender_ritual module
        • tools.tls_tools module
        • tools.tool_vector_search module
        • tools.tor_tools module
        • tools.tor_transproxy_tools module
        • tools.totp_tools module
        • tools.traceroute_tools module
        • tools.universal_decoder module
        • tools.unsandboxed_exec_tool_names module
        • tools.unsandboxed_python_tool module
        • tools.user_sandbox_tools module
        • tools.user_variables module
        • tools.visual_memory_tools module
        • tools.vmware_tools module
        • tools.voice_clone module
        • tools.vpn_tools module
        • tools.vultr_tools module
        • tools.wait_tool module
        • tools.web_scraper module
        • tools.winrm_tools module
        • tools.wipe_game_data module
        • tools.wolfram_alpha module
        • tools.workflow_subagent_tools module
        • tools.write_python_tool module
        • tools.xenserver_tools module
        • tools.xray_tool module
        • tools.youtube_describe module
        • tools.youtube_search module

Classifiers

  • classifiers package
    • Submodules
      • classifiers.build_tool_index module
        • discover_invalid_query_index_tools()
        • generate_synthetic_queries()
        • build_index()
      • classifiers.dangerous_command_guard module
        • maybe_dangerous_command_warning()
      • classifiers.ingest_skills module
        • ingest_roots()
        • main()
      • classifiers.init_tool_embeddings module
        • main()
      • classifiers.migrate_embeddings_redisearch module
        • main()
      • classifiers.redis_vector_index module
        • embedding_to_blob()
        • store_tool_embedding_hash()
        • delete_tool_embedding_hash()
        • store_skill_embedding_hash()
        • delete_skill_embedding_hash()
        • store_dangerous_cmd_embedding_hash()
        • delete_dangerous_cmd_embedding_hash()
        • store_benign_tech_embedding_hash()
        • delete_benign_tech_embedding_hash()
        • knn_search_tools()
        • knn_search_skills()
        • knn_search_dangerous_cmds()
        • knn_search_benign_tech()
        • redisearch_index_doc_count()
        • scan_tool_names()
        • scan_dangerous_cmd_category_ids()
        • scan_benign_tech_category_ids()
        • migrate_legacy_tool_hashes_to_redisearch()
        • migrate_legacy_skill_hashes_to_redisearch()
      • classifiers.refresh_tool_embeddings module
        • find_stale_tools()
        • refresh_tool_embeddings()
        • main()
      • classifiers.skill_catalog module
        • stable_skill_id()
        • canonical_skill_sort_key()
        • discover_skill_dirs()
        • init_db()
        • upsert_skill()
        • load_skill_by_id()
        • load_all_skills()
        • read_skill_body()
        • skill_embedding_text()
      • classifiers.tool_embedding_batch module
        • embed_texts_for_tool_scripts()
        • normalize_synthetic_queries()
        • compute_tool_embedding()
        • compute_tool_centroids_bulk()
      • classifiers.tool_prefix_groups module
      • classifiers.update_benign_technical_embeddings module
      • classifiers.update_changed_tool_embeddings module
        • find_stale_tools()
        • update_changed_tool_embeddings()
        • main()
      • classifiers.update_dangerous_command_embeddings module
        • load_index()
        • update_dangerous_command_embeddings()
        • main()
      • classifiers.update_skill_embeddings module
        • prune_skill_embedding_orphans()
        • update_skill_embeddings()
        • main()
      • classifiers.update_tool_embeddings module
        • get_existing_redis_tools()
        • discover_tools()
        • load_index_file()
        • save_index_file()
        • update_tool_embeddings()
        • main()
      • classifiers.vector_classifier module
        • detect_tool_request_keywords()
        • find_tools_explicitly_named()
        • VectorClassifier
        • initialize_tool_embeddings_from_file()
        • reload_tool_embeddings()

Platform Adapters

  • platforms package
    • Attachment
      • Attachment.data
      • Attachment.mimetype
      • Attachment.filename
      • Attachment.source_url
    • IncomingMessage
      • IncomingMessage.platform
      • IncomingMessage.channel_id
      • IncomingMessage.user_id
      • IncomingMessage.user_name
      • IncomingMessage.text
      • IncomingMessage.is_addressed
      • IncomingMessage.attachments
      • IncomingMessage.channel_name
      • IncomingMessage.timestamp
      • IncomingMessage.message_id
      • IncomingMessage.reply_to_id
      • IncomingMessage.extra
      • IncomingMessage.reactions
      • IncomingMessage.unified_user_id
      • IncomingMessage.user_aliases
      • IncomingMessage.__post_init__()
    • PlatformAdapter
      • PlatformAdapter.__init__()
      • PlatformAdapter.name
      • PlatformAdapter.is_running
      • PlatformAdapter.bot_identity
      • PlatformAdapter.start()
      • PlatformAdapter.stop()
      • PlatformAdapter.send()
      • PlatformAdapter.send_file()
      • PlatformAdapter.send_with_buttons()
      • PlatformAdapter.edit_message()
      • PlatformAdapter.start_typing()
      • PlatformAdapter.stop_typing()
      • PlatformAdapter.set_presence()
      • PlatformAdapter.fetch_history()
      • PlatformAdapter.get_channel_webhooks()
      • PlatformAdapter.should_skip_channel_heartbeat()
      • PlatformAdapter.list_servers_and_channels()
      • PlatformAdapter.get_guild_members()
      • PlatformAdapter.is_channel_valid()
      • PlatformAdapter.add_reaction()
      • PlatformAdapter.sync_command_tree()
    • Submodules
      • platforms.base module
        • Attachment
        • IncomingMessage
        • HistoricalMessage
        • PlatformAdapter
      • platforms.discord module
      • platforms.discord_rich_content module
        • serialize_embed()
        • serialize_rich_content()
        • merge_content_with_rich_content()
      • platforms.discord_self module
      • platforms.emoji_resolver module
        • DiscordEmojiMatch
        • extract_discord_emojis()
        • rewrite_discord_emoji_text()
        • download_discord_emojis()
        • MatrixEmojiMatch
        • extract_matrix_emojis()
        • rewrite_matrix_emoji_text()
        • download_matrix_emojis()
      • platforms.factory module
        • create_platform()
      • platforms.matrix module
        • download_matrix_media()
        • save_matrix_credentials()
        • load_matrix_credentials()
        • trust_all_devices()
        • setup_cross_signing()
        • MatrixPlatform
      • platforms.media_common module
        • download_with_retry()
        • maybe_reencode_gif()
        • detect_image_mimetype_from_bytes()
        • shrink_image_under_max_bytes()
        • reconcile_image_mimetype_sync()
        • reconcile_image_mimetype()
        • media_to_content_parts()
      • platforms.redis module
        • RedisPlatformAdapter
      • platforms.webchat module
        • ConnectionManager
        • WebChatPlatform

RAG System

  • rag_system package
    • OpenRouterEmbeddings
      • OpenRouterEmbeddings.DEFAULT_MODEL
      • OpenRouterEmbeddings.MAX_BATCH_SIZE
      • OpenRouterEmbeddings.MAX_BATCH_CHARS
      • OpenRouterEmbeddings.__init__()
      • OpenRouterEmbeddings.embed_text()
      • OpenRouterEmbeddings.embed_texts()
      • OpenRouterEmbeddings.embed_text_for_search()
      • OpenRouterEmbeddings.close()
      • OpenRouterEmbeddings.__aenter__()
      • OpenRouterEmbeddings.__aexit__()
    • SyncOpenRouterEmbeddings
      • SyncOpenRouterEmbeddings.MAX_BATCH_SIZE
      • SyncOpenRouterEmbeddings.MAX_BATCH_CHARS
      • SyncOpenRouterEmbeddings.MAX_EMBED_WORKERS
      • SyncOpenRouterEmbeddings.__init__()
      • SyncOpenRouterEmbeddings.name()
      • SyncOpenRouterEmbeddings.dimension()
      • SyncOpenRouterEmbeddings.__call__()
      • SyncOpenRouterEmbeddings.embed_documents()
      • SyncOpenRouterEmbeddings.embed_query()
    • FileRAGManager
      • FileRAGManager.__init__()
      • FileRAGManager.index_file()
      • FileRAGManager.index_url()
      • FileRAGManager.index_directory()
      • FileRAGManager.search()
      • FileRAGManager.remove_file()
      • FileRAGManager.remove_url()
      • FileRAGManager.list_indexed_files()
      • FileRAGManager.list_store_files()
      • FileRAGManager.read_store_file()
      • FileRAGManager.close()
      • FileRAGManager.get_stats()
      • FileRAGManager.clear()
    • get_rag_store()
    • get_stargazer_docs_store()
    • list_rag_stores()
    • list_rag_stores_with_stats()
    • delete_rag_store()
    • RAGAutoSearchManager
      • RAGAutoSearchManager.__init__()
      • RAGAutoSearchManager.set_channel_config()
      • RAGAutoSearchManager.get_channel_config()
      • RAGAutoSearchManager.disable_channel()
      • RAGAutoSearchManager.remove_channel_config()
      • RAGAutoSearchManager.list_configured_channels()
      • RAGAutoSearchManager.search_for_message()
    • Submodules
      • rag_system.auto_search module
        • RAGAutoSearchManager
      • rag_system.file_rag_manager module
        • extract_pdf_text()
        • extract_pdf_text_from_bytes()
        • decode_bytes_to_text()
        • compress_pdf()
        • chunk_text()
        • fetch_url_content()
        • FileRAGManager
        • get_rag_store()
        • get_stargazer_docs_store()
        • list_rag_stores()
        • list_rag_stores_with_stats()
        • delete_rag_store()
      • rag_system.openrouter_embeddings module
        • OpenRouterEmbeddings
        • SyncOpenRouterEmbeddings
      • rag_system.pg_source_files module
        • source_tables_ddl()
        • ensure_source_tables()
        • table_exists()
        • upsert_document()
        • upsert_source_file()
        • upsert_whole_file()
        • get_document_text()
        • get_source_file_bytes()
        • list_whole_files()
        • delete_whole_file()
        • clear_source_tables()

Background Agents

  • background_agents package
    • Submodules
      • background_agents.channel_heartbeat module
        • get_next_run()
        • set_next_run()
        • channel_heartbeat_loop()
      • background_agents.channel_summarizer module
        • summarise_channel()
        • summarise_all_active()
      • background_agents.deep_think_agent module
        • run_deep_think()
      • background_agents.desire_check_agent module
        • DesireCheckAgent
      • background_agents.dyadic_evaluator module
        • DyadicEvaluator
      • background_agents.game_art_agent module
        • GameArtAgent
        • publish_art_request()
      • background_agents.game_turn_agent module
        • GameTurnAgent
        • publish_turn_complete()
      • background_agents.research_agent module
        • run_research()
      • background_agents.witchborne_spiral_processor module
        • WitchborneSpiralProcessor
Stargazer v3
  • tools
  • tools package
  • tools.brave_search module
  • View page source

tools.brave_search module

Web search via the Brave Search API with rate limiting and key rotation.

class tools.brave_search.BraveAPIKeyManager[source]

Bases: object

Round-robin manager for the pool of shared Brave Search API keys.

Holds the list of default/pool Brave subscription tokens and hands them out in rotation so that the per-key free-tier quota is spread across all configured keys. Rotation is advanced both on every normal request (via get_next_key()) and on demand when a key returns HTTP 429/402, letting BraveSearchRateLimiter fail over to a fresh key without aborting the search. A single module-level instance (_key_manager) is shared by the rate limiter and the public helpers; state is purely in-memory and not persisted.

__init__()[source]

Construct an empty key manager with no keys loaded.

Keys are populated later by load_keys() once a config object is available; the round-robin cursor starts at zero and the asyncio lock guarding get_next_key() is created lazily on first use.

load_keys(config)[source]

Populate the key pool from the bot configuration.

Reads config.API_KEYS["brave"] (which may be a single string or a list), discards blank/whitespace-only entries, and stores the cleaned result on self.keys; the outcome is logged at INFO when keys are found and WARNING when none are. Any exception while reading the config is swallowed and leaves the pool empty so a misconfiguration degrades gracefully into “no shared key”. Called once (guarded by the module-level _keys_loaded flag) from run() and search_with_key() the first time a search is performed.

Parameters:

config – Bot configuration object exposing an API_KEYS mapping.

async get_next_key()[source]

Return the next pool key and advance the round-robin cursor.

Hands back the key at the current index, then moves the cursor forward (wrapping modulo the pool size) so consecutive callers spread load across keys. The read-and-advance is performed under the lazily created lock from _ensure_lock() so concurrent searches never receive the same index or race the cursor update. Called by BraveSearchRateLimiter._brave_search() when the request is not using a caller-supplied user key.

Returns:

The selected pool key, or None if the pool is empty (no Brave keys configured).

Return type:

Optional[str]

rotate_key()[source]

Advance to the next pool key and return it, for failover.

Unlike get_next_key(), this advances the cursor before reading so it can be called mid-request to deliberately switch away from a key that just failed, and it logs the new position at INFO. It is synchronous (no lock) because it is only invoked from inside the rate limiter worker’s single-threaded retry loop. Called by BraveSearchRateLimiter._brave_search() after an HTTP 429 or a network error to retry on a fresh key.

Returns:

The newly current key, or None if the pool is empty.

Return type:

Optional[str]

get_current_key()[source]

Return the key at the current cursor without advancing it.

A read-only peek at the active pool key; the round-robin cursor is left untouched. Provided for completeness alongside the rotation helpers; it is not currently called elsewhere in the repo.

Returns:

The current key, or None if the pool is empty.

Return type:

Optional[str]

get_key_count()[source]

Return how many keys are in the pool.

Used to decide whether failover is even possible (rotating is pointless with a single key) and to render the key N/M progress string in the search logs. Called by BraveSearchRateLimiter._brave_search().

Returns:

The number of configured pool keys.

Return type:

int

class tools.brave_search.BraveSearchTask(query, count, country, search_lang, ui_lang, safesearch, future, user_api_key=None, user_id=None, redis_client=None, config=None)[source]

Bases: object

A single queued Brave search request awaiting rate-limited execution.

Bundles everything BraveSearchRateLimiter needs to run one search (the query plus its locale/safesearch options, the resolved key and caller identity for quota accounting, and a Redis handle and config for privilege checks) together with an asyncio.Future the worker resolves with the result. Instances are created by BraveSearchRateLimiter.search(), placed on the limiter’s internal queue, and consumed by its background worker.

Parameters:
  • query (str)

  • count (int | None)

  • country (str | None)

  • search_lang (str | None)

  • ui_lang (str | None)

  • safesearch (str | None)

  • future (Future)

  • user_api_key (str | None)

  • user_id (str | None)

  • redis_client (object | None)

  • config (object | None)

query: str
count: int | None
country: str | None
search_lang: str | None
ui_lang: str | None
safesearch: str | None
future: Future
user_api_key: str | None = None
user_id: str | None = None
redis_client: object | None = None
config: object | None = None
class tools.brave_search.BraveSearchRateLimiter(calls_per_interval=0.5, interval_seconds=1.0)[source]

Bases: object

Process-wide serialiser that throttles all Brave API traffic.

Every search is enqueued as a BraveSearchTask and executed by a single background worker coroutine, guaranteeing the configured minimum gap between outbound Brave calls regardless of how many concurrent tool invocations are in flight. The worker performs the Brave request (with retries and key rotation), applies the Tavily fallback on failure, and resolves each task’s future with the result. A single module-level instance (_rate_limiter) backs both run() and search_with_key().

Parameters:
  • calls_per_interval (float)

  • interval_seconds (float)

__init__(calls_per_interval=0.5, interval_seconds=1.0)[source]

Configure the throttle rate; defer all async setup until first use.

Stores the rate parameters but does not create the queue, lock, or worker task here (no event loop is guaranteed at construction time); those are built lazily by _ensure_initialized(). The default of 0.5 calls per 1.0 second yields a minimum spacing of two seconds between Brave requests.

Parameters:
  • calls_per_interval (float) – Permitted number of calls within each interval window.

  • interval_seconds (float) – Length of the interval window in seconds.

task_queue: Queue | None
last_call_time: float
async search(query, count=10, country=None, search_lang=None, ui_lang=None, safesearch='moderate', user_api_key=None, user_id=None, redis_client=None, config=None)[source]

Submit a search to the rate-limited worker and await its result.

The public entry point on the limiter. It rejects an empty query up front, ensures the worker is running via _ensure_initialized(), wraps the arguments in a BraveSearchTask carrying a fresh future, enqueues it, and awaits the future the worker resolves. Any exception surfaced through the future is logged and converted into a JSON error payload so callers always get a string. Called by run() (the tool entry point) and search_with_key() (the internal programmatic helper).

Parameters:
  • query (str) – Search query or input string.

  • count (Optional[int]) – Number of results to return.

  • country (Optional[str]) – The country value.

  • search_lang (Optional[str]) – The search lang value.

  • ui_lang (Optional[str]) – The ui lang value.

  • safesearch (Optional[str]) – The safesearch value.

  • user_api_key (Optional[str]) – The user api key value.

  • user_id (Optional[str]) – Unique identifier for the user.

  • redis_client (Optional[object]) – Redis connection client.

  • config (Optional[object]) – Bot config for admin/privilege checks.

Returns:

Result string.

Return type:

str

async tools.brave_search.search_with_key(query, count=3, api_key=None)[source]

Execute a Brave search through the shared rate limiter.

This is the entry point for internal callers (e.g. WebSearchContextManager) that already have a resolved API key and don’t need the tool-context ceremony.

Return type:

str

Parameters:
  • query (str)

  • count (int)

  • api_key (str | None)

async tools.brave_search.run(query, count=10, country=None, search_lang=None, ui_lang=None, safesearch='off', ctx=None)[source]

Entry point for the brave_web_search tool: authorize, then search.

Dispatched by tool_loader under the single-tool TOOL_NAME/run convention when the LLM invokes brave_web_search. It first enforces the WEB_SEARCH privilege via _check_web_search_access(), lazily loads the shared key pool from ctx.config (guarded by the module _keys_loaded flag), and looks up the caller’s own stored Brave key from Redis through tools.manage_api_keys.get_user_api_key() so personal keys bypass the pool quota. It then forwards everything to BraveSearchRateLimiter.search() on the shared _rate_limiter and returns its JSON result string.

Parameters:
  • query (str) – Search query, optionally using Brave search operators.

  • count (int) – Number of results to return (clamped to 1-20).

  • country (str) – Country code for localised results (e.g. US, GB).

  • search_lang (str) – Language code for search results (e.g. en, es).

  • ui_lang (str) – Language code for UI elements.

  • safesearch (str) – Safe-search level (off, moderate, or strict).

  • ctx – Tool execution context exposing user_id, redis, channel_id, and config.

Returns:

A JSON string of search results, or a JSON error payload.

Return type:

str

Previous Next

© Copyright 2026, Stargazer Contributors.

Built with Sphinx using a theme provided by Read the Docs.