aoa-demo: Reference Services for AOA
aoa-demo contains two runnable reference services — a FastAPI HTTP service and an MCP server — built on the same domain model: orders, products, and customers. Both services expose the same Action operations over different transports, demonstrating how a single piece of business logic is published via FastApiAdapter for REST clients and via McpAdapter for AI agents without duplicating any logic. The package also serves as the integration fixture used in the AOA test suite.
The identity domain: one connection per call, with or without a database
POST /api/v1/identity/lookup and the MCP tool identity.lookup are the reference
for a database-backed resource. The action declares IdentityStoreBase under the
connection key identity; the route supplies a value per call — created for the call
and closed after it — so concurrent calls never share a connection and each
transaction belongs to one caller. The domain asks storage for two things — a person,
and a login recorded inside a transaction — and each store supplies them its own way:
over PostgreSQL the domain runs its statements through the driver's protected helpers
(_execute, _fetchrow) from methods of its own, and in memory it answers from
dictionaries.
It runs in two modes, and only the supplied value differs:
| Mode | When | What the route supplies |
|---|---|---|
| in memory | AOA_DEMO_POSTGRES_DSN is unset |
IdentityStoreStub — the same two operations, no database, no driver |
| over a pool | the variable names a database | IdentityStore(pool=…) — one connection borrowed per call |
The pool is created once when the service starts and closed when it stops. An MCP
service has no request-scoped startup hook, but its server has one, so both
transports pass the same pool_lifespan to build() — no wrapper to write.
# Database-free: answers from memory; needs no PostgreSQL and no driver.
uv run uvicorn aoa.demo.fastapi_mcp_services.app_fastapi_service:app --port 8000
# Over a pool: install the extra and name the database.
uv add "aoa-demo[postgres]"
AOA_DEMO_POSTGRES_DSN=postgresql://user:pass@localhost/db \
uv run uvicorn aoa.demo.fastapi_mcp_services.app_fastapi_service:app --port 8000
The pool states its size bounds (min_size=1, max_size=10) where it is created; the
wait for a free connection is bounded on the resource
(IdentityStore.acquire_timeout = 30.0), because create_pool has no such parameter
— a timeout= there would bound connecting, not waiting.
What each mode is for, and what the resource does with its connection, is in
src/aoa/demo/model/identity/README.md.
Its graph history
The demo keeps its graph in graph.json, rebuilt by graph-builder write with every change of its model, so the file's git history is the graph's history. Paste this link into Maxitor's AOA Service URL field to walk through it, compare any two versions, and see the open pull requests after the newest one:
https://github.com/bystrovmaxim/aoa/blob/main/packages/aoa-demo/graph.json?version_link=https%3A%2F%2Fgithub.com%2Fbystrovmaxim%2Faoa%2Fblob%2Fmain%2Fpackages%2Faoa-demo%2Fpyproject.toml&version_key=project.version
The version under each point comes from this package's pyproject.toml. How to read the track is in Open a service's graph history.
Metadata
Release files for aoa-demo 3.7.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 |
|---|---|---|---|---|
| aoa_demo-3.7.0.tar.gz | 134.2 kB | Without provenance | Details for aoa_demo-3.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aoa_demo-3.7.0-py3-none-any.whl | Python 3 | none | any | Details for aoa_demo-3.7.0-py3-none-any.whl |
Total release size: 506.7 kB
Release files / aoa_demo-3.7.0.tar.gz
| Download URL | aoa_demo-3.7.0.tar.gz |
|---|---|
| Size | 134.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a5bee4efcb28de60e1ec22174017c1404bcec6dacbb55576bb6aab42f7416bba
|
|
BLAKE2b-256 checksum How to use checksums |
66a1dd74a1089ecdbc5fe1926a01f1ea3d98fcf4fc23928e85f5a798eb82a4c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / aoa_demo-3.7.0-py3-none-any.whl
| Download URL | aoa_demo-3.7.0-py3-none-any.whl |
|---|---|
| Size | 372.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6b6b74515720e819ef06f48a9b0784edced3be0d8b839e926eed0dfb0dbe99fa
|
|
BLAKE2b-256 checksum How to use checksums |
5eefdacf0883749351cb4a044f1b1f26c39eac9a515d2dc8eebae0c8e787e842
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for aoa-demo 3.7.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.