Skip to content

Add transaction_screening_local template (rules + query on local DuckDB)#80

Draft
cafzal wants to merge 1 commit into
mainfrom
add-transaction-screening-local-template
Draft

Add transaction_screening_local template (rules + query on local DuckDB)#80
cafzal wants to merge 1 commit into
mainfrom
add-transaction-screening-local-template

Conversation

@cafzal
Copy link
Copy Markdown
Collaborator

@cafzal cafzal commented Jun 3, 2026

What

A beginner, rules-based template that runs entirely on a local DuckDB database — no Snowflake account or Native App. It triages a transfer ledger: classifies structuring and large-sender accounts, flags suspects, and expands a one-hop investigation set across the transfer network via a relationship self-join.

It's the local-development counterpart to the Snowflake-backed templates — same ontology → rules → query workflow, on an engine you can run anywhere.

Reasoning

  • Rules-based: is_structuring, is_large_sender, is_suspect (OR-chained), near_suspect (1-hop).
  • Querying / relationship traversal: network aggregates and a suspect → counterparty self-join over a transfers_to relationship (the local way to answer connectivity, without the graph reasoner).

Files

v1/transaction_screening_local/
├── README.md
├── pyproject.toml            # relationalai==1.8.1
├── transaction_screening_local.py
└── data/transactions.csv     # transfer ledger with an embedded structuring ring

Also adds the index row to v1/README.md.

Verification

Runs end-to-end on relationalai==1.8.1 (in-memory DuckDB): network overview, per-account volume, suspects (C1001 + ring C2001–C2005), the ring visible in the self-join, and the expanded investigation set. py_compile + ruff clean.

Notes / open items (draft)

  • Local DuckDB execution uses deploy mode (enable_model_deployment=True + model.auto_deploy=True), which the package currently flags as experimental — confirm the support stance with the engine team before merging.
  • This is a new local-DuckDB template category (no Snowflake). Confirm portfolio fit; it's adjacent to fraud-detection (multi-reasoner, Snowflake) and commercial_underwriting (rules) but distinct.
  • The graph reasoner is intentionally not used — it's not reliable on local DuckDB (details in rai-agent-evals PR #108).

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

The docs preview for this pull request has been deployed to Vercel!

✅ Preview: https://relationalai-docs-qcmqc33vt-relationalai.vercel.app/build/templates
🔍 Inspect: https://vercel.com/relationalai/relationalai-docs/9pzy9Yg9X1J6edafxi1NbvuRpZmg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant