Dynamiq
Examples

Examples

A categorized catalog of the runnable examples in the dynamiq repository — agents, orchestrators, RAG, tools, checkpoints, streaming, evaluations, and full use-case apps.

The dynamiq repository ships a large examples/ tree of runnable scripts. components/ demonstrates individual SDK features; use_cases/ contains end-to-end applications. Most scripts share the helper llm_setup.py, which builds an LLM node from a provider name (OpenAI, Anthropic, Cohere, Groq, or Gemini) — set the matching API key env var before running.

Agents

components/agents/agents/

ExampleWhat it shows
simple_agent_wf.pyA minimal simple-agent workflow.
reflection_agent_wf.pyThe reflection agent pattern — draft, critique, revise.
agent_wf.pyA ReAct Agent with tools inside a Workflow.
agent_multi_tool_workflow.pyOne agent coordinating multiple tools (plus a streaming variant).
agent_e2b_sandbox.pyAgent with an E2B sandbox: remote files plus shell execution.
agent_daytona_sandbox.pySame pattern on a Daytona sandbox backend.
agent_filesystem_interaction.pyAgent file-store usage: reading and writing files during a run.
use_agent_with_agent_tool.pyAgents as tools of other agents (sub-agents), with a memory variant.
use_agent_with_parallel_agent_tool.pyParallel sub-agent tool calls.
use_subagent_checkpoint.pyCheckpointing a multi-node agent flow and resuming after a simulated crash.
use_agent_with_error_handling.pyErrorHandling (timeouts, retries, backoff) on the LLM and the agent.
use_agents_vision.pyAgents over image inputs.
context_management_example.pyAgent context-window management.
use_agents_hidden_params.pyHiding or requiring tool parameters with input_param_modes.
agent_vector_store_write_pipeline.pyAgent-driven vector-store writes (also as a writer tool).
use_neo4j_text2cypher_workflow.pyText-to-Cypher agent over Neo4j.

Orchestrators

components/agents/orchestrators/graph_orchestrator/

ExampleWhat it shows
code_assistant.pyGraph orchestrator coordinating a coding workflow.
concierge_orchestration.pyRouting between specialist agents.
email_writer.pyMulti-step drafting flow as a state graph.
trip_planner_orchestration.pyMulti-agent trip planning.
graph_orchestrator_yaml.pyDefining a graph orchestrator in YAML.

See Orchestrators for the concepts.

Streaming

components/agents/streaming/ — per-agent-type streaming servers and clients (react/, simple/, reflection/), plus intermediate_streaming/ for step-by-step agent and orchestrator events. Lower-level transports live in components/core/websocket/: FastAPI WebSocket and SSE servers and Streamlit chat apps. Concepts: Streaming & Callbacks.

Human in the loop

components/tools/human_in_the_loop/

ExampleWhat it shows
confirmation_email_writer/consoleApproval gates answered in the console.
confirmation_email_writer/socketThe same approval flow over WebSockets.
streaming_orchestratorHITL feedback inside a streaming orchestrator.
streaming_post_writerStreaming generation with human feedback events.

Tools

components/tools/

ExampleWhat it shows
use_tavily.py, use_exa.py, use_serp.pyWeb search tools.
use_firecrawl.py, use_jina.pyScraping and content extraction tools.
use_python_node.py, use_http_api_node.py, use_sql.pyPython code, HTTP API call, and SQL nodes.
use_function_tool.pyWrapping plain functions with function_tool.
use_react_with_coding.py, use_react_search.py, use_react_fc.pyReAct agents with code execution, search, and function-calling inference.
custom_tools/Custom Node tools: calculator, file reader, scraper-summarizer.
mcp_server_as_tool/Using MCP servers as agent tools.
pipedream/Pipedream-connected tools (Jira, files, configurable props).
stagehand_tool/Browser automation with Stagehand, including file upload flows.
cua_desktop/, e2b_desktop_sandbox/Computer-use and desktop sandbox automation.
multi_file_type_converter/Routing mixed file types through converters.

Core: DAGs, YAML, checkpoints, tracing, cancellation

components/core/

AreaHighlights
dag/Building DAGs in code and loading them from YAML — LLM flows, fallbacks, MCP tools, agents with memory, skills, sandboxes, structured output. Pairs with YAML Workflows.
checkpoints/PostgreSQL-backed checkpointing: save per node, list, chain-walk, resume, cleanup. Pairs with Checkpoints.
memory/Agent memory on every backend: in-memory, SQLite, PostgreSQL, DynamoDB, Pinecone, Qdrant, Weaviate, Dynamiq. Pairs with Memory.
tracing/Langfuse and AgentOps tracing handlers, plus flow visualization. Pairs with Tracing to Dynamiq.
cancellation/Mid-run cancellation: agents mid-loop, async tasks, YAML DAGs, HITL flows, with tracing.

RAG

components/rag/

ExampleWhat it shows
vector_stores/pinecone_flow.py, elasticsearch_flow.pyIndexing flows into Pinecone and Elasticsearch.
vector_stores/filters/Metadata filtering at retrieval time.
vector_stores/delete_documents/Deleting indexed documents by file id.
retrievers/score_threshold_demo.pyRetrieval score thresholds.
rerankers/use_cohere.pyReranking retrieved documents with Cohere.
embedders/embedders_execution.pyRunning document/text embedders across providers.

Also see components/splitters/ (character, token, semantic, code, HTML, JSON, markdown-header, contextual splitting) and components/helpers/converters/ (PDF, DOCX, PPTX, HTML, CSV, TXT converters). Concepts: RAG Pipeline and Document Processing.

LLMs

components/llm/

ExampleWhat it shows
llms/streaming.py, thinking_streaming.pyToken streaming, including reasoning streams.
llms/structured_output.py, function_calling.pyStructured output and tool/function calling.
llms/ollama.py, custom.pyLocal and custom LLM endpoints.
llm_with_vision/Vision inputs and PDF extraction with vision models.
llm_with_files/Passing files to LLM nodes.

Concepts: LLM Providers and Prompts & Messages.

Evaluations

components/evaluations/llm_evaluator.py (custom LLM-judged metrics), python_evaluator.py (programmatic metrics), workflow_eval.py (scoring a RAG workflow), and metrics/ with one script per built-in metric. Concepts: Evaluations.

Use cases

use_cases/ — end-to-end applications, most with a UI or server component:

Use caseWhat it builds
gpt_researcher/A GPT-Researcher-style deep research pipeline, single- and multi-agent.
customer_support/Support agent backed by a mock banking API.
data_analyst/Data-analysis agent with a Streamlit front end.
erp_system/ERP assistant with a database tool, backend, and app.
financial_assistant/Financial Q&A assistant.
researcher/Research agent with app and backend.
trip_planner/Trip-planning agents with prompt templates.
job_posting/Job-posting generator.
literature_overview/Literature survey agent.
smm_manager/Social-media manager with a Mailgun tool.
project_manager/PM assistant with a Composio tool integration.
agents_use_cases/A grab bag of focused agents: coder, web researcher, deep scraping, feedback analyst, regression modeling, text-to-Cypher (Neo4j, Neptune, AGE), local and small LLMs.
chainlit/Chat UIs for Dynamiq agents with Chainlit.
graph_use_case/Graph ingest/query/check workflows.
search/Search app with server variants, including one served via Dynamiq.
agent_file_processing/File-processing agent behind an API server.

Serving

cli/agent_service/ — a FastAPI service wrapping an agent, with Dockerfile, ready to deploy with the Dynamiq CLI. Pairs with CLI Overview and Deploy from the SDK.

Next steps

On this page