Skip to main content

MaxCompute semantic-layer-aware CLI: multi-profile auth + pyodps-backed query + structured memory + FTS5 + vector retrieval + UDF.

Project description

maxcompute-semantic (mcs)

maxcompute-semantic is the package that ships the mcs CLI and the bare maxcompute-semantic agent skill. Agents do not import Python internals from this package at runtime; they load SKILL.md and call mcs commands.

This README is the short reference for the installed distribution.

What Is Included

  • mcs CLI: profile management, metadata discovery, SQL execution, build/status/show, memory, metrics, UDF, and skill installation.
  • Bare skill bundle: src/maxcompute_semantic/_skill/ with SKILL.md and lazily loaded references/.
  • Profile store and semantic package builder. Profiles describe auth, compute project, data sources, cost thresholds, tags, and optional package path. Builds materialize a local SQLite + markdown semantic package for the profile.

The eval harness under eval/ is not part of the installed skill.

Install

pip install maxcompute-semantic

or

uv tool install maxcompute-semantic

Then verify with:

mcs --help

Install the skill as a symlink into an agent skill directory:

mcs skill install        # local .agents/skills/ by default
mcs skill install -g     # global ~/.agents/skills/ by default
mcs skill install --all  # install to every supported platform path

Supported platform names for mcs skill install -p <platform>: agents, claude-code, cursor, codex, gemini-cli, qwen-code, and opencode. Deprecated aliases gemini and qwen still work but emit a warning.

Configure A Profile

Interactive setup:

mcs profile create
mcs link bind <profile-name>

Scripted setup:

mcs profile spec-template > profile.yaml
mcs profile create --from-file @profile.yaml
mcs link bind <profile-name>

Profiles live in ~/.config/maxcompute-semantic/profiles.yaml unless MCS_CONFIG_DIR overrides the config root. mcs link bind stores a cwd-to-profile binding in link.json.

For CI or one-off shells, you can skip a saved profile and use the standard ODPS environment variables:

export ALIBABA_CLOUD_ACCESS_KEY_ID=...
export ALIBABA_CLOUD_ACCESS_KEY_SECRET=...
export MAXCOMPUTE_ENDPOINT=https://service.<region>.maxcompute.aliyun.com/api
export MAXCOMPUTE_PROJECT=<compute-project>

Profile Resolution

Commands that support profiles resolve context in this order:

  1. Explicit --profile NAME.
  2. MCS_PROFILE=NAME.
  3. The cwd binding written by mcs link bind NAME.
  4. The standard ODPS environment variables as an in-memory profile.

Common Commands

# profile and identity
mcs profile list
mcs profile show [NAME]
mcs profile update <NAME>
mcs profile whoami [NAME]
mcs link status

# semantic package
mcs build
mcs build --refresh
mcs status --tables
mcs show
mcs show --table <TABLE>

# semantic maintenance
mcs package propose --from-suggestions
mcs package list-proposals
mcs package apply <id>
mcs metric list
mcs metric add total_revenue --expression 'SUM(orders.amount)'
mcs metric show total_revenue

# metadata and SQL
mcs meta list-tables
mcs meta describe-table <TABLE>
mcs sql review 'SELECT ...'
mcs sql cost 'SELECT ...'
mcs sql explain 'SELECT ...'
mcs sql execute 'SELECT ...'

# memory
mcs memory recall --project <P> '<question>'
mcs memory verify --project <P> --question '<question>' --sql '<SQL>' --tables <T1,T2>

# skill and UDFs
mcs skill list
mcs skill diff --all
mcs udf list --project <P>

Run mcs <command> --help for the current option surface.

Data Layout

Config and built semantic packages are separate:

~/.config/maxcompute-semantic/
├── profiles.yaml
└── link.json

<XDG_DATA_HOME>/maxcompute-semantic/data/<profile-name>/
├── package.db
├── _overview.md
├── _joins.md
├── _state.json
├── _udfs.md
├── tier_cache/
└── <source_key>/              # per-source subdirectory (e.g. acme__warehouse/)
    └── <table>.md

profile.package_path can override the per-profile package directory.

Development

From the repository root:

uv run pytest packages/maxcompute-semantic/tests/
uv run ruff check packages/maxcompute-semantic/src packages/maxcompute-semantic/tests
uv run mypy packages/maxcompute-semantic/src

See CLAUDE.md for contributor workflow, CI, release, and benchmark details.

License

maxcompute-semantic is developed by Alibaba Cloud and licensed under the Apache License (Version 2.0). This product contains various third-party components under other open source licenses. See the NOTICE file for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maxcompute_semantic-0.16.1.tar.gz (978.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maxcompute_semantic-0.16.1-py3-none-any.whl (431.0 kB view details)

Uploaded Python 3

File details

Details for the file maxcompute_semantic-0.16.1.tar.gz.

File metadata

  • Download URL: maxcompute_semantic-0.16.1.tar.gz
  • Upload date:
  • Size: 978.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for maxcompute_semantic-0.16.1.tar.gz
Algorithm Hash digest
SHA256 1ddec948855de4d6e9b0877b5c52052d95e7ad2701bcdb38cf3d9cb39cdddac5
MD5 885315bd5d19be8c54d77b31723ff0c3
BLAKE2b-256 212cad9a0f5ae692b080be93e04350fbf6d8a468c39b0679ccdfb72d1646edd3

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxcompute_semantic-0.16.1.tar.gz:

Publisher: publish.yml on aliyun/maxcompute-semantic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file maxcompute_semantic-0.16.1-py3-none-any.whl.

File metadata

File hashes

Hashes for maxcompute_semantic-0.16.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b93107f818526799f640058b2f54d6b4767fa9be058fc27ad77570068104cc0e
MD5 40e9688d83d87ee1a6e686bd9a0c289b
BLAKE2b-256 f90ef29edca394cb0281029f0c7d2c29f3374377b1ca7e28ab73a8c5dda1d63f

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxcompute_semantic-0.16.1-py3-none-any.whl:

Publisher: publish.yml on aliyun/maxcompute-semantic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page