Recipes and patterns for building with DataGrout. Each recipe is a self-contained example showing how to use DG tools to solve a specific class of problem.
Organized by complexity: quickstart -> patterns -> recipes -> agents -> advanced.
recipes/
├── quickstart/ # Entry-level examples to get started
│ ├── hello-world/ # Connect and call one tool
│ ├── first-flow/ # Compose two tools with flow.into
│ ├── first-logic-cell/ # Assert, query, reflect
│ ├── understanding-cache-refs/ # Free data piping
│ └── discovery/ # Discover tools by goal, plan workflows
├── patterns/ # Reusable cross-cutting patterns (transport, auth, pipeline shapes)
├── recipes/ # Suite-specific tool recipes
│ ├── logic/ # Symbolic memory: assert, query, constrain, reflect
│ ├── batteries/ # Pre-built Prolog rule modules (install, validate, compose)
│ ├── flow/ # Workflow orchestration (flow.into, flow.route)
│ ├── data-frame-math/ # Zero-credit data analysis: stats, trend, outliers, correlation
│ ├── prism/ # Semantic reshape and visualization
│ ├── inference/ # Grounded web research
│ ├── warden/ # Safety and injection detection (canary, intent, adjudicate)
│ ├── invariant/ # Code analysis, review gates, codebase audits
│ ├── latent/ # Concept exploration
│ ├── forensic/ # Causal investigation
│ └── combined/ # Multi-suite pipelines
├── agents/ # Full agent FSM examples (Agentsmith SDK)
├── advanced/ # Skills, custom tools, multi-server demux
└── games/ # Prebuilt Prolog rulesets for Roblox / Tether
└── rulesets/ # installable modules (inventory, quests, loot-tables, …)
Sign up at app.datagrout.ai to get your server URL and API key.
# Install the Conduit SDK for your language
pip install datagrout-conduit # Python
npm install @datagrout/conduit # TypeScript
cargo add datagrout-conduit # Rust
mix deps.get datagrout_conduit # Elixir
gem install datagrout-conduit # Ruby
# Or use Claude Code with the DataGrout MCP server
# Get your MCP URL from app.datagrout.ai -> Settings -> MCP
claude mcp add datagrout https://app.datagrout.ai/servers/<uuid>/mcpSee _template.md for the standard recipe format.
- hello-world — Connect, discover, call one tool
- first-flow — Compose two tools with flow.into
- first-logic-cell — Assert, query, reflect
- understanding-cache-refs — How cache_ref flows through a pipeline and why data transfer is free
- discovery — Discover tools by goal, plan multi-step workflows, agent self-orientation
- zero-credit-pipeline — Data transforms at zero tokens
- cache-ref-composition — Pipe results via cache_ref
- background-tasks — Non-blocking long-running calls
- onramp-bootstrap — Autonomous agent self-registration and mTLS bootstrap
- jsonrpc-transport — JSONRPC and WebSocket transport vs MCP
- scheduled-monitoring — Periodic triggers with Governor
- refract-reshape — Semantic data transformation
- grounded-search — inference.search, .research, .rfi — quality levels, citations, background promotion
- analyze-modes — exploratory, competitive, causal, and deep analysis modes
- concept-exploration — latent.orient and latent.horizon for semantic positioning and blind spot discovery
- assert-and-query — Assert entity/attribute/relation facts, query with Prolog
- logic/constrain — Custom Prolog rules: derived facts, transitive graphs, business logic
- batteries/getting-started — Search, describe, install, and query a battery
- batteries/composing-batteries — Combine inventory + quests + loot-tables in one namespace
- batteries/validate — Diagnose installation: per-predicate pass/fail, missing fact hints, optional CTC
- flow/conditional-routing — flow.route patterns: predicates, AND branches, catch-all, cache_ref
- flow/log-processing — flow.into + conditional step for log severity routing
- flow/trend-analysis-pipeline — filter -> group -> trend -> analyze at minimal cost
- data-frame-math/csv-analysis — Descriptive stats, trend, outlier detection, correlation — all zero credits
- warden/prompt-injection-defense — Three-tier injection detection: canary -> intent -> adjudicate
- invariant/code-review — Goal-anchored code review, CI gate, codebase audits (cycles, security, test gaps)
- docs — Create, update, retrieve, and delete persistent documents; agent working memory; cleanup with approval gate
- competitive-intel-pipeline — search -> refract -> assert -> tabulate -> analyze
- research-to-report — Full research -> structured report pipeline
- code-quality-gate — lens -> review -> warden -> route
Games / Roblox Rulesets (Tether)
- games/ — LC mental model, module catalog, and game loop patterns
- inventory — Item carrying, weight limits, slot constraints
- loot-tables — Rarity tiers, conditions, drop chance calculation
- quests — Quest availability, prerequisites, objective tracking
Tether is the Roblox/Luau client library for DataGrout. Install any battery from Luau with one line:
dg:batteries().install("quests", "my-game", function(r) print(r.predicate_count .. " predicates installed") end)Lumen is a free token usage monitor and cost tracker. On macOS it runs as a native status bar app; on Linux and Windows the same lumen-core Rust daemon serves a browser dashboard at http://127.0.0.1:9091/dashboard. When you have Lumen running alongside a DG session, the lumen tool suite lets agents read live session data:
lumen.laps— retrieve lap history and per-lap token/cost breakdownlumen.compare— compare two laps or time windows side-by-sidelumen.dashboard— current session totals and rolling metrics
These tools read from the _lumen_<subscriber_id> LC namespace and cost zero credits. Useful for validating that pipeline steps run at zero tokens (see zero-credit-pipeline).
Recipes link to benchmarks for cost and token benchmarks:
forensic/causal-chain-tracing-> benchmark 01 (multi-hop debugging)combined/competitive-intel-pipeline-> benchmark 05data-frame-math/csv-analysis-> benchmark 04invariant/code-review-> benchmark 03