Skip to main content

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.py loads the workflow definition from YAML.
  • orchestrator.py evaluates states, executes agents, validates outputs, and routes workflow transitions.
  • agents.py contains the PydanticAIRegistry and mock agent implementations, with clear hooks for real Pydantic AI integration.
  • schemas.py defines strict output contracts and exposes SCHEMA_REGISTRY for runtime validation.
  • provenance.py captures an immutable audit trail for each workflow event.
  • observability.py instruments 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.py and 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.py with real pydantic_ai agent 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_INTERVENTION state.
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dagonlayer-0.1.0.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dagonlayer-0.1.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

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

Hashes for dagonlayer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b0e24d79c33dc619cffe39c6d3bbfb47787af3bee2e50bc22238356592f7745a
MD5 437237930b8c00961aca29fc8c8f135f
BLAKE2b-256 304caf84701df107cc5526744498e298094008ce52ef0075e021a22226d5f89e

See more details on using hashes here.

Provenance

The following attestation bundles were made for dagonlayer-0.1.0.tar.gz:

Publisher: publish.yml on timBrockman/DAGonLayer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for dagonlayer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99f2d363855bf9925c72e32b665909db996d8c3417e6e55eb0ed54dc440e7e37
MD5 81218ef6ca5e6b923c5ae35dd249f5c9
BLAKE2b-256 4af7016e956b72f3a55e323396cc2ce4625d978cf6bc45dc8c78fc1d80312235

See more details on using hashes here.

Provenance

The following attestation bundles were made for dagonlayer-0.1.0-py3-none-any.whl:

Publisher: publish.yml on timBrockman/DAGonLayer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page