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
| Example | What it shows |
|---|---|
| simple_agent_wf.py | A minimal simple-agent workflow. |
| reflection_agent_wf.py | The reflection agent pattern — draft, critique, revise. |
| agent_wf.py | A ReAct Agent with tools inside a Workflow. |
| agent_multi_tool_workflow.py | One agent coordinating multiple tools (plus a streaming variant). |
| agent_e2b_sandbox.py | Agent with an E2B sandbox: remote files plus shell execution. |
| agent_daytona_sandbox.py | Same pattern on a Daytona sandbox backend. |
| agent_filesystem_interaction.py | Agent file-store usage: reading and writing files during a run. |
| use_agent_with_agent_tool.py | Agents as tools of other agents (sub-agents), with a memory variant. |
| use_agent_with_parallel_agent_tool.py | Parallel sub-agent tool calls. |
| use_subagent_checkpoint.py | Checkpointing a multi-node agent flow and resuming after a simulated crash. |
| use_agent_with_error_handling.py | ErrorHandling (timeouts, retries, backoff) on the LLM and the agent. |
| use_agents_vision.py | Agents over image inputs. |
| context_management_example.py | Agent context-window management. |
| use_agents_hidden_params.py | Hiding or requiring tool parameters with input_param_modes. |
| agent_vector_store_write_pipeline.py | Agent-driven vector-store writes (also as a writer tool). |
| use_neo4j_text2cypher_workflow.py | Text-to-Cypher agent over Neo4j. |
Orchestrators
components/agents/orchestrators/graph_orchestrator/
| Example | What it shows |
|---|---|
| code_assistant.py | Graph orchestrator coordinating a coding workflow. |
| concierge_orchestration.py | Routing between specialist agents. |
| email_writer.py | Multi-step drafting flow as a state graph. |
| trip_planner_orchestration.py | Multi-agent trip planning. |
| graph_orchestrator_yaml.py | Defining 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/
| Example | What it shows |
|---|---|
| confirmation_email_writer/console | Approval gates answered in the console. |
| confirmation_email_writer/socket | The same approval flow over WebSockets. |
| streaming_orchestrator | HITL feedback inside a streaming orchestrator. |
| streaming_post_writer | Streaming generation with human feedback events. |
Tools
| Example | What it shows |
|---|---|
| use_tavily.py, use_exa.py, use_serp.py | Web search tools. |
| use_firecrawl.py, use_jina.py | Scraping and content extraction tools. |
| use_python_node.py, use_http_api_node.py, use_sql.py | Python code, HTTP API call, and SQL nodes. |
| use_function_tool.py | Wrapping plain functions with function_tool. |
| use_react_with_coding.py, use_react_search.py, use_react_fc.py | ReAct 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
| Area | Highlights |
|---|---|
| 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
| Example | What it shows |
|---|---|
| vector_stores/pinecone_flow.py, elasticsearch_flow.py | Indexing 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.py | Retrieval score thresholds. |
| rerankers/use_cohere.py | Reranking retrieved documents with Cohere. |
| embedders/embedders_execution.py | Running 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
| Example | What it shows |
|---|---|
| llms/streaming.py, thinking_streaming.py | Token streaming, including reasoning streams. |
| llms/structured_output.py, function_calling.py | Structured output and tool/function calling. |
| llms/ollama.py, custom.py | Local 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 case | What 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.