Observed since 20 Oct, 16:54 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Reference AAEP producer example — minimal implementation in pure Python
A minimal but complete AAEP producer implementation in Python. This example demonstrates the manual loop pattern from the Implementer's Guide §2.5 at production quality.
This is the reference example. If you're building an AAEP producer from scratch in Python without using a framework like LangChain, copy this code and adapt it. Every other example in this repository follows patterns established here.
aaep-conformance producer --level 2 test suite)This example does NOT include:
../python-langchain/)cd examples/producers/python-minimal
pip install -e .
Requires Python 3.10 or newer.
Start the producer server:
python -m aaep_minimal_producer.server --port 8080
In another terminal, run a session:
curl -X POST http://localhost:8080/sessions \
-H "Content-Type: application/json" \
-d '{"user_message": "Tell me about retirement planning."}'
Subscribe to events via SSE:
curl -N http://localhost:8080/events
You'll see properly-formatted AAEP events stream in real time.
Verify the example passes AAEP Conformance Level 2:
# Terminal 1: start the producer
python -m aaep_minimal_producer.server --port 8080
# Terminal 2: run conformance tests
aaep-conformance producer --endpoint http://localhost:8080 --level 2
Expected output: VERDICT: PASS. If you see anything else, please file a bug — this is the reference; it must pass.
python-minimal/
├── README.md
├── pyproject.toml
├── aaep_minimal_producer/
│ ├── __init__.py
│ ├── emitter.py # AAEPEmitter, StreamCoalescer, make_id
│ ├── agent.py # AgentLoop with full lifecycle
│ └── server.py # HTTP/SSE server
└── tests/
├── __init__.py
└── test_agent.py
The intent: someone reading this code top-to-bottom in an hour can understand exactly how AAEP is emitted. No magic, no framework wrappers, no implicit machinery.
AAEPEmitter is ~200 lines. It exposes one method per event type. You can read the whole thing in fifteen minutes.
There's no plugin system, no middleware chain, no decorator magic. If you want those, see the other examples — they each demonstrate one pattern. This one shows the underlying machinery directly.
AgentLoop.run() shows every state transition, every tool call cycle, every output emission. It's verbose by design — verbosity is the price of transparency.
If your agent has different needs (concurrent tools, recovery from failures, multi-turn within one session), you'll edit this loop. That's the point: it's a starting template, not a black box.
Every exception path in the loop emits agent.session.errored with the appropriate error_category and re-raises. A session that started MUST end with one of the three terminal event types. The conformance suite verifies this.
server.py is a working HTTP/SSE transport, but the agent logic doesn't depend on HTTP. If you need WebSockets, gRPC, or stdio JSON-RPC, replace server.py and the agent code works unchanged.
../python-langchain/ — same agent, LangChain callback pattern../python-anthropic-sdk/ — direct Anthropic SDK integration../typescript-minimal/ — equivalent in TypeScriptDownload counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.0 | 2 Jun 2026 | 6 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 16:54 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:747d9317a692ab61e43eb160dd20e958e63cd310c19f3f0247ae0f35aadd93e0