dendrux
v0.5.0Get started →

Every public symbol Dendrux exports, grouped by area, with its import path and a one-line description. The map for navigating the rest of the docs.

API glossary

This is the full public surface of Dendrux: everything you import in normal use. Each entry links to the page that explains it in depth. If a symbol is not listed here, treat it as internal and subject to change.

Core

SymbolImportWhat it is
Agentfrom dendrux import AgentThe agent: definition + runtime facade. See Agent.
toolfrom dendrux import toolDecorator that turns an async function into a tool.
Budgetfrom dendrux import BudgetPer-run token and dollar limits with optional pause or cancel, counting delegated children. See Budget.
heartbeat / aheartbeatfrom dendrux import heartbeat, aheartbeatCall from inside a long-running tool to refresh persisted progress and reduce the risk of the stale sweep reaping the run (best-effort; no-op outside a persisted run). See State persistence.
runfrom dendrux import runLow-level functional runner behind Agent.run (advanced use).
sweepfrom dendrux import sweepOne-shot reconciliation of stale/abandoned runs (you schedule it).
Limitsfrom dendrux import LimitsSize caps for Agent(limits=...): max_tool_result_bytes, max_input_bytes, max_metadata_bytes, max_notes_per_run. See Agent.
UNSCOPEDfrom dendrux import UNSCOPEDThe "every tenant" scope for reads and run-control writes; None means untenanted only. See Multi-tenancy.

Loops

SymbolImportWhat it is
ReActLoopfrom dendrux.loops import ReActLoopDefault loop: think, act, observe, repeat. See Loops.
SingleCallfrom dendrux import SingleCallOne LLM call, no tools, supports output_type.
Loopfrom dendrux.loops import LoopBase class for custom loops.

Chat history

SymbolImportWhat it is
ChatMessagefrom dendrux.chat import ChatMessageOne prior turn passed via history=. See Chatbot threads.
ChatRolefrom dendrux.chat import ChatRoleUSER or ASSISTANT.

Providers

SymbolImportWhat it is
AnthropicProviderfrom dendrux.llm.anthropic import AnthropicProviderAnthropic Messages API provider. All providers take call_timeout, stream_idle_timeout and stream_total_timeout. See Handling provider errors.
OpenAIProviderfrom dendrux.llm.openai import OpenAIProviderOpenAI Chat Completions provider.
OpenAIResponsesProviderfrom dendrux.llm.openai_responses import OpenAIResponsesProviderOpenAI Responses API provider (built-in tools).

Caching is automatic for all built-in providers. See Prompt cache.

Guardrails

SymbolImportWhat it is
PIIfrom dendrux.guardrails import PIIRedact/block/warn on PII (regex or Presidio). restore="all" or "allowlisted" chooses which tools get real values back. See Guardrails and PII restore.
SecretDetectionfrom dendrux.guardrails import SecretDetectionBlock on leaked secrets (AWS keys, tokens, PEM).
PromptInjectionfrom dendrux.guardrails import PromptInjectionRegex injection guard (you supply patterns). See Patterns.
Patternfrom dendrux.guardrails import PatternA named regex Pattern(name, regex).
Guardrailfrom dendrux.guardrails import GuardrailProtocol for custom guardrails (async scan(text)).
Findingfrom dendrux.guardrails import FindingOne detection: entity type, span, score, text (in process only; events and errors carry the kind, count and location, never the text).
ImageGuardrail / ImageScanInputfrom dendrux.guardrails import ImageGuardrail, ImageScanInputOpt-in protocol for guardrails that scan images (async scan_image(image)). See Images.

Images

SymbolImportWhat it is
Imagefrom dendrux.media import Image (also importable from dendrux)An image input: from_bytes, from_path, from_base64, from_url. Accepted in user_input, ChatMessage.user, ToolOutput and ToolResult.images.
ToolOutputfrom dendrux.media import ToolOutput (also importable from dendrux)What a server @tool returns to attach images: ToolOutput(result, images=[...]).
ImageRef / ImagePart / TextPartfrom dendrux import ImageRef, ImagePart, TextPartA stored image's descriptor, and the ordered parts of a multimodal Message.parts.
ImagePolicy / ImageDropPolicy / UrlPolicyfrom dendrux.media import ImagePolicy, ImageDropPolicy, UrlPolicyAgent(images=...): caps, non-vision behaviour, the drop-old-images window, URL fetching and the ingest hook.
BlobStore / BlobKey / InMemoryBlobStorefrom dendrux.media import BlobStore, BlobKey, InMemoryBlobStoreThe byte-storage protocol for Agent(blob_store=...). See S3 recipe.
agent.blobsAgent.blobsread, info, references, purge and collect_garbage for stored images.

The guide is Images.

Notifiers

SymbolImportWhat it is
ConsoleNotifierfrom dendrux.notifiers import ConsoleNotifierRich terminal output. See Notifier.
CompositeNotifierfrom dendrux.notifiers import CompositeNotifierFan one event set out to many notifiers.
OpenTelemetryNotifierfrom dendrux.notifiers.otel import OpenTelemetryNotifierGenAI-semconv spans. See OpenTelemetry.
BaseNotifierfrom dendrux.loops.base import BaseNotifierNo-op base to subclass for custom notifiers.

Persistence and reads

SymbolImportWhat it is
RunStorefrom dendrux.store import RunStoreRead-only facade over the six tables. See RunStore.
PendingPause / PendingToolCallfrom dendrux.store import PendingPause, PendingToolCallWhat a paused run waits on, from RunStore.get_pending. See Build your own read routes.
Follow / FollowEnd / FollowHeartbeat / FollowCapacityError / EventFeedfrom dendrux.store import ...The hardened live feed behind RunStore.follow.
redact_eventfrom dendrux.store import redact_eventConservative standalone event projection; use RunStore.get_event_view for verified active approval arguments. See redacted views.
EventFeed(store, max_followers=, max_followers_per_tenant=)from dendrux.store import EventFeedBuild your own feed when you need other follower caps (500 per store and 100 per tenant scope by default).
tool_pool_statsfrom dendrux import tool_pool_statsProcess-wide tool threads, queued calls and timed-out calls still running.

RunStore read methods return these record types (all from dendrux.store): RunSummary, RunDetail, StoredEvent, LLMCall, ToolInvocation, TraceEntry, PausePair, plus RunSubtree, SubtreeNode, RunUsage (from get_subtree) and RunNote (from get_notes). Fields are documented on the RunStore page.

Tool sources

SymbolImportWhat it is
MCPSourcefrom dendrux.mcp import MCPSourceImmutable HTTP or stdio source configuration. See MCP.
MCPRuntimefrom dendrux.mcp import MCPRuntimeProcess-wide managed owner of MCP connections: tenancy, capacity, circuit breaking, telemetry. Recommended for production.
MCPConnectionruntime.bind(...) / await runtime.rebind(...)Lazy handle for one (tenant_key, connection_key) identity; connection.tools() creates agent views, await connection.discover() returns the server's catalog without an Agent.
MCPDiscoveryLimitError / MCPInvalidToolSchemaErrorfrom dendrux.mcp import MCPDiscoveryLimitError, MCPInvalidToolSchemaErrortools/list passed a page, tool, byte, cursor or time bound (code discovery_limit); a strict view found a malformed argument schema (code invalid_tool_schema). See MCP: discovery limits.
MCPToolNotFoundErrorfrom dendrux.mcp import MCPToolNotFoundErrorRaised by await connection.call_tool(name, arguments) for a tool the server does not list. call_tool runs a server tool directly and bypasses Agent governance; see MCP.
MCPDiscoveryawait connection.discover()Server name, version, protocol version, instructions, and the raw MCPToolInfo catalog of one connection.
MCPToolViewconnection.tools(...)Namespace and tool policy one agent consumes via tool_sources=.
MCPCredentialProviderfrom dendrux.mcp import MCPCredentialProviderAsync protocol returning per-connect authentication (headers or env); resolved lazily, never persisted.
MCPRuntimeObserverfrom dendrux.mcp import MCPRuntimeObserverSync callback protocol receiving typed runtime lifecycle events; pair with runtime.snapshot().
MCPHostfrom dendrux.mcp import MCPHostApplication-owned connections shared across a few agents, without tenancy or capacity; prefer MCPRuntime in services.
MCPServerfrom dendrux.mcp import MCPServerBackward-compatible source facade; prefer MCPSource in new code.

Result and event types

SymbolImportWhat it is
RunResultfrom dendrux.types import RunResultReturned by run/resume/submit_*/cancel_run/get_result. Fields include error_info, pause_id and pending; to_dict() is the versioned browser envelope. See RunResult.
ErrorInfofrom dendrux import ErrorInfoThe safe, structured summary of a provider failure on RunResult.error_info and RunDetail.error_info. See Handling provider errors.
RunStatusfrom dendrux.types import RunStatuspending, running, waiting_*, paused, success, error, cancelled, max_iterations.
StopReasonfrom dendrux import StopReasonWhy the final LLM call stopped: end_turn, tool_use, max_tokens, stop_sequence, content_filter, refusal, pause_turn, other. On RunResult.stop_reason; RunResult.truncated is true for max_tokens. See Truncated answers.
RunStreamfrom dendrux.types import RunStreamAsync iterable returned by stream()/resume_stream().
RunEvent / RunEventTypefrom dendrux.types import RunEvent, RunEventTypeStreaming events (text_delta, tool_use_*, run_*).
ToolResultfrom dendrux.types import ToolResultA tool result you submit via submit_tool_results. ToolResult.from_dict and list_from_dict validate results that arrive from a browser.
InputValidationErrorfrom dendrux.types import InputValidationErrorA ValueError for a value Dendrux cannot accept or store, or an approval with no expected_pause_id; carries a fixed field and code.
ToolResultContext / ToolResultTransformfrom dendrux import ToolResultContext, ToolResultTransformInput and type of Agent(tool_result_transform=...). See Transforming tool results.
GovernanceEventTypefrom dendrux import GovernanceEventTypeThe 33 governance event types. See Governance.
ApprovalDecisionfrom dendrux import ApprovalDecisionOne human decision for submit_approval(decisions=...): approve() or deny(reason). See Approval.
ToolCallContext / ToolDecision / BeforeToolHookfrom dendrux import ToolCallContext, ToolDecision, BeforeToolHookInput, verdict and type of Agent(before_tool=...). See Tool policy hook.
PauseOutcomefrom dendrux import PauseOutcomeReturned by agent.request_pause: root status before/after and each affected run. See Pause and resume.
CreateRunResultfrom dendrux import CreateRunResultIdempotent-create outcome.

Errors

Run-control, skill-continuity, schema, and context-length exceptions live in dendrux.errors; common ones are re-exported from dendrux. MCP exceptions live in dendrux.mcp, RunStore read errors in dendrux.store, and several validation/idempotency exceptions are exported from dendrux. Full table with when-raised and suggested HTTP mappings on the Errors page: RunNotFoundError, RunNotPausedError, PauseStatusMismatchError, RunAlreadyClaimedError, RunAlreadyTerminalError, InvalidToolResultError, PersistenceNotConfiguredError, SchemaNotInitializedError, SchemaOutOfDateError, ContextLengthExceededError. Plus RunAlreadyActiveError, IdempotencyConflictError, StructuredOutputValidationError, DelegationDepthExceededError from dendrux. New in 0.5.0, also from dendrux: ProviderError and its subclasses (ProviderAuthError, ProviderRateLimitError, ProviderTimeoutError, ProviderUnavailableError, ProviderStreamIncompleteError, ModelRefusalError, ContentFilteredError), BudgetConfigurationError, TenantScopeRequiredError, GovernanceMismatchError and NoteLimitExceededError.

Where to go next