A configuration-driven, deterministic, multi-agent orchestration engine.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dagonlayer-0.1.0.tar.gz.
File metadata
- Download URL: dagonlayer-0.1.0.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0e24d79c33dc619cffe39c6d3bbfb47787af3bee2e50bc22238356592f7745a
|
|
| MD5 |
437237930b8c00961aca29fc8c8f135f
|
|
| BLAKE2b-256 |
304caf84701df107cc5526744498e298094008ce52ef0075e021a22226d5f89e
|
Provenance
The following attestation bundles were made for dagonlayer-0.1.0.tar.gz:
Publisher:
publish.yml on timBrockman/DAGonLayer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dagonlayer-0.1.0.tar.gz -
Subject digest:
b0e24d79c33dc619cffe39c6d3bbfb47787af3bee2e50bc22238356592f7745a - Sigstore transparency entry: 1757928150
- Sigstore integration time:
-
Permalink:
timBrockman/DAGonLayer@fffc51e0f6cc08f880e7f505899617f8b703d324 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/timBrockman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fffc51e0f6cc08f880e7f505899617f8b703d324 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file dagonlayer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dagonlayer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99f2d363855bf9925c72e32b665909db996d8c3417e6e55eb0ed54dc440e7e37
|
|
| MD5 |
81218ef6ca5e6b923c5ae35dd249f5c9
|
|
| BLAKE2b-256 |
4af7016e956b72f3a55e323396cc2ce4625d978cf6bc45dc8c78fc1d80312235
|
Provenance
The following attestation bundles were made for dagonlayer-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on timBrockman/DAGonLayer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dagonlayer-0.1.0-py3-none-any.whl -
Subject digest:
99f2d363855bf9925c72e32b665909db996d8c3417e6e55eb0ed54dc440e7e37 - Sigstore transparency entry: 1757928239
- Sigstore integration time:
-
Permalink:
timBrockman/DAGonLayer@fffc51e0f6cc08f880e7f505899617f8b703d324 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/timBrockman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fffc51e0f6cc08f880e7f505899617f8b703d324 -
Trigger Event:
workflow_dispatch
-
Statement type: