SuperAPI AI Directory

byted-market-insight-agent

Marketing & growth

View repository

Updated 10-15 17:30

About this skill

Market Insight Agent — Volcano Engine Market Insight Assistant

Purpose and Design Goals

This Skill is intended to provide the Agent with a unified, stable, and seamless entry point for invoking market insight services. It integrates the advantages of market-insight-agent-v2-optimized(zero-dependency Gateway version) and market-insight-agent-portable-sdk(official SDK version), achieving the following goals:

  1. Unified invocation path: Regardless of whether the underlying implementation uses API Gateway or the official SDK, for the Agent it is always invoked in the same way through the three functions scripts/client.py in list_custom_subs_task、pull_post、query_clue_info .
  2. Dynamic Provider selection: By default, the API Gateway method is preferred. At the same time, the Skill can dynamically and intelligently select the best invocation path based on the current environment (such as environment variable configuration) and runtime status (such as consecutive failures on a certain link).
  3. Automatic SDK installation: When the SDK path needs to be used but volcengine-python-sdk is not installed in the environment, the Skill will automatically attempt to install it, achieving a true "out-of-the-box" experience.
  4. State and credential persistence: The Skill persists its runtime state (such as the last successful Provider) and user-provided credentials (if obtained through "minimal prompting") to the Skill's private persist/ directory, achieving state retention and credential reuse across sessions.
  5. Minimal prompting: Only when there are completely no available credentials or all links fail authentication does it send an explicit "minimal prompting" request to the Agent layer, leaving it to the Agent to decide when and how to obtain credentials from the user, avoiding unnecessary interruptions.

Trigger Scenarios

This Skill should be used when interaction with the Volcano Engine Market Insight service is needed. Specific scenarios include but are not limited to:

  • Brand voice monitoring: Obtain social media discussions about a specific brand or product.
  • Competitor activity tracking: Monitor competitors' market activities and user feedback.
  • Industry trend analysis: Discover industry hotspots and changes by analyzing public data.
  • Hot topic summarization: Conduct in-depth content mining and analysis of a specific event or topic.
  • Monitoring task management: Query and manage subscription/monitoring tasks created on the Market Insight platform.
  • Business opportunity lead query: Pull AI-generated structured business opportunity leads, including ACOR assessments, company profiles, etc.

Provider Selection Strategy

Internally, the Skill implements an intelligent Provider selection strategy through scripts/auth_resolver.py , and its decision order is as follows:

  1. Session stickiness first: If the last invocation succeeded, reuse that Provider (Gateway or SDK) first to ensure link stability.
  2. Default priority: In the absence of a historical success record, attempt in the following order by default:
    • API Gateway: Check whether the ARK_SKILL_API_BASE and ARK_SKILL_API_KEY environment variables exist. This path has no third-party Python library dependencies and is preferred.
    • Official SDK: Check whether the VOLCSTACK_ACCESS_KEY_ID and VOLCSTACK_SECRET_ACCESS_KEY environment variables exist.
  3. Dynamic degradation: If a Provider experiences consecutive authentication failures (401/403) or is unreachable over the network, it will be temporarily marked as "degraded" and automatically switched to a backup Provider for a period of time.
  4. Minimized inquiry trigger: When all of the above paths are unavailable due to missing credentials, the Skill will throw MissingCredentialsError, along with a clear prompt, informing the Agent layer how it should request credentials from the user.

For more details, please refer to references/usage.md。

Dangerous operation restrictions

To ensure safety and compliance, this Skill strictly adheres to the following restrictions:

  • Does not execute aime skill upload or aime skill enable: The packaging and deployment of the Skill should be explicitly initiated by the user or an upper-layer CICD process. The Skill itself does not contain any logic for automatic upload or enablement.
  • Does not hard-code credentials: All sensitive information such as API Keys, AK/SK, etc. is read through environment variables or persisted persist/auth.json files. The code does not contain any hard-coded credentials.
  • Log redaction: When printing Debug logs, sensitive information such as the API Gateway address and API Key is automatically redacted, and only non-sensitive call summaries are printed.
  • Persistence directory isolation: All persisted files (state, credentials) are stored in the persist/ directory under the Skill root directory, ensuring isolation from the rest of the workspace.

Where to find environment variables

When this Skill starts, it will proactively help you "find environment variables" and determine the actual effective credential source in a fixed order:

  • Firstmust scan common shell configuration files for export lines(~/.bashrc、~/.bash_profile、~/.zshrc、~/.profile), and read-only parse only simple constant definitions in the form of export ARK_*/VOLCSTACK_* , to collect candidate credentials for the Gateway and SDK;
  • Then by default assume that the user has already configured credentials in environment variables: if the current process's environment variables (os.environ) already contain the corresponding ARK_* / VOLCSTACK_*, then these values are considered "already effective", andwill override the candidate values previously collected from the rc file;
  • If paired credentials are still missing in the environment variables, then fall back to the Skill's private persisted file persist/auth.json(written by the Agent layer after a minimized inquiry), and try to complete the missing Gateway or SDK credentials;
  • Only when none of the above three places can provide usable credentials will MissingCredentialsErrorbe thrown, and the Agent layer triggers a "minimized inquiry" to ask the user for the necessary small amount of information.

Order:First scan rc → then read os.environ (if already effective, override candidates) → then read persist/auth.json → finally trigger the minimized inquiry。

Throughout the entire process, the parsing of the rc file is always read-only:

  • Only parse export VAR=VALUE lines in the form of simple constants; it will not execute source, and will not expand expressions such as $VAR、$() ;
  • The logs will also only output redacted summaries, and will not print plaintext credentials;
  • It will not automatically write back to rc or modify the user's environment.

Typical self-check methods include:

  • View the current process environment in the terminal:echo $ARK_SKILL_API_BASE or env | grep ARK_SKILL_API_BASE
  • Search for export statements in rc files:grep -n "^export ARK_SKILL_API_BASE" ~/.bashrc ~/.bash_profile ~/.zshrc ~/.profile 2>/dev/null

Quick verification

You can run scripts/quick_validate.py to perform a static self-check. It checks whether key files exist, whether the Python version meets the requirements, and the configuration status of environment variables, but it will not initiate any network requests.

python3 scripts/quick_validate.py