Contributing to DAO¶

Thank you for your interest in contributing to DAO! This guide will help you get started.
Project Structure¶
dao-ai/
├── src/dao_ai/
│ ├── config.py # Pydantic configuration models
│ ├── graph.py # LangGraph workflow builder
│ ├── nodes.py # Agent node factories
│ ├── state.py # State management
│ ├── tools/ # Tool implementations
│ │ ├── genie.py # Genie tool with caching
│ │ ├── mcp.py # MCP integrations
│ │ ├── vector_search.py
│ │ └── ...
│ ├── middleware/ # Agent middleware
│ │ ├── assertions.py # Assert, Suggest, Refine middleware
│ │ ├── summarization.py # Conversation summarization
│ │ ├── guardrails.py # MLflow judge-based guardrails, content filtering, and safety
│ │ ├── memory_context.py # Auto-injection of long-term memories into prompts
│ │ └── ...
│ ├── orchestration/ # Multi-agent orchestration
│ │ ├── supervisor.py # Supervisor pattern
│ │ ├── swarm.py # Swarm pattern
│ │ └── ...
│ ├── genie/
│ │ └── cache/ # LRU and Context-Aware cache
│ ├── memory/ # Checkpointer, store, schemas, and extraction
│ └── hooks/ # Lifecycle hooks
├── config/
│ ├── examples/ # Example configurations
│ └── hardware_store/ # Reference implementation
├── tests/ # Test suite
└── schemas/ # JSON schemas for validation
Development Setup¶
Prerequisites¶
- Python 3.12 or newer
- Git
- Access to a Databricks workspace (for integration tests)
Installation¶
- Fork and clone the repository:
- Create a virtual environment:
# Using uv (recommended)
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Or using standard Python
python3 -m venv .venv
source .venv/bin/activate
- Install development dependencies:
Python 3.12+ required. On 3.11,
uvcan't install a recent transitivepyarrow(25.x) — its cp311 wheel trips auvwheel-parsing bug (Metadata field Name not found/Invalid Wheel-Version) that upgradinguvdoesn't fix; 3.12 uses a different, working wheel. ASyntaxError: source code string cannot contain null bytes(e.g. importinglanggraph) means a dependency file is corrupted from a failed install — rebuild clean:rm -rf .venv && uv cache clean && uv venv && make install.
Contributing Guidelines¶
1. Fork the Repository¶
Create a fork of the repository on GitHub and clone it locally.
2. Create a Feature Branch¶
Use descriptive branch names:
- feature/add-new-tool
- bugfix/fix-cache-issue
- docs/update-readme
3. Make Your Changes¶
- Follow the existing code style
- Add tests for new functionality
- Update documentation as needed
- Keep commits focused and atomic
4. Run Tests¶
# Run all tests
make test
# Run specific test file
pytest tests/test_config.py
# Run with coverage
pytest --cov=dao_ai tests/
5. Format Code¶
6. Update Documentation¶
- Update README.md if adding new features
- Add docstrings to new functions/classes
- Update configuration examples if needed
- Add entries to CHANGELOG.md
7. Submit a Pull Request¶
- Push your branch to your fork
- Open a pull request against the main repository
- Describe your changes clearly
- Reference any related issues
Code Style¶
Python Style Guide¶
- Follow PEP 8 guidelines
- Use type hints for function parameters and return values
- Write descriptive docstrings (Google style)
- Keep functions focused and small
Example:
def create_agent_tool(
config: AgentConfig,
workspace_client: WorkspaceClient,
) -> BaseTool:
"""
Create a tool that calls another agent endpoint.
Args:
config: Agent configuration
workspace_client: Databricks workspace client
Returns:
Configured tool instance
Raises:
ValueError: If configuration is invalid
"""
# Implementation
pass
YAML Configuration Style¶
- Use 2 spaces for indentation
- Keep configurations readable and well-commented
- Use anchors and references to avoid repetition
Example:
resources:
models:
default_llm: &default_llm
name: databricks-gpt-5-4-mini
temperature: 0.7
agents:
my_agent:
name: my_agent
model: *default_llm # Reference the anchor
Testing¶
Writing Tests¶
- Place tests in the
tests/directory - Mirror the source structure (e.g.,
tests/dao_ai/test_config.py) - Use pytest fixtures for common setup
- Mock external services (Databricks APIs, databases)
Example:
import pytest
from dao_ai.config import AppConfig
def test_load_config(tmp_path):
"""Test configuration loading from file."""
config_file = tmp_path / "config.yaml"
config_file.write_text("""
app:
name: test_agent
""")
config = AppConfig.from_file(str(config_file))
assert config.app.name == "test_agent"
Running Tests¶
# Run all tests
pytest
# Run specific test
pytest tests/test_config.py::test_load_config
# Run with verbose output
pytest -v
# Run with coverage report
pytest --cov=dao_ai --cov-report=html tests/
Adding New Features¶
Adding a New Tool¶
- Create tool module in
src/dao_ai/tools/ - Implement tool following LangChain patterns
- Add factory function if needed
- Add tests in
tests/dao_ai/tools/ - Add example configuration in appropriate
examples/category - Update documentation
Adding New Middleware¶
- Create middleware in
src/dao_ai/middleware/ - Inherit from
BaseMiddleware - Implement required methods
- Add tests
- Add configuration example
- Document usage
Adding New Orchestration Pattern¶
- Create module in
src/dao_ai/orchestration/ - Implement pattern using LangGraph
- Add configuration model in
src/dao_ai/config.py - Add tests
- Add example configuration
- Document pattern
Documentation¶
Updating Documentation¶
- Main docs are in
docs/directory - Update relevant sections when adding features
- Include code examples
- Add diagrams if helpful (ASCII art or images)
Adding Examples¶
- Choose the appropriate category in
examples/based on primary feature demonstrated: 01_getting_started/- Foundation concepts for beginners02_tools/- Tool integrations (Genie, AI Search, Slack, MCP, etc.)04_genie/- Performance optimization strategies05_memory/- State management and persistence06_on_behalf_of_user/- User-level authentication and access control07_human_in_the_loop/- Approval workflows08_guardrails/- Safety and validation09_structured_output/- Enforce JSON schemas10_agent_integrations/- External agent platforms11_prompt_engineering/- Prompt management and optimization12_middleware/- Validation, logging, monitoring13_orchestration/- Multi-agent coordination patterns14_basic_tools/- Simple tool patterns-
99_complete_applications/- Full-featured, production-ready applications -
Use descriptive file names:
tool_name_variant.yaml(e.g.,slack_with_threads.yaml) -
Create your example config in the chosen category directory
-
Add entry to
docs/examples.mdin the appropriate category table -
Test the example thoroughly:
-
Add inline comments explaining key concepts and design decisions
-
Update the category README.md with prerequisites and usage notes
Release Process¶
Maintainers will handle releases, but here's the process:
- Update version in
pyproject.toml - Update
CHANGELOG.mdwith changes - Create git tag:
git tag v0.x.0 - Push tag:
git push origin v0.x.0 - GitHub Actions will build and publish
Getting Help¶
- Questions: Open a GitHub Discussion
- Bugs: Open a GitHub Issue
- Features: Open a GitHub Issue with [Feature Request] prefix
- Security: See SECURITY.md (if available) or email maintainers
Code of Conduct¶
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Help others learn and grow
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to DAO! 🎉