Skip to main content

Dhenara Agent DSL (DAD)

⚠️ Status: Deprecated

This package is no longer actively developed. Development has moved to Dhenara AILoop (DIAL), which provides a cleaner, more explicit execution model.

Existing users may continue using this package as-is.

Overview

Dhenara Agent DSL (DAD) is an open-source framework built on top of the dhenara-ai Python package. It provides a powerful, expressive, and type-safe domain-specific language (DSL) for defining and executing AI agent workflows. DAD makes it easier to create, compose, and orchestrate AI agents with sophisticated behaviors, while maintaining robust observability and reproducibility.

For full documentation, visit docs.dhenara.com.

What is Dhenara Agent DSL?

Dhenara Agent DSL or DAD (available as a Python package named dhenara-agent) is an AI agent framework with a strong focus on:

  1. Expressive Agent Definition: Create complex agent workflows using a straightforward, programming language-like approach
  2. Component-Based Architecture: Compose reusable components to build sophisticated agent systems
  3. Out-of-the-box Support for Multiple LLMs: Switch between different LLM models on the fly
  4. Comprehensive Observability: Built-in logging, tracing, and metrics collection for all agent activities using OpenTelemetry and open-source exporters like Zipkin and Jaeger
  5. Reproducible Execution: Track and replay agent execution through a run context system, reducing costs by rerunning failed flows without additional AI Model API calls
  6. Extensible Node System: Easily create custom node types to extend functionality
  7. Resource Management: Flexible management of AI model resources and credentials

Installation

You can install the Dhenara Agent DSL framework using uv:

uv pip install dhenara-agent

Core Concepts

Basic Elements

DAD uses a hierarchical component model that allows for composition and reuse. It is built around three primary types of components:

  • Execution Nodes: Atomic execution units that perform specific functions (e.g., making an LLM API call, analyzing a folder, performing file operations like creating/updating files)
  • Execution Flows: Collections of nodes or sub-flows with execution logic, supporting sequential execution, conditionals, and loops
  • Agents: Higher-level abstractions that can contain flows and other agents, representing complete functional units

Event-Driven Architecture

An event system enables loose coupling between components, allowing agents to react to events, request inputs, and communicate with each other without tight coupling.

Powerful Template Engine

A powerful template engine supports variable substitution, expressions, and hierarchical references, making it easy to build dynamic prompts and process responses.

Execution Model

The execution follows a hierarchical structure:

  1. Components (Agents or Flows) define the overall structure
  2. Nodes within components perform specific tasks
  3. A RunContext manages the execution environment
  4. Tracing, logging, and metrics provide visibility into execution

Resource Management

DAD provides a flexible system for managing AI model resources and API credentials, making it easier to work with different LLM providers and models.

Usage Examples

Basic Example

Here's a simple example of defining a flow using DAD:

from dhenara.agent.dsl import (
    AIModelNode,
    AIModelNodeSettings,
    FlowDefinition,
    ResourceConfigItem,
)
from dhenara.ai.types import Prompt

# Define a flow
my_flow = FlowDefinition()

# Add an AI model node to the flow
my_flow.node(
    "question_answerer",
    AIModelNode(
        resources=ResourceConfigItem.with_model("claude-3-5-haiku"),
        settings=AIModelNodeSettings(
            system_instructions=["You are a helpful assistant."],
            prompt=Prompt.with_dad_text("Answer the following question: $var{question}"),
        ),
    ),
)

Documentation

For comprehensive documentation including tutorials, API reference, and advanced usage examples, visit docs.dhenara.com.

Metadata

Release files for dhenara-agent 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dhenara-agent 0.3.4
File Size Uploaded
dhenara_agent-0.3.4.tar.gz 165.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dhenara-agent 0.3.4
File Interpreter ABI Platform
dhenara_agent-0.3.4-py3-none-any.whl Python 3 none any Details

Total release size: 397.8 kB

Release files / dhenara_agent-0.3.4.tar.gz

Download URL dhenara_agent-0.3.4.tar.gz
Size 165.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0d582a6e57ce7aee7e828eb51ed1494b3e278aeed0ae1bac1b89e25a5e1c373d
BLAKE2b-256 checksum
How to use checksums
35932816028ea0155b46592b828b4804dbb91a9393d08b2cf45c3704c32ccf7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.2

Release files / dhenara_agent-0.3.4-py3-none-any.whl

Download URL dhenara_agent-0.3.4-py3-none-any.whl
Size 232.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
77e1ee8a74a4b1dd0da7810ce28ce5e62b1958a6f90d029f9db96795512138ed
BLAKE2b-256 checksum
How to use checksums
4eb3d93379f79e148af989e6b91145f383b877acf8e46d0b69550ee190c00f20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.2

Release history Release notifications | RSS feed

This release

0.3.4 This release

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page