Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

Agentic Mobile Protocol (AMP)

Quick start

Prerequisites:

  • Python 3.10+: A virtual environment is created automatically on first run.
  • Node.js and npm: Frontend dependencies are installed automatically on first run.
  • bash and standard CLI tools (curl, lsof) on macOS or Linux.

AMP provides the following sample scenarios. Each script provisions a fresh virtual environment, installs dependencies, launches all the role services, and starts the web frontend.

Sample scenarioLaunch script
Human Not Presentbash ./samples/python/scenarios/human_not_present/start.sh
Human Presentbash ./samples/python/scenarios/human_present/start.sh

Note: These scripts are bash-specific. Invoke them with bash, not sh.

  1. Run one of the sample scenarios. Once the startup completes, the script prints the URL for each service.
  2. Open the printed Web Frontend URL in your browser to interact with the Shopping Agent.
  3. Press Ctrl+C to stop all services.

Note: Structured logs and the temporary databases for each run are written under the scenario's .logs/ and .temp-db/ folders.

Project structure

amp/
├── docs/                       # Protocol specification and glossary
├── src/python/                 # Reusable, framework-agnostic libraries
│   ├── common/                 # Shared kernel, including events, evidence logging, HTTP client, SQLite store, and money utils
│   ├── mandate_chain/          # Three-layer SD-JWT generation, validation, and mandate service
│   └── schemas/                # Pydantic models for checkout and mandate objects
├── samples/python/             # Runnable role services with scenario launchers
│   ├── acquirer/               # Acquirer service with CGCP routing
│   ├── alipayplus/             # Alipay+ network and mandate services
│   ├── credential_provider/    # Credential Provider service
│   ├── merchant/               # Merchant service
│   ├── mpp/                    # Mobile Payment Provider service
│   ├── shopping_agent/         # Shopping Agent and Web Frontend (Vite/React SPA)
│   └── scenarios/              # Launch scripts for human-present or human-not-present scenarios
├── tests/python/               # Unit tests and mandate_chain examples
└── requirements.txt            # Python dependencies

Shared libraries

ModulePathPurpose
commonsrc/python/commonShared kernel, including events, evidence logging, HTTP client, SQLite store, and money utils
mandate_chainsrc/python/mandate_chainThree-layer SD-JWT generation, validation, and mandate service
schemassrc/python/schemasPydantic models for checkout and mandate objects

Sample architecture

ServiceURL
Shopping Agenthttp://localhost:8080
Merchanthttp://localhost:8081
Credential Providerhttp://localhost:8082
Alipay+ Networkhttp://localhost:8083
Alipay+ Mandatehttp://localhost:8084
Acquirerhttp://localhost:8085
Mobile Payment Provider (MPP)http://localhost:8086
Web Frontendhttp://localhost:8088

Roles at a glance

RoleDirectoryResponsibility
Shopping Agentsamples/python/shopping_agentParses user intent, plans and drives the shopping steps under the AMP protocol (search → checkout → mandate → credential → pay). Holds an EC P-256 key and signs L3. Serves /task SSE endpoints consumed by the web frontend.
Merchantsamples/python/merchantProvides product catalog, creates checkout, and initiates payments towards the acquirer.
Credential Providersamples/python/credential_providerEnrolls payment methods, creates and inquires mandate sessions.
Alipay+ Networksamples/python/alipayplusServes as the payment network orchestration and routing layer.
Alipay+ Mandatesamples/python/alipayplusManages the mandate lifecycle: creates mandates, applies budget deductions, advances mandate status, and validates mandates against constraints.
Acquirersamples/python/acquirerRecognizes CGCP tokens, routes requests by token prefix, and forwards them to the Alipay+ Network.
Mobile Payment Provider (MPP)samples/python/mppResponsible for user authorization, IDV completion, and payment.
Web Frontendsamples/python/shopping_agent/web_frontendVite + React + TypeScript SPA that consumes agent SSE events and renders the protocol chain, IDV confirmation, and receipt cards.

Tech stack

  • Backend: Python 3.10+, FastAPI, Starlette, Uvicorn, Pydantic v2
  • Cryptography/tokens: cryptography, jwcrypto, sd-jwt (SD-JWT per RFC 9901, ES256 signatures)
  • HTTP: httpx for inter-service calls
  • Frontend: Vite + React 18 + TypeScript + SCSS (lucide-react icons)
  • Persistence (demo): per-run SQLite / JSON stores under .temp-db/

Contact

For security issues, please reach out to alipayplus_amp@ant-intl.com.

License

See LICENSE.

关于 About

Agentic Mobile Protocol

语言 Languages

Python100.0%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
20
Total Commits
峰值: 10次/周
Less
More

核心贡献者 Contributors