Athenian AI Repricing Agent
Overview
Product overview
This document consolidates the technical and marketing positioning for Athenian AI Repricing Agent for WooCommerce, based on the inspected plugin package athenian-ai-repricing-agent.zip.
It is intended to support product pages, internal technical reviews, client-facing descriptions, platform documentation, implementation planning, and future roadmap refinement.
---
Use cases
- Catalog repricing
- Competitive pricing review
- Scheduled price operations
- Margin-aware automation
Developer
Developer starting point
This baseline documents repricing code and controls. It does not claim that an external AI request, live price update, or customer-facing price change has been exercised.
Admin Workflow
1. Configure the Plugin
Admins access the plugin through:
WooCommerce -> AI Repricing AgentThe settings screen controls:
- AI model override
- Prefer APC AI when available
- Emit platform events / kernel logs
- Log level
- HTTP timeout
- User-Agent
- Search max URLs
- Minimum priced offers for AI
- Minimum offer confidence
- Outlier max multiplier
- Outlier min multiplier
- Price epsilon
- Bundle/pack offer allowance
- AJAX apply permission
2. Map a Product Source URL
On the WooCommerce product edit screen, admins can set a Pricing source URL and optionally enable Use mapped source only.
Mapped-only mode is most useful when a known external URL is the desired reference source and broad search should be avoided.
3. Run a Repricing Check
Admins can run checks from:
- Product edit metabox
- Product list row action
- WP-CLI
AIRA collects signals, extracts offers, normalizes data, asks AI or uses mapped-only logic, stores the result, and returns a recommendation.
4. Review the Recommendation
The product metabox shows:
- Summary
- Current price
- Suggested price
- Change/no-change decision
- Provider path
- AI reasoning
- Extracted offers
- Supporting matches
- Search results
- Debug JSON
5. Apply the Suggested Price
If a suggested price exists and the recommendation says the product should change, an admin can apply the saved suggestion.
The plugin updates:
- Sale price if the product is currently on sale
- Otherwise regular price, using
suggested_regular_pricewhen present
---
Technical Architecture
Main Bootstrap
athenian-ai-repricing-agent.phpDefines plugin constants and loads:
Athenian\AIRepricing\Plugin::instance();Namespace Structure
| Namespace | Responsibility | |---|---| | Athenian\AIRepricing | Plugin bootstrap, options, platform integration, logging, utility helpers | | Athenian\AIRepricing\Admin | Admin menu, settings, AJAX actions, product metabox | | Athenian\AIRepricing\CLI | WP-CLI commands | | Athenian\AIRepricing\DB | Custom table schema and repository writes | | Athenian\AIRepricing\Engine | Repricing workflow orchestration | | Athenian\AIRepricing\OpenAI | Direct OpenAI Responses API client | | Athenian\AIRepricing\Scrape | HTTP fetching and price extraction | | Athenian\AIRepricing\Search | Search runner and provider management | | Athenian\AIRepricing\Search\Providers | Serper provider implementation | | Athenian\AIRepricing\Sites | Source-site adapter selection | | Athenian\AIRepricing\Sites\Adapters | Schema JSON-LD and Shopify extraction adapters | | Athenian\AIRepricing\Woo | WooCommerce product meta fields and row actions |
---
Data Model
Custom Tables
#### wp_ath_aira_checks
Stores repricing check-level records.
| Column | Purpose | |---|---| | id | Primary key | | created_at | Check timestamp in GMT | | product_id | WooCommerce product ID | | template_id | Repricing template ID | | query | Product-derived search query | | current_price | Product price at check time | | suggested_price | AI/mapped suggested price | | confidence | Recommendation confidence | | should_change | Boolean flag for price change recommendation | | summary | Human-readable summary | | ai_json | Full AI recommendation payload | | signals_json | Search/scrape/offer payload | | context_json | Product/platform/mapped-source context |
Indexes:
- Primary key on
id product_timeon(product_id, created_at)
#### wp_ath_aira_offers
Stores offer-level evidence associated with checks.
| Column | Purpose | |---|---| | id | Primary key | | check_id | Related check record | | product_id | WooCommerce product ID | | source_type | mapped, search, or related source type | | source | Extraction/search source | | domain | Extracted source domain | | url | Source URL | | title | Source/offer title | | price | Extracted price | | currency | Extracted or inferred currency | | extract_method | Extraction method or adapter | | extract_conf | Extraction confidence | | match_conf | AI/match confidence when available | | raw_json | Raw extracted details |
Indexes:
- Primary key on
id check_idproduct_domainon(product_id, domain)
Options
Primary option:
ath_aira_optionsDefault settings include:
openai_model = gpt-4.1-mini
prefer_platform_ai = true
emit_platform_events = true
log_level = info
http_timeout = 25
user_agent = Mozilla/5.0 (compatible; AthenianAIRepricingAgent/3.1; +https://example.com)
min_priced_offers_for_ai = 2
price_epsilon = 0.0001
allow_apply_from_ajax = false
search_max_urls = 8
min_offer_confidence = 0.40
offer_outlier_max_mult = 2.5
offer_outlier_min_mult = 0.4
allow_bundle_offers = false
serper_api_key = ""Product Meta
| Meta Key | Purpose | |---|---| | _ath_aira_source_url | Product-level mapped pricing source URL | | _ath_aira_source_only | Boolean flag to skip search/AI ranking and use mapped source only | | _ath_aira_last_check_id | Last repricing check ID | | _ath_aira_last_check_at | Last check timestamp | | _ath_aira_last_template_id | Last template ID used | | _ath_aira_last_summary | Last human-readable summary | | _ath_aira_last_payload | Last search/scrape/offer payload JSON | | _ath_aira_last_ai | Last AI recommendation JSON | | _ath_aira_last_suggested_price | Last suggested price | | _ath_aira_last_should_change | Last change/no-change flag | | _mpn | Product MPN included in query context when present |
---
Repricing Workflow
Standard Search + AI Flow
- Load product by ID.
- Build context from product name, SKU, brand, MPN, price, currency, and permalink.
- Load selected repricing template.
- Check mapped source state.
- If not mapped-only, collect search signals.
- Optionally scrape allowed/direct targets.
- Extract offers from search results and mapped source.
- Normalize offers and filter poor matches.
- Build AI messages with strict instruction rules.
- Prefer APC AI if configured and available.
- Fall back to direct OpenAI Responses API when needed.
- Normalize the recommendation result.
- Persist check and offer history.
- Update product-level last-check metadata.
- Emit platform event.
- Return structured result to admin UI or CLI.
Mapped-Source-Only Flow
- Load mapped source URL from
_ath_aira_source_url. - Detect adapter with
SiteRepo. - Extract price directly from Shopify JSON or schema/meta adapter.
- Compare external mapped price against current product price using
price_epsilon. - Build deterministic recommendation without search or AI ranking.
- Persist the result and update product metadata.
---
External Service Integrations
WooCommerce
AIRA is WooCommerce-native and integrates with:
- Product edit pricing fields
- Product save handling
- Product edit metaboxes
- Product list row actions
- Product price updates
- WooCommerce logger
- WooCommerce currency context
Serper
Serper provides Google search result discovery for product-aware competitor searches.
Credential path:
ath_aira_options['serper_api_key']- Fallback from ASAKM service
serper, fieldapi_key
OpenAI
The direct OpenAI path uses the Responses API with strict JSON schema output.
Credential path:
- ASAKM service
openai, fieldapi_key - Optional Athenian Platform Core AI Registry provider data
Athenian Secure API Key Manager
AIRA can use ASAKM through:
asakm_get()function when availableAthenian\SecureAPI\SecureStorewhen available
This avoids hardcoding API credentials in plugin code.
Athenian Platform Core AI
AIRA can route AI recommendations through APC AI first when:
prefer_platform_aiis enabledAthenian\PlatformCore\AI\Managerexists
Athenian Platform Kernel
AIRA can emit platform logs through:
Athenian\Kernel\Logger::log_run(...)It also fires platform-style actions:
do_action('ath_aira/event', $evt);
do_action('athenian/repricing/event', $evt);---
WordPress Hooks and Actions
| Hook / Action | Purpose | |---|---| | plugins_loaded | Boot WooCommerce-dependent modules and install schema | | admin_menu | Register WooCommerce submenu page | | admin_init | Register plugin settings | | add_meta_boxes | Register product AI Repricing metabox | | admin_enqueue_scripts | Load metabox JS/CSS on product edit screens | | woocommerce_product_options_pricing | Render mapped-source product fields | | woocommerce_admin_process_product_object | Save mapped-source product fields | | post_row_actions | Add AI Reprice Check product row action | | admin_post_ath_aira_check_product | Handle row-action repricing checks | | wp_ajax_ath_aira_check_product | Run metabox repricing check | | wp_ajax_ath_aira_apply_suggested | Apply saved suggested price | | ath_aira/event | Emit internal repricing events | | athenian/repricing/event | Emit broader platform repricing events |
---
Security and Operational Controls
Capability Checks
All admin operations require:
manage_woocommerceNonce Protection
AJAX and row-action flows use nonce validation:
ath_aira_ajaxath_aira_check_product_{product_id}
Sanitization
The plugin sanitizes:
- Source URLs with
esc_url_raw - Template IDs
- Domains
- Admin settings fields
- Numeric threshold values
- User-Agent strings
- Product mapping fields
Conservative Price Application
The metabox can display suggestions without automatically applying them.
Price application from the check workflow is blocked unless:
allow_apply_from_ajax = trueThe standalone apply-suggested AJAX action applies only a previously saved suggested price and still requires capability + nonce validation.
Bot Wall Handling
The scrape workflow detects obvious bot-wall/captcha patterns in fetched HTML and marks the target as failed rather than trusting a bad extraction.
Logging
AIRA logs to the best available channel:
apc_log()when available- WooCommerce logger when available
- PHP
error_log()fallback
Log levels include:
debuginfowarnerror
---
Technical Verification Notes
During inspection, all PHP files in the plugin package passed php -l syntax checks.
Observed package contents include:
- 22 PHP files
- Admin CSS/JS assets
- Repository marketing and platform documentation
- Search provider implementation
- Site extraction adapters
- Database schema installer
- WP-CLI command registration
- WooCommerce product metadata integration
No REST routes, shortcodes, custom post types, or custom taxonomies were detected in the inspected source package.
---
Implementation Notes
- The plugin is intentionally product-level in its current inspected form. It does not expose a bulk repricing screen in the provided package.
- Search templates exist in the option model, but the current admin settings UI does not appear to provide a full visual template editor.
- The default template uses Serper search with cautious scraping disabled by default.
- Direct mapped-source extraction can operate without AI when mapped-source-only mode is enabled.
- Direct price application is deliberately controlled and capability-gated.
- The default User-Agent contains an example URL and should be reviewed before production use.
- External search/scrape behavior depends on the accessibility and structure of source sites; bot walls or missing structured pricing data may limit extraction.
- Search-based offer extraction currently relies on the available search and extraction workflow and should be validated against target merchant catalogs before large-scale usage.
---
Install
- Reviewed source folder: athenian-ai-repricing
- Plugin version reviewed: 3.1.0
- Local source inventory: 31 files (temporary, test, and Git metadata excluded).
- GitHub baseline: https://github.com/Athenian-Brands/athenian-ai-repricing at baseline/devdocs-3.1.0-20261006c / 652758c72117b8f67216a0d914dc84286b115339.
- WordPress and WooCommerce.
- AI credentials, market-data inputs, and live price writes require separate staged verification.
Configuration
- Document Purpose — see the linked technical reference excerpt.
- Plugin Identity — see the linked technical reference excerpt.
- Executive Summary — see the linked technical reference excerpt.
- Marketing Positioning — see the linked technical reference excerpt.
- Core Value Proposition — see the linked technical reference excerpt.
- Primary Use Cases — see the linked technical reference excerpt.
- Feature Highlights — see the linked technical reference excerpt.
- Admin Workflow — see the linked technical reference excerpt.
- Technical Architecture — see the linked technical reference excerpt.
- Core Components — see the linked technical reference excerpt.
- Data Model — see the linked technical reference excerpt.
- Repricing Workflow — see the linked technical reference excerpt.
- AI Recommendation Contract — see the linked technical reference excerpt.
- External Service Integrations — see the linked technical reference excerpt.
Usage
- Shortcodes detected in local PHP source: 0
- Static action/filter hooks detected in local PHP source: 11
- REST route registrations detected in local PHP source: 0
Shortcodes
- No static add_shortcode registrations were detected by the baseline scanner.
REST Endpoints
- No register_rest_route calls were detected by the baseline scanner.
Hooks
- add_meta_boxes — includes/Admin/Metabox.php
- admin_enqueue_scripts — includes/Admin/Metabox.php
- admin_init — includes/Admin/Settings.php
- admin_menu — includes/Admin/Menu.php
- admin_post_ath_aira_check_product — includes/Woo/ProductRowAction.php
- plugins_loaded — includes/Plugin.php
- post_row_actions — includes/Woo/ProductRowAction.php
- woocommerce_admin_process_product_object — includes/Woo/ProductMeta.php
- woocommerce_product_options_pricing — includes/Woo/ProductMeta.php
- wp_ajax_ath_aira_apply_suggested — includes/Admin/Ajax.php
- wp_ajax_ath_aira_check_product — includes/Admin/Ajax.php
Data Model
- Data Model — described in the local technical reference.
- External Service Integrations — described in the local technical reference.
API Reference
- Local source digest: 7378320b749418396bfebd2945593a1fd39e7e2975c27976f55c131e61de2ba8
- Repository URL: https://github.com/Athenian-Brands/athenian-ai-repricing
- Repository reference: baseline/devdocs-3.1.0-20261006c
- Repository commit: 652758c72117b8f67216a0d914dc84286b115339
Source files include: assets/css/admin.css, assets/js/admin.js, assets/js/metabox.js, athenian-ai-repricing-agent-icon.png, athenian-ai-repricing-agent.php, athenian-ai-repricing-agent.zip, docs/aira-marketing-document.md, docs/athenian-platform-marketing.md, docs/athenian-platform-technical.md, docs/technical-marketing.md, includes/Admin/Ajax.php, includes/Admin/Menu.php, includes/Admin/Metabox.php, includes/Admin/Settings.php, includes/CLI/Commands.php, includes/DB/Repo.php, includes/DB/Schema.php, includes/Engine/RepriceEngine.php, includes/OpenAI/Client.php, includes/Plugin.php, includes/Scrape/Extractor.php, includes/Search/Providers/ProviderInterface.php, includes/Search/Providers/Serper.php, includes/Search/SearchRunner.php, includes/Sites/Adapters/AdapterInterface.php, includes/Sites/Adapters/SchemaJsonLd.php, includes/Sites/Adapters/ShopifyProductJson.php, includes/Sites/SiteRepo.php, …
Troubleshooting
- This baseline documents repricing code and controls. It does not claim that an external AI request, live price update, or customer-facing price change has been exercised.
- Confirm the deployed plugin version, active dependencies, and current repository tree before using implementation details as a release contract.
Treat payment, carrier, vendor, shipment, inventory, account, credential, tax, AI, and external-provider behavior as integration-dependent until exercised in the target environment.
FAQ
What is this page intended to establish?
A versioned, product-linked starting point for iterative developer documentation. It combines the local implementation reference with a detected-code inventory and a committed GitHub baseline.
Is the linked repository baseline verified?
Yes. The repository URL, ref, and commit recorded on this page were verified from the clean GitHub baseline prepared for this documentation pass. That does not by itself prove fleet deployment parity.
What remains for release-grade documentation?
Reconcile the recorded source baseline with the deployed plugin version, then exercise the relevant authenticated, store, provider, payment, tax, carrier, or generated-artifact paths in the target environment.