Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

dendrux

Python SDK for Dendrux — the framework for building agents with tools, persistence, and observability.

Version: 0.1.0a1

Install

pip install "dendrux[all]"              # Everything
pip install "dendrux[anthropic,db]"     # Just Anthropic + SQLite
pip install "dendrux[openai,db]"        # Just OpenAI + SQLite

Quick Example

import asyncio
from dendrux import Agent, tool
from dendrux.llm.anthropic import AnthropicProvider

@tool()
async def add(a: int, b: int) -> int:
    """Add two numbers."""
    return a + b

async def main():
    async with Agent(
        provider=AnthropicProvider(model="claude-sonnet-4-6"),
        prompt="You are a calculator.",
        tools=[add],
    ) as agent:
        result = await agent.run("What is 15 + 27?")
        print(result.answer)

asyncio.run(main())

Providers

Provider Import Use case
Anthropic from dendrux.llm.anthropic import AnthropicProvider Claude models
OpenAI from dendrux.llm.openai import OpenAIProvider GPT models + vLLM, SGLang, Groq, Ollama
OpenAI Responses from dendrux.llm.openai_responses import OpenAIResponsesProvider GPT + built-in tools (web search)
Mock from dendrux.llm.mock import MockLLM Deterministic testing

API Quick Reference

from pathlib import Path
from dendrux.observers.console import ConsoleObserver

async with Agent(
    provider=provider,                  # Required: LLM provider
    prompt="...",                        # Required: system prompt
    tools=[add],                         # Optional: tool functions
    database_url=f"sqlite+aiosqlite:///{Path.home() / '.dendrux' / 'dendrux.db'}",
    redact=my_scrubber,                  # Optional: scrub persisted strings
) as agent:
    result = await agent.run(
        "What is 15 + 27?",
        observer=ConsoleObserver(),      # Optional: terminal output
        tenant_id="org-123",             # Optional: multi-tenant isolation
        metadata={"thread": "t1"},       # Optional: your linking data
    )

RunResult

result.answer          # str | None — the agent's final answer
result.status          # RunStatus — SUCCESS, ERROR, MAX_ITERATIONS, WAITING_CLIENT_TOOL, CANCELLED
result.steps           # list[AgentStep] — full reasoning chain
result.iteration_count # int — how many loop iterations ran
result.usage           # UsageStats — input_tokens, output_tokens, total_tokens
result.run_id          # str — unique run identifier (ULID)
result.error           # str | None — error message if status is ERROR

Tool Options

@tool()                                  # Basic server tool
@tool(target="client")                   # Client-side — agent pauses
@tool(max_calls_per_run=3)               # Limit calls per run
@tool(timeout_seconds=120)               # Custom timeout (default 120s)
@tool(parallel=False)                    # Run alone, not concurrently

Full Documentation

See the full documentation on GitHub for provider setup, configuration, database guide, CLI, dashboard, observer system, and examples.

Download files

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

Source Distribution

dendrux-0.2.0a10.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

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

dendrux-0.2.0a10-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file dendrux-0.2.0a10.tar.gz.

File metadata

  • Download URL: dendrux-0.2.0a10.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for dendrux-0.2.0a10.tar.gz
Algorithm Hash digest
SHA256 0c93d03f5ede409a38fa456bca54768c8ef3f90558b64a0f58e093eed0857875
MD5 fd1534b3c7f94ec158260f5b8c7bb70a
BLAKE2b-256 0b3cd03f701a3085e82268b209b5663fcb7e9c3049995e0e9f40cf8b6ad70b1e

See more details on using hashes here.

File details

Details for the file dendrux-0.2.0a10-py3-none-any.whl.

File metadata

  • Download URL: dendrux-0.2.0a10-py3-none-any.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for dendrux-0.2.0a10-py3-none-any.whl
Algorithm Hash digest
SHA256 a4f5a24467bbc2633e3fb260b27639a56657ff3c8b025378c4c822bf5de18103
MD5 5ad2b8af10c36fea3bc05f9eed42070d
BLAKE2b-256 45a5490eeeadfeb288c7ddc06e57993adc700cf385082844854ccae9f90177ef

See more details on using hashes here.

Supported by

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