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:
- 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.pyinlist_custom_subs_task、pull_post、query_clue_info. - 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).
- Automatic SDK installation: When the SDK path needs to be used but
volcengine-python-sdkis not installed in the environment, the Skill will automatically attempt to install it, achieving a true "out-of-the-box" experience. - 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. - 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:
- Session stickiness first: If the last invocation succeeded, reuse that Provider (Gateway or SDK) first to ensure link stability.
- 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_BASEandARK_SKILL_API_KEYenvironment variables exist. This path has no third-party Python library dependencies and is preferred. - Official SDK: Check whether the
VOLCSTACK_ACCESS_KEY_IDandVOLCSTACK_SECRET_ACCESS_KEYenvironment variables exist.
- API Gateway: Check whether the
- 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.
- 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 uploadoraime 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.jsonfiles. 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
exportlines(~/.bashrc、~/.bash_profile、~/.zshrc、~/.profile), and read-only parse only simple constant definitions in the form ofexport 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 correspondingARK_*/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=VALUElines in the form of simple constants; it will not executesource, 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_BASEorenv | 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