Skip to content

DataGrout/cookbook

Repository files navigation

recipes

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.

Structure

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, …)

Prerequisites

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>/mcp

Recipe Template

See _template.md for the standard recipe format.

Quick Index

Quickstart

Patterns

Inference Recipes

  • grounded-search — inference.search, .research, .rfi — quality levels, citations, background promotion

Prism Recipes

  • analyze-modes — exploratory, competitive, causal, and deep analysis modes

Latent Recipes

  • concept-exploration — latent.orient and latent.horizon for semantic positioning and blind spot discovery

Logic Cell Recipes

  • assert-and-query — Assert entity/attribute/relation facts, query with Prolog
  • logic/constrain — Custom Prolog rules: derived facts, transitive graphs, business logic

Batteries Recipes

Flow Recipes

Data-Frame / Math Recipes

Warden Recipes

Invariant Recipes

  • invariant/code-review — Goal-anchored code review, CI gate, codebase audits (cycles, security, test gaps)

Docs Recipes

  • docs — Create, update, retrieve, and delete persistent documents; agent working memory; cleanup with approval gate

Notable Combined Recipes

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

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 breakdown
  • lumen.compare — compare two laps or time windows side-by-side
  • lumen.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).

Benchmark Cross-References

Recipes link to benchmarks for cost and token benchmarks:

  • forensic/causal-chain-tracing -> benchmark 01 (multi-hop debugging)
  • combined/competitive-intel-pipeline -> benchmark 05
  • data-frame-math/csv-analysis -> benchmark 04
  • invariant/code-review -> benchmark 03

About

Quickstarts, pipeline patterns, and worked examples for the DataGrout tool suite

Resources

Stars

Watchers

Forks

Contributors