ACPs Scenario Buddy
Scenario Buddy is a protocol-native multi-agent companion for real-world English. An NPC Agent role-plays the waiter, hotel receptionist, doctor or passer-by; a Guide Agent steps in with immediately speakable rescue phrases when the learner stalls; a Culture Agent debriefs etiquette, tipping and small-talk norms after the scene.
The name joins Scenario (a concrete real-life setting such as ordering food, checking into a hotel, seeing a doctor or asking for directions) with Buddy (a companion that stays with the learner through the whole encounter rather than acting as a one-off quiz). Version 1.0.0 is a typed Python package and distributable wheel built on acps-sdk==2.1.0, not a notebook or a mocked chat script.
Why it is useful
- NPC Agent opens the scene in character, tracks turn order, keeps the dialogue coherent, and flags hesitation it observes.
- Guide Agent receives the stalled utterance plus the NPC's last line and returns three contextual phrases with Chinese support and one delivery strategy.
- Culture Agent consumes the finished transcript and produces a structured briefing: etiquette, taboos, safe small talk, tipping and reusable patterns.
- Scenario Leader discovers skills through ADP, checks real HTTP heartbeats, orchestrates AIP v2 JSON-RPC tasks, routes rescues mid-turn, transfers typed memory and audits every stage transition.
The engine is deterministic and offline after installation: it needs no LLM key and makes no claim to be a calibrated speaking test. Every turn is reproducible, which makes the package suitable for classrooms, self-study routines and integration tests.
Metadata description (under 500 characters)
An ACPs multi-agent companion for real-world English. A scenario NPC (waiter, hotel receptionist, doctor, passer-by) role-plays immersive dialogue; a Guide Agent supplies idiomatic rescue phrases the moment the learner gets stuck; a Culture Agent debriefs etiquette, tipping and small talk. Built on acps-sdk 2.1.0 with independent AIP v2 JSON-RPC services, ADP discovery, typed products and auditable task traces for travel, relocation and healthcare.
Collaboration architecture
Learner turns
│
▼
Scenario Leader ── ADP DiscoveryRequest + HTTP /healthz ──► Agent Registry
│
├── AIP v2 JSON-RPC ──► NPC Agent
│ opening → role-play turns → closing
│
├── AIP v2 JSON-RPC (only when stuck) ──► Guide Agent
│ trigger + stalled utterance + NPC line → 3 rescue phrases
│
├── AIP v2 JSON-RPC + full transcript ──► Culture Agent
│ etiquette + taboos + small talk + tipping
│
└── non-empty END_SESSION broadcast + ControlAck from all agents
Every partner runs as an independent FastAPI/uvicorn service on an ephemeral loopback port. Commands and products use acps-sdk==2.1.0 AIP models. Application envelopes carry validated session_id, task_id, stage and a non-empty typed payload; the stage machine rejects skipped or reversed phases.
Project structure
acps-scenario-buddy/
├── pyproject.toml # setuptools metadata, dependencies, CLI, tool config
├── README.md
├── LICENSE
├── .gitignore
├── examples/
│ └── restaurant_demo.py # one-command public-API example
├── src/scenario_buddy/
│ ├── __init__.py # versioned public API
│ ├── __main__.py # python -m scenario_buddy
│ ├── py.typed # PEP 561 typing marker
│ ├── cli.py # scripted and interactive CLI
│ ├── demo.py # realistic four-turn fixtures per scenario
│ ├── leader.py # ADP discovery, AIP dispatch, rescue routing, fan-in
│ ├── mesh.py # lifecycle of three local partner services
│ ├── registry.py # ACS publication and ADP discovery
│ ├── runtime.py # AIP v2 JSON-RPC hosting and structured products
│ ├── protocol.py # message codec and four-stage state machine
│ ├── models.py # typed domain, wire and collaboration contracts
│ ├── identity.py # AIC identity helpers and project version
│ ├── scenarios.py # NPC openings, turn replies and visible goals
│ ├── guide_bank.py # stuck detection and contextual rescue phrases
│ ├── culture_bank.py # curated cultural debriefs
│ ├── report.py # human-readable Markdown renderer
│ └── agents/
│ ├── base.py # shared AIP task lifecycle and control handling
│ ├── npc.py # in-character role-play partner
│ ├── guide.py # just-in-time phrase rescue partner
│ └── culture.py # post-scene cultural debrief partner
└── tests/
└── test_scenario_buddy.py # protocol, stuck detection and full-mesh integration
Install and run
# from the repository root
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
python -m pip install -e ".[dev]"
# one-command scripted restaurant demo
python -m scenario_buddy demo --scenario restaurant
# interactive practice (type your own English turns)
python -m scenario_buddy chat --scenario hotel
# or use the installed console script
scenario-buddy demo --scenario clinic --destination "Toronto, Canada"
The scripted demo needs no keyboard input. The chat command prompts for four turns and uses the same multi-agent pipeline.
Expected demo excerpt
[NPC Agent · opening]
Good evening, welcome to The Thames Bistro. Do you have a reservation?
[Learner · turn 2/4]
I want the... uh... the chicken thing. How do you say?
[Guide Agent · rescue for turn 2]
Trigger: explicit help request: 'how do you say'
1. Could I have the grilled chicken, please?
请给我一份烤鸡,谢谢。 · Could I have… 是点餐最礼貌、最通用的句式。
2. What would you recommend?
您推荐什么? · 不确定菜名时,把选择权交给服务员。
3. Sorry, what do you call this dish in English?
不好意思,这道菜英文怎么说? · 直接问菜名,比沉默或只指菜单更自然。
Tip: 用 'Could I have…' 代替 'I want…' 更礼貌;先报菜名,再回答熟度(medium / well done)。
[NPC Agent · turn 2]
The grilled chicken is an excellent choice. How would you like it cooked — medium or well done?
[Culture Agent] Debrief ready: 英式餐厅点餐:礼貌句式、出餐节奏与小费
The final report also contains the AIP task audit table, all four dialogue turns, the rescue log and the full cultural briefing.
Programmatic API
import asyncio
from scenario_buddy import LearnerProfile, LocalAgentMesh, Scenario, ScenarioSession
async def main() -> None:
learner = LearnerProfile(
name="Alex Chen",
scenario=Scenario.RESTAURANT,
destination="London, UK",
)
turns = [
"Do you have a table for two, please?",
"I want the... uh... the chicken thing.",
"Medium, please. And a sparkling water.",
"Could we have the bill, please?",
]
with LocalAgentMesh() as mesh:
async with ScenarioSession(mesh.registry, learner) as session:
result = await session.run(turns)
print(result.culture.headline)
print(result.rescues[0].phrases[0].english)
asyncio.run(main())
Build the wheel and upload to PyPI
python -m pip install --upgrade build twine
python -m build
python -m twine check dist/*
# TestPyPI first
python -m twine upload --repository testpypi dist/*
# Production PyPI
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=pypi-<your-api-token>
python -m twine upload dist/*
Windows PowerShell equivalents:
$env:TWINE_USERNAME = "__token__"
$env:TWINE_PASSWORD = "pypi-<your-api-token>"
python -m twine upload dist/*
The build produces dist/acps_scenario_buddy-1.0.0-py3-none-any.whl and the source distribution.
Verify the package
python -m pytest
python -m ruff check .
python -m twine check dist/*
Design boundaries
- The scene scripts are curated and deterministic; they are designed for repeatable practice, not for open-ended generation.
- The Guide Agent triggers on observable signals (Chinese characters, explicit help phrases, hesitation markers, unfinished utterances) rather than on a hidden model.
- The Culture Agent provides general guidance for UK-oriented settings; regional norms vary and should be checked for a specific destination.
- AIP task state is held in the SDK's in-process
TaskManager; this local mesh is intended for single-process practice and CI, not multi-tenant deployment.
License
MIT. See LICENSE.
Metadata
Release files for acps-scenario-buddy 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| acps_scenario_buddy-1.0.0.tar.gz | 38.6 kB | Without provenance | Details for acps_scenario_buddy-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| acps_scenario_buddy-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for acps_scenario_buddy-1.0.0-py3-none-any.whl |
Total release size: 83.1 kB
Release files / acps_scenario_buddy-1.0.0.tar.gz
| Download URL | acps_scenario_buddy-1.0.0.tar.gz |
|---|---|
| Size | 38.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f2b0fe5b200519291b41a5f14ad22a267812d55ade2f5eadbea0e84a177d2469
|
|
BLAKE2b-256 checksum How to use checksums |
8eb1d060766dd708a47191fd3801f49e40ec84aab43f068a01448b57b11e3876
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / acps_scenario_buddy-1.0.0-py3-none-any.whl
| Download URL | acps_scenario_buddy-1.0.0-py3-none-any.whl |
|---|---|
| Size | 44.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef2894a1f752b80b03f43cb2240b953afff7dcea978244b68b4314e2dcdc3eae
|
|
BLAKE2b-256 checksum How to use checksums |
ded913031779adff7a01492770c7c61d8680e3485b08e383df8645f6da5e524f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for acps-scenario-buddy 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.