The runtime for agents that act in the real world.
Project description
dendrux
Python SDK for Dendrux — the framework for building agents with tools, persistence, and observability.
Version: 0.1.0a1
Install
pip install -e ".[all]" # Everything
pip install -e ".[anthropic,db]" # Just Anthropic + SQLite
pip install -e ".[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 main README for provider setup, configuration, database guide, CLI, dashboard, observer system, and examples.
Project details
Release history Release notifications | RSS feed
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.1.0a1.tar.gz
(1.3 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dendrux-0.1.0a1.tar.gz.
File metadata
- Download URL: dendrux-0.1.0a1.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4d3c05fa549b77cacbe1736ca069164d1ba336ab779a21482418786ed203d41
|
|
| MD5 |
ab6954150a6eb22ce7e6b60dd17ff864
|
|
| BLAKE2b-256 |
c94b3e2f9ebf544d7300010ad339b80171993d4365a72a253be3038cba4ee72f
|
File details
Details for the file dendrux-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: dendrux-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7eb13860b2d74e56097f093fd163c1c7da32f923ae8aa4585cdf7277fac377b0
|
|
| MD5 |
dafede739f0e4da4ecc395e8c3a9f717
|
|
| BLAKE2b-256 |
4f8d820508dcef173d520f973ccab9236a576113b4e07f8942f61c3a61309653
|