acps-reading-prism
A protocol-native multi-agent close-reading studio for advanced English.
acps-reading-prism 1.0.0 turns a single English passage into an auditable
close-reading report. Three specialist agents — a Parser Agent, a
Context Agent and a Question Agent — collaborate over the ACPs protocol
stack (ACS + ADP + AIP v2, powered by acps-sdk==2.1.0).
A Leader agent plans the workflow, dispatches work in parallel and merges
the structured products into one report.
It is built for the reading load that actually hurts: postgraduate entrance exams, IELTS/TOEFL passages, and Economist-style long-form journalism where a single sentence can carry four layers of subordination and the author's stance lives between the lines.
Why "Reading Prism"?
A prism does not add light; it decomposes one beam into its spectrum. This tool does the same to a passage: one text goes in, and three separable spectra come out —
- syntax (clause tree, main clause, grammatical roles),
- context (background knowledge, authorial stance, context-bound senses),
- logic (item design, evidence location, distractor diagnosis).
The Leader then recombines them into one reading report. Hence: ACPs Reading Prism.
Why multiple agents instead of one prompt?
| Concern | Single monolithic prompt | Reading Prism mesh |
|---|---|---|
| Long-sentence grammar | diluted by task-switching | a dedicated Parser skill with a clause-level product |
| Cultural background / stance | often hallucinated or omitted | a Context skill with explicit background cards and evidence |
| Question quality | one-shot, hard to audit | a Question skill that consumes the products of the other two and cites evidence sentences |
| Failure isolation | one bad span ruins everything | per-task states, AIP task ids, timed traces |
The collaboration is a real fan-out / fan-in, not three prompts glued together:
┌────────────────┐
article ─────▶│ Parser Agent │──┐
└────────────────┘ │ structured ParseReport
├──▶┌──────────────────┐
┌────────────────┐ │ │ Question Agent │──▶ QuizReport
article ─────▶│ Context Agent │──┘ └──────────────────┘
└────────────────┘ ▲
ContextReport
│
┌───────────┴───────────┐
│ Leader (orchestrator) │──▶ ReadingReport
└───────────────────────┘
Parser and Context run concurrently (asyncio.gather); Question runs only
after both products arrive, and its payload includes the full ParseReport and
ContextReport. Every hop is an AIP task with its own id, state and latency,
surfaced in the report's collaboration table.
Agent roster
| Agent | Skill id | Responsibility | Product |
|---|---|---|---|
| Parser Agent | prism-sentence-parser |
Long-sentence decomposition: concession / cause / condition / relative / object / comparative / appositive / participle clauses, plus subject–predicate–object–adverbial chunks | ParseReport |
| Context Agent | prism-context-analyst |
Background cards, author stance trajectory, hedging cues, context-bound word senses, collocations, morphology hints | ContextReport |
| Question Agent | prism-question-designer |
Main-idea, detail, vocabulary-in-context, inference and attitude items; evidence sentence + distractor flaw labels | QuizReport |
| Leader | LEADER_AIC |
ADP discovery, parallel dispatch, product validation, report synthesis | ReadingReport |
Each partner publishes an ACS capability document, is discovered through
ADP (skills.tags filter), and is driven through the AIP v2 task
lifecycle (start / continue / cancel / complete). Payloads travel as
TextDataItem JSON and products as StructuredDataItem, so no private wire
format leaks into the protocol layer.
Install
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS / Linux
source .venv/bin/activate
pip install -e ".[dev]"
The only runtime dependency that matters is acps-sdk==2.1.0; FastAPI, uvicorn,
pydantic and httpx are pulled in for the local AIP services.
One-click demo
python run_demo.py
# or, after installation:
reading-prism demo
The demo starts three loopback AIP services, runs the built-in Economist-style passage through the full workflow, and prints the report. Expected opening:
==============================================================================
ACPs Reading Prism v1.0.0 · 多智能体外刊精读
==============================================================================
本地 AIP 网格已启动(每个智能体独立进程内 RPC 服务):
· Parser Agent 1.2.156.3088 · vendor 34C2 · instance 000101
skill=prism-sentence-parser endpoint=http://127.0.0.1:xxxxx/aip/v2/rpc
· Context Agent ... instance 000102
· Question Agent ... instance 000103
[Leader] 并行派发 Parser Agent 与 Context Agent;两者返回结构化产物后,
再把产物交给 Question Agent 命题。
阅读报告 · The Remote-Work Remaking of Housing and Hiring · 351 ms
Then the Markdown report follows: collaboration trace, per-sentence clause tables, background cards, author stance, a contextual vocabulary table, five exam-style questions with distractor diagnosis, and a review checklist.
Analyse your own passage
reading-prism analyze --file article.txt --title "The Economist · Leaders"
reading-prism analyze --text "Although ..." --max-questions 4
reading-prism demo --json # raw ReadingReport JSON
Use it as a library
import asyncio
from reading_prism.leader import ReadingSession
from reading_prism.mesh import LocalAgentMesh
from reading_prism.report import render_markdown
async def main() -> None:
with LocalAgentMesh() as mesh:
async with ReadingSession(mesh.registry) as session:
report = await session.analyze(article, title="Leaders")
print(render_markdown(report))
asyncio.run(main())
Run the tests
pytest -q
The suite covers clause detection, stance/vocabulary recovery, item grounding, a full three-agent AIP round-trip, and the generic fallback path.
Build the wheel
python -m pip install --upgrade build twine
python -m build
Artifacts land in dist/:
dist/acps_reading_prism-1.0.0-py3-none-any.whl
dist/acps_reading_prism-1.0.0.tar.gz
Validate before uploading:
twine check dist/*
Publish to PyPI
# 1) TestPyPI first (recommended)
twine upload --repository testpypi dist/*
# 2) Verify the install from TestPyPI
pip install --index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple/ acps-reading-prism==1.0.0
# 3) Production
twine upload dist/*
Credentials can come from ~/.pypirc, or from the environment:
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=pypi-<your-api-token>
Project layout
acps-reading-prism/
├── pyproject.toml # name / version 1.0.0 / build config / entry points
├── README.md
├── LICENSE
├── run_demo.py # one-click demo runner (adds src/ to sys.path)
├── src/reading_prism/
│ ├── __init__.py
│ ├── __main__.py # python -m reading_prism
│ ├── cli.py # reading-prism demo | analyze
│ ├── demo.py # banner + demo orchestration
│ ├── identity.py # AIC parsing + ACS capability documents
│ ├── models.py # pydantic products exchanged over AIP
│ ├── registry.py # ADP-style discovery registry
│ ├── runtime.py # AIP RPC server, payload codec, result builder
│ ├── mesh.py # starts + publishes the three partner agents
│ ├── leader.py # ReadingSession: discovery → fan-out → fan-in
│ ├── report.py # Markdown report renderer
│ ├── corpus.py # demo passage, reference translations, lexicon, topic pack
│ ├── py.typed
│ ├── agents/
│ │ ├── base.py # AIP lifecycle base class
│ │ ├── parser_agent.py
│ │ ├── context_agent.py
│ │ └── question_agent.py
│ └── engine/
│ ├── text.py # sentence/word utilities
│ ├── syntax.py # clause parser + chunker
│ ├── context.py # background / stance / lexical engine
│ └── questions.py # item generation + distractor diagnosis
└── tests/test_end_to_end.py
Design notes and honest limits
- Deterministic core, protocol-first boundary. The syntax/context/question engines are rule-based and run offline. They are deliberately behind agent boundaries: you can replace any engine with an LLM-backed implementation without touching the AIP orchestration or the report schema.
- Expert topic pack + generic fallback. The built-in passage ships with a curated background pack and item bank; every item is re-verified against the parsed evidence sentence. Passages outside the pack still get a full report, but the quiz is labelled as a template draft for human review.
- Background cards are general knowledge. The report states this explicitly and asks readers to verify figures against the source.
- No API keys, no network calls beyond loopback AIP RPC. That makes the demo reproducible in CI and safe in a classroom.
License
MIT. See LICENSE.
Metadata
Release files for acps-reading-prism 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_reading_prism-1.0.0.tar.gz | 55.1 kB | Without provenance | Details for acps_reading_prism-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| acps_reading_prism-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for acps_reading_prism-1.0.0-py3-none-any.whl |
Total release size: 116.2 kB
Release files / acps_reading_prism-1.0.0.tar.gz
| Download URL | acps_reading_prism-1.0.0.tar.gz |
|---|---|
| Size | 55.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
524506e10be25bd8f5c8ecd292fdb08c1ff7b6ed5a9845e4bf0c16a6a57e353f
|
|
BLAKE2b-256 checksum How to use checksums |
e2e1985de6897d23ca10ef66e02270a744f9dc46e23c5d5a955ef68a2d781d80
|
| 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_reading_prism-1.0.0-py3-none-any.whl
| Download URL | acps_reading_prism-1.0.0-py3-none-any.whl |
|---|---|
| Size | 61.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e6263b9b9f896fb256d47d2f9c0f40d57a4ac64bfb32cd2f24dd8c8572aaae58
|
|
BLAKE2b-256 checksum How to use checksums |
e03efac74a1c34c9da5606f92d40c42ef3f0e9e10a1543bff002615fb24bc9cb
|
| 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-reading-prism 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.