
Dana β The Agent-Native Evolution of AI Development¶
Beyond AI coding assistants: Write agents that learn, adapt, and improve themselves in production
What if your code could learn, adapt, and improve itself in productionβwithout you?
AI coding assistants help write better code. Agentic AI systems execute tasks autonomously. Dana represents the convergence: agent-native programming where you write agent
instead of class
, use context-aware reason()
calls that intelligently adapt their output types, compose self-improving pipelines with |
operators, and deploy functions that learn from production through POET.
Welcome to the engineering guide for Dana! This is your comprehensive resource for building agent-native applications, from quick 5-minute demos to production enterprise deployments.
OpenDXA¶
Get from zero to working agent in 15 minutes with the agent-native framework.
The next evolution beyond AI coding assistants and traditional agents: write agent
instead of class
, use context-aware reason()
that adapts output types automatically, and deploy self-improving functions.
- 5-Minute Setup - Install and verify OpenDXA
- Build Your First Agent - Working code in 10 minutes
- Dana Language Basics - Essential syntax reference
- Structs and Methods Guide - Complete struct system guide
π Common Tasks¶
Jump directly to solutions for typical engineering problems.
- Build a Chatbot - Customer service, FAQ, conversational AI
- π Process Documents - Extract, analyze, transform content
- Create Workflows - Multi-step automated processes
- Integrate APIs - Connect external services
- Struct Patterns Cookbook - Real-world struct patterns and examples
- Debug Issues - Common problems and solutions
Reference¶
Quick lookup for syntax, functions, and commands.
- Dana Language Reference - Complete syntax guide
- Structs and Methods Guide - Comprehensive struct system reference
- API Reference - All available functions with examples
- REPL Commands - Interactive development environment
- Troubleshooting - Common problems and solutions
By Experience Level¶
- New to OpenDXA: Start with Getting Started
- Experienced Developer: Jump to Common Tasks
- Debugging Issue: Check Troubleshooting
What Makes OpenDXA Different¶
OpenDXA's agent-native architecture represents the convergence of AI coding assistance and autonomous systems:
- Transparent: Every step is visible and debuggable
- Reliable: Built-in verification and error correction
- Fast: Dramatically reduced development time
- Collaborative: Share and reuse working solutions
- Agent-Native: Purpose-built for multi-agent systems with first-class agent primitives
- Context-Aware:
reason()
calls that intelligently adapt their output types - Self-Improving: Functions that learn and optimize through POET
Core Concepts for Engineers¶
Agent-Native Programming¶
Write agents as first-class primitives, not classes:
# Traditional approach
class DataProcessor:
def analyze(self, data):
return static_analysis(data)
# OpenDXA: Native agent that improves over time
agent DataProcessor:
def analyze(self, data):
insights: dict = reason("analyze patterns", context=data) # Type adapts automatically
return insights # Function learns via POET
Context-Aware Execution¶
Same reasoning, different output types based on usage:
# Intelligence adapts to what you need
risk_score: float = reason("assess portfolio risk", context=portfolio)
risk_details: dict = reason("assess portfolio risk", context=portfolio)
risk_report: str = reason("assess portfolio risk", context=portfolio)
Self-Improving Pipelines¶
Compositional operations that optimize themselves:
# Pipeline that gets smarter over time
portfolio | risk_assessment | recommendation_engine | reporting
# Each stage learns and improves via POET
Dana Language¶
Dana is the heart of OpenDXA - an agent-native language designed specifically for AI automation:
# Load data and analyze
documents = load_documents("contracts/*")
key_points = reason("Extract key terms from {documents}")
summary = reason("Summarize findings: {key_points}")
# Structured data with AI integration
struct Customer:
name: str
email: str
risk_level: str
def assess_risk(customer: Customer) -> str:
return reason("Assess customer risk level", context=customer)
customer = Customer(name="Alice", email="alice@example.com", risk_level="")
risk = customer.assess_risk() # Method syntax sugar
Agent Architecture¶
Build structured agents with clear capabilities using agent-native design patterns:
# Define agent with specific capabilities
agent = Agent("contract_analyzer")
.with_capabilities(["document_processing", "legal_analysis"])
.with_resources(["legal_kb", "contract_templates"])
State Management¶
Clear, scoped state that's always inspectable:
# Organized state scopes
current_task = "contract_review" # Auto-scoped to local (preferred)
private:analysis_results = review_contract(document) # Agent-specific data
public:completion_status = "ready" # Shared state
π¦ Getting Started Paths¶
Path 1: Quick Demo (5 minutes)¶
Path 2: Build from Scratch (15 minutes)¶
Path 3: Migrate Existing Code (30 minutes)¶
- Migration Guide
- Converting LLM calls to Dana (see recipes)
- Testing and validation (see troubleshooting)
π Complete Documentation Tree¶
for-engineers/
βββ setup/
β βββ installation.md # Complete installation guide
β βββ configuration.md # Environment setup
β βββ verification.md # Test your installation
β βββ migration-guide.md # Migrate from other frameworks
βββ recipes/
β βββ first-agent.md # Your first working agent
β βββ chatbot/README.md # Build conversational agents
β βββ document-processor/README.md # Process and analyze documents
β βββ workflow-agent/README.md # Multi-step automation
β βββ api-integration/README.md # Connect external services
β βββ structs-cookbook.md # Real-world struct patterns and examples
β βββ README.md # Recipe guides
βββ reference/
β βββ dana-syntax.md # Complete Dana language reference
β βββ structs-and-methods.md # Comprehensive struct system guide
β βββ functions.md # All available functions
β βββ repl-guide.md # Interactive development
β βββ agent-api.md # Agent configuration API
β βββ state-management.md # State scopes and management
βββ troubleshooting/README.md
βββ common-issues.md # Frequent problems and solutions
βββ README.md # Troubleshooting guide
Ready to build? Start with Getting Started or jump to Common Tasks
Quick Examples¶
Basic Dana Script¶
# Simple reasoning and logging
name = "OpenDXA Agent"
analysis = reason("What are the key benefits of this system?", context=specs)
log.info(f"Analysis complete for {name}")
# Load knowledge and process data
use("kb.finance.risk_assessment")
risk_level = reason("Assess portfolio risk", context=portfolio_data)
Object Method Calls & MCP Integration (NEW)¶
# Connect to MCP services and call methods
websearch = use("mcp", url="http://localhost:8880/websearch")
tools = websearch.list_tools()
results = websearch.search("OpenDXA documentation")
# A2A Agent integration
analyst = use("a2a.research-agent")
market_analysis = analyst.analyze_trends(financial_data)
report = analyst.generate_report(market_analysis)
# Resource management with 'with' statements
with use("mcp.database") as database:
users = database.query("SELECT * FROM active_users")
database.update_analytics(users)
Advanced Control Flow¶
# Process multiple data sources
data_sources = ["api", "database", "files"]
for source in data_sources:
if source == "api":
raw_data = fetch_api_data()
elif source == "database":
raw_data = query_database()
else:
raw_data = load_file_data()
processed = reason("Clean and validate data", context=raw_data)
results[source] = processed
π― Core Concepts¶
Ready to build? Start with Getting Started or jump to Common Tasks
Copyright Β© 2025 Aitomatic, Inc. Licensed under the MIT License.
https://aitomatic.com