Cross-pollination: new templates, recipes, solver variety, dedup#35
Open
Cross-pollination: new templates, recipes, solver variety, dedup#35
Conversation
…ling - Remove network_flow (same min-cost flow pattern as inventory_rebalancing) - Remove vehicle_scheduling (same fixed-charge big-M pattern as order_fulfillment) - Add flow conservation constraint + transit hub sites to inventory_rebalancing, absorbing the unique dual-ref flow balance pattern from network_flow
New templates adapted from demos/ counterparts: - shipment_compliance: rules template (late shipments, at-risk, single-sourced BOMs, escalated demand) - manufacturing_compliance: rules template (overdue maintenance, parts reorder, high-risk machines, expiring certs) - machine_dependencies: graph template (shared-technician dependency clusters, betweenness centrality) - portfolio_compliance: rules template (position concentration, sector overweight, high-risk traders) - warehouse_allocation: chained graph+prescriptive template (centrality-weighted inventory allocation)
Recipes show how single-reasoner templates combine into staged workflows: - supply_chain_resilience: graph (site-centrality) -> rules (shipment-compliance) -> prescriptive (supplier-reliability) - manufacturing_maintenance: graph (machine-dependencies) -> rules (manufacturing-compliance) -> prescriptive (machine-maintenance) - portfolio_risk_management: graph (fraud-detection) -> rules (portfolio-compliance) -> prescriptive (portfolio-balancing)
Code standards (all 8 new/changed scripts): - Rename data_dir to DATA_DIR per template conventions - Fix module docstrings: indented Run/Output blocks, standard bullet format - Fix concept comments to use "ConceptName concept: description." form - Normalize section comment style to dashed separators - Remove trailing commas in where() blocks (manufacturing_compliance) Solver variety: - water_allocation: switch from HiGHS to Ipopt with nonlinear loss model (effective_flow = flow * (1 - loss_rate * flow / max_flow)) - portfolio_balancing: switch from HiGHS to Ipopt for quadratic objective - traveling_salesman: revert to HiGHS-only (MiniZinc incompatible with MTZ) README compliance (all 8 READMEs): - Fix Quickstart ZIP URLs to private.relational.ai - Add bold reasoning type in "What this template is for" sections - Add featured: false to frontmatter where missing - Add Troubleshooting sections with <details>/<summary> blocks - Fix <code> tags in existing Troubleshooting summaries - Update code snippets to match actual code (portfolio_balancing) - Add How it works lead-in lines where missing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cross-pollination pass between templates/ and rai-agent-skills/ to ensure MECE coverage across reasoner types, domains, and solver variety.
Consolidation (commit 1)
network_flow— redundant withinventory_rebalancing(same min-cost flow pattern)vehicle_scheduling— redundant withorder_fulfillment(same fixed-charge big-M pattern)inventory_rebalancing— added transit hub sites and flow conservation constraint, absorbing the unique dual-ref balance pattern fromnetwork_flowNew templates (commit 2)
Five new templates adapted from demos/ counterparts, filling coverage gaps:
shipment_compliance(rules) — late shipments, at-risk, single-sourced BOMs, escalated demandmanufacturing_compliance(rules) — overdue maintenance, parts reorder, high-risk machines, expiring certsmachine_dependencies(graph) — shared-technician dependency clusters via WCC + betweenness centralityportfolio_compliance(rules) — position concentration, sector overweight, high-risk traderswarehouse_allocation(chained graph+prescriptive) — centrality-weighted inventory allocationRecipes (commit 3)
New
recipes/folder with multi-reasoner chain walkthroughs referencing existing templates:supply_chain_resilience.md— graph (site-centrality) → rules (shipment-compliance) → prescriptive (supplier-reliability)manufacturing_maintenance.md— graph (machine-dependencies) → rules (manufacturing-compliance) → prescriptive (machine-maintenance)portfolio_risk_management.md— graph (fraud-detection) → rules (portfolio-compliance) → prescriptive (portfolio-balancing)Standards and solver variety (commit 4)
water_allocationnow uses Ipopt (nonlinear losses),portfolio_balancingnow uses Ipopt (quadratic objective). All 4 open-source solvers represented (HiGHS, Ipopt, MiniZinc).<details>blocks, code snippet accuracy — all 8 READMEsTest plan
water_allocationIpopt solve: LOCALLY_SOLVED, cost=$853.39portfolio_balancingIpopt solve: LOCALLY_SOLVED, risk=5119.24warehouse_allocationchained solve: graph centrality → OPTIMAL allocation, cost=$13,713.29traveling_salesmanHiGHS: OPTIMAL, distance=8.5inventory_rebalancingwith flow conservation: OPTIMALpy_compilesyntax checks.github/promptsstandards