DAGonLayer | A Configuration-Driven, Deterministic, Multi-Agent Engine
📂 Lightweight Data-Driven Multi-Agent Orchestrator
A minimalist, high-performance, prototype Python framework for orchestrating specialized multi-agent workflows. By pairing a Strict Configuration-Driven Scheduler with an immutable Unified Provenance Graph, this architecture eliminates conversational prompt drift, slashes token overhead, and provides a reliable execution audit trail.
🚀 Key Framework Features
- 📜 Configuration-Driven Routing (YAML): No nested Python if/elif statements. Workflows, edge transitions, and states are defined completely in a declarative YAML file.
- 🛡️ Boundary Protection (Pydantic Guards): Every agent output is tightly validated against strict types before it hits the state layer. Malformed LLM outputs are caught and blocked at the runtime border.
- 🔄 Automated Self-Healing Loop: If an LLM breaks a Pydantic validation rule, the framework captures the structural error message and funnels it back to the agent with instructions to rewrite the response.
- 👥 First-Class Human Intervention (HITL): When agents exhaust their max retries, tasks gracefully route to human queues using identical context-mapping logic—preventing system crashes.
- 🔀 Conditional Expressions: Workflows branch dynamically based on payload evaluation metrics (e.g., checking score values or quality metrics).
- ⚡ Asynchronous Concurrency: Built from the ground up using asyncio to execute thousands of unique workflows in parallel without thread-locking or data cross-contamination.
🛠️ Complete Usage Guide
1. Define the Workflow Configuration (workflow.yml)
The current workflow.yml is the declarative state machine for the engine. It defines state transitions, context_mapping, agent bindings, retry caps, routing rules, and terminal states.
2. Run the Entry Point (main.py)
The refactor splits the runtime into focused modules and uses main.py as the bootstrapper.
pip install -r requirements.txt
python main.py
2.1 Package Installation
Install the package locally for importable reuse and CLI execution:
pip install -e .
python -m dagonlayer
2.2 Environment Configuration
Use environment variables to configure model selection, logging, tracing, and workflow file path.
export WORKFLOW_FILE=workflow.yml
export MODEL_ID=openai:gpt-4
export ENABLE_LOGGING=true
export ENABLE_TRACING=true
python -m dagonlayer
3. How the Engine Works
config.pyloads the workflow definition from YAML.orchestrator.pyevaluates states, executes agents, validates outputs, and routes workflow transitions.agents.pycontains thePydanticAIRegistryand mock agent implementations, with clear hooks for real Pydantic AI integration.schemas.pydefines strict output contracts and exposesSCHEMA_REGISTRYfor runtime validation.provenance.pycaptures an immutable audit trail for each workflow event.observability.pyinstruments execution with logging and trace spans.
📊 Architectural Trade-off Matrix
This grid reflects our engineering choices to maintain maximum isolation, token efficiency, and deterministic predictability versus mainstream multi-agent design alternatives.
| Architectural Vector | Choice Made in Framework | Core Strengths | Operational Cost / Vulnerabilities | Practical Alternatives |
|---|---|---|---|---|
| State Tracking Pattern | Immutable Unified Provenance Graph | • Absolute auditing records • Zero tracking state loss • Trivial local troubleshooting playback. | • Memory arrays expand infinitely unless compacted or dropped to disk database lakes. | Dynamic Chat Logs / Blackboard Systems: High operational token drift and easy vector history pollution. |
| Orchestration / Task Routing | Strict External YAML Scheduler | • 100% predictable workflows • Simple, human-readable pipelines • Zero router model overhead costs. | • Brittle when coping with unstructured or random, exploratory workflows. | Autonomous Router Prompts / Swarms: Agents dynamically decide who handles tasks using semantic similarity matches. |
| Agent Input Boundary Interface | Isolated Context Extractor Mapping | • Minimal token windows • Eliminates downstream data leakage or noise hallucinations. | • Tangential, unmapped findings discovered during execution are thrown away. | Shared Context Windows: Entire conversation log maps into every agent call, dramatically expanding context windows. |
| Boundary Protection Strategy | Strict Pydantic Schema Guards | • Fail-safe data pipelines • Automated regex, range, and type validation rules. | • Demands up-front data design models; system halts if unforeseen schemas appear. | Freeform Markdown Text Responses: High processing failure rates down the pipeline due to unparseable response formatting. |
🗺️ Future Roadmap Suggestions
📦 Phase 0: Package and Stabilize the Refactor
- Create a package entrypoint around
main.pyand expose the orchestrator as a reusable module. - Add environment configuration for model selection, API keys, and runtime options.
- Verify the new file-level design with stronger tests and clear module contracts.
📈 Phase 1: Real Pydantic AI and Production Integration
- Replace mocked agent implementations in
agents.pywith realpydantic_aiagent instances. - Add optional model configuration so the registry can target
openai:gpt-4,anthropic:claude-3, or similar backends. - Extend observability to export traces to a production telemetry backend.
🧠 Phase 2: Persistence and Human Workflow Support
- Add an async persistent store for provenance events so long-running workflows survive restarts.
- Build an actual human intervention queue and callback workflow for
HUMAN_INTERVENTIONstate. - Add webhook/event broker integration so manual review requests can be sent and resumed from external systems.
🤝 Advancing the Architecture
This project is a modular prototype built to move beyond a single-file proof of concept. The current refactor makes it easier to extend, validate, test, and eventually connect to real LLMs and production telemetry.
Metadata
Release files for dagonlayer 0.1.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 | |
|---|---|---|---|---|
| dagonlayer-0.1.0.tar.gz | 15.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dagonlayer-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.9 kB
Release files / dagonlayer-0.1.0.tar.gz
| Download URL | dagonlayer-0.1.0.tar.gz |
|---|---|
| Size | 15.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0e24d79c33dc619cffe39c6d3bbfb47787af3bee2e50bc22238356592f7745a
|
|
BLAKE2b-256 checksum How to use checksums |
304caf84701df107cc5526744498e298094008ce52ef0075e021a22226d5f89e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.
Transparency logRelease files / dagonlayer-0.1.0-py3-none-any.whl
| Download URL | dagonlayer-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
99f2d363855bf9925c72e32b665909db996d8c3417e6e55eb0ed54dc440e7e37
|
|
BLAKE2b-256 checksum How to use checksums |
4af7016e956b72f3a55e323396cc2ce4625d978cf6bc45dc8c78fc1d80312235
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.
Transparency logSecurity for dagonlayer 0.1.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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for dagonlayer-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.
Transparency logA 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.