labagent 0.2.1__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. {labagent-0.2.1 → labagent-0.3.0}/MANIFEST.in +2 -0
  2. labagent-0.3.0/PKG-INFO +120 -0
  3. labagent-0.3.0/README.md +56 -0
  4. labagent-0.3.0/docs/aml/dataset-card-huggingface.md +76 -0
  5. labagent-0.3.0/docs/aml/kaggle-description.md +28 -0
  6. labagent-0.3.0/docs/aml-lab-instructor.md +103 -0
  7. labagent-0.3.0/docs/aml.md +143 -0
  8. labagent-0.3.0/docs/azure-labs.md +99 -0
  9. labagent-0.3.0/docs/blog/aml-lab.md +46 -0
  10. labagent-0.3.0/docs/dbx-lakehouse.md +115 -0
  11. labagent-0.3.0/docs/dbx-workspace.md +82 -0
  12. {labagent-0.2.1 → labagent-0.3.0}/docs/job-contract.md +4 -1
  13. {labagent-0.2.1 → labagent-0.3.0}/docs/packs.md +36 -30
  14. labagent-0.3.0/docs/rag-lab-instructor.md +113 -0
  15. labagent-0.3.0/docs/rag-local.md +110 -0
  16. {labagent-0.2.1 → labagent-0.3.0}/labagent/__init__.py +1 -1
  17. labagent-0.3.0/labagent/ai/__init__.py +1 -0
  18. labagent-0.3.0/labagent/ai/rag/__init__.py +15 -0
  19. labagent-0.3.0/labagent/ai/rag/adapters.py +236 -0
  20. labagent-0.3.0/labagent/ai/rag/cli.py +167 -0
  21. labagent-0.3.0/labagent/ai/rag/client.py +233 -0
  22. labagent-0.3.0/labagent/ai/rag/config.py +81 -0
  23. labagent-0.3.0/labagent/ai/rag/embeddings.py +63 -0
  24. labagent-0.3.0/labagent/ai/rag/lab/01_chunking.py +218 -0
  25. labagent-0.3.0/labagent/ai/rag/lab/02_embeddings.py +129 -0
  26. labagent-0.3.0/labagent/ai/rag/lab/03_vector_store.py +147 -0
  27. labagent-0.3.0/labagent/ai/rag/lab/04_generation.py +171 -0
  28. labagent-0.3.0/labagent/ai/rag/lab/05_chroma_and_filters.py +152 -0
  29. labagent-0.3.0/labagent/ai/rag/lab/06_hybrid_search.py +157 -0
  30. labagent-0.3.0/labagent/ai/rag/lab/07_evaluation.py +215 -0
  31. labagent-0.3.0/labagent/ai/rag/lab/08_break_it.py +285 -0
  32. labagent-0.3.0/labagent/ai/rag/lab/__init__.py +122 -0
  33. labagent-0.3.0/labagent/ai/rag/lab/docs/ai_usage_guidelines.md +33 -0
  34. labagent-0.3.0/labagent/ai/rag/lab/docs/backup_and_recovery.md +33 -0
  35. labagent-0.3.0/labagent/ai/rag/lab/docs/expense_policy.md +31 -0
  36. labagent-0.3.0/labagent/ai/rag/lab/docs/remote_work_policy.md +29 -0
  37. labagent-0.3.0/labagent/ai/rag/lab/docs/vendor_risk_management.md +29 -0
  38. labagent-0.3.0/labagent/ai/rag/labkit.py +105 -0
  39. labagent-0.3.0/labagent/ai/rag/llm.py +107 -0
  40. labagent-0.3.0/labagent/ai/rag/models.py +73 -0
  41. labagent-0.3.0/labagent/ai/rag/playground.py +65 -0
  42. labagent-0.3.0/labagent/ai/rag/samples.py +298 -0
  43. {labagent-0.2.1 → labagent-0.3.0}/labagent/cli.py +32 -13
  44. {labagent-0.2.1 → labagent-0.3.0}/labagent/config.py +3 -7
  45. labagent-0.3.0/labagent/datasets.py +191 -0
  46. {labagent-0.2.1 → labagent-0.3.0}/labagent/deleters.py +0 -4
  47. {labagent-0.2.1 → labagent-0.3.0}/labagent/nl.py +10 -7
  48. labagent-0.3.0/labagent/packs/aml/__init__.py +1 -0
  49. labagent-0.3.0/labagent/packs/aml/copilot/__init__.py +1 -0
  50. labagent-0.3.0/labagent/packs/aml/copilot/exercises.py +162 -0
  51. labagent-0.3.0/labagent/packs/aml/copilot/guidance.py +73 -0
  52. labagent-0.3.0/labagent/packs/aml/copilot/office.py +138 -0
  53. labagent-0.3.0/labagent/packs/aml/copilot/package.py +257 -0
  54. labagent-0.3.0/labagent/packs/aml/copilot/select.py +32 -0
  55. labagent-0.3.0/labagent/packs/aml/corpus/__init__.py +1 -0
  56. labagent-0.3.0/labagent/packs/aml/corpus/build.py +33 -0
  57. labagent-0.3.0/labagent/packs/aml/corpus/documents.py +333 -0
  58. labagent-0.3.0/labagent/packs/aml/corpus/regs.py +215 -0
  59. labagent-0.3.0/labagent/packs/aml/data/reg_index.json +620 -0
  60. labagent-0.3.0/labagent/packs/aml/data/sdn_seed.json +67 -0
  61. labagent-0.3.0/labagent/packs/aml/export.py +30 -0
  62. labagent-0.3.0/labagent/packs/aml/gen/__init__.py +31 -0
  63. labagent-0.3.0/labagent/packs/aml/gen/__main__.py +27 -0
  64. labagent-0.3.0/labagent/packs/aml/gen/builtin.py +479 -0
  65. labagent-0.3.0/labagent/packs/aml/gen/snapshot.py +28 -0
  66. labagent-0.3.0/labagent/packs/aml/lab/01_policy_search.py +207 -0
  67. labagent-0.3.0/labagent/packs/aml/lab/02_evidence_bundle.py +331 -0
  68. labagent-0.3.0/labagent/packs/aml/lab/03_citations_and_narrative.py +248 -0
  69. labagent-0.3.0/labagent/packs/aml/lab/04_triage_and_evaluation.py +276 -0
  70. labagent-0.3.0/labagent/packs/aml/lab/__init__.py +29 -0
  71. labagent-0.3.0/labagent/packs/aml/licences.py +46 -0
  72. labagent-0.3.0/labagent/packs/aml/names.py +56 -0
  73. labagent-0.3.0/labagent/packs/aml/pack.py +428 -0
  74. labagent-0.3.0/labagent/packs/aml/rag/__init__.py +1 -0
  75. labagent-0.3.0/labagent/packs/aml/rag/bundle.py +74 -0
  76. labagent-0.3.0/labagent/packs/aml/rag/qa.py +37 -0
  77. labagent-0.3.0/labagent/packs/aml/rag/quality.py +201 -0
  78. labagent-0.3.0/labagent/packs/aml/rag/tools.py +80 -0
  79. labagent-0.3.0/labagent/packs/aml/schema.py +186 -0
  80. labagent-0.3.0/labagent/packs/azure_labs/__init__.py +1 -0
  81. labagent-0.3.0/labagent/packs/azure_labs/azcli.py +148 -0
  82. labagent-0.3.0/labagent/packs/azure_labs/lifecycle.py +70 -0
  83. labagent-0.3.0/labagent/packs/azure_labs/migrate.py +216 -0
  84. labagent-0.3.0/labagent/packs/azure_labs/pack.py +172 -0
  85. labagent-0.3.0/labagent/packs/azure_labs/safety.py +51 -0
  86. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/base.py +32 -4
  87. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/databricks/cli.py +1 -14
  88. labagent-0.3.0/labagent/packs/databricks/models.py +5 -0
  89. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/db_agent/pack.py +4 -2
  90. labagent-0.3.0/labagent/packs/dbx_lakehouse/domains.py +75 -0
  91. labagent-0.3.0/labagent/packs/dbx_lakehouse/guides/START_HERE.md +29 -0
  92. labagent-0.3.0/labagent/packs/dbx_lakehouse/guides/healthcare.md +21 -0
  93. labagent-0.3.0/labagent/packs/dbx_lakehouse/guides/retail.md +24 -0
  94. labagent-0.3.0/labagent/packs/dbx_lakehouse/notebook.py +54 -0
  95. labagent-0.3.0/labagent/packs/dbx_lakehouse/pack.py +415 -0
  96. labagent-0.3.0/labagent/packs/dbx_lakehouse/sql/healthcare/01_bronze.sql +124 -0
  97. labagent-0.3.0/labagent/packs/dbx_lakehouse/sql/healthcare/02_silver.sql +190 -0
  98. labagent-0.3.0/labagent/packs/dbx_lakehouse/sql/healthcare/03_gold.sql +125 -0
  99. labagent-0.3.0/labagent/packs/dbx_lakehouse/sql/healthcare/04_governance.sql +96 -0
  100. labagent-0.3.0/labagent/packs/dbx_lakehouse/sql/retail/01_bronze.sql +54 -0
  101. labagent-0.3.0/labagent/packs/dbx_lakehouse/sql/retail/02_silver.sql +112 -0
  102. labagent-0.3.0/labagent/packs/dbx_lakehouse/sql/retail/03_gold.sql +130 -0
  103. labagent-0.3.0/labagent/packs/dbx_lakehouse/sqlrun.py +41 -0
  104. labagent-0.3.0/labagent/packs/dbx_workspace/__init__.py +1 -0
  105. labagent-0.3.0/labagent/packs/dbx_workspace/guards.py +66 -0
  106. labagent-0.3.0/labagent/packs/dbx_workspace/pack.py +281 -0
  107. labagent-0.3.0/labagent/packs/dbx_workspace/tf.py +127 -0
  108. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/gitsrc.py +1 -1
  109. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/rag/app/app.py +5 -2
  110. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/rag/sources/__init__.py +3 -9
  111. labagent-0.3.0/labagent/packs/rag/sources/datasets.json +20 -0
  112. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/rag/sources/sec.py +0 -8
  113. labagent-0.3.0/labagent/packs/rag/tutorial/__init__.py +1 -0
  114. labagent-0.3.0/labagent/packs/rag/tutorial/notebooks/00_setup.py +109 -0
  115. labagent-0.3.0/labagent/packs/rag/tutorial/notebooks/01_data.py +76 -0
  116. labagent-0.3.0/labagent/packs/rag/tutorial/notebooks/02_embeddings.py +94 -0
  117. labagent-0.3.0/labagent/packs/rag/tutorial/notebooks/03_pgvector.py +193 -0
  118. labagent-0.3.0/labagent/packs/rag/tutorial/notebooks/04_search.py +164 -0
  119. labagent-0.3.0/labagent/packs/rag/tutorial/notebooks/05_answer_and_eval.py +165 -0
  120. labagent-0.3.0/labagent/packs/rag/tutorial/notebooks/06_deploy_app.py +196 -0
  121. labagent-0.3.0/labagent/packs/rag/tutorial/notebooks/99_cleanup.py +110 -0
  122. labagent-0.3.0/labagent/packs/rag/tutorial/notebooks/_common.py +159 -0
  123. labagent-0.3.0/labagent/packs/rag/tutorial_pack.py +127 -0
  124. labagent-0.3.0/labagent/packs/rag_ide/__init__.py +1 -0
  125. labagent-0.3.0/labagent/packs/rag_ide/ec2.py +230 -0
  126. labagent-0.3.0/labagent/packs/rag_ide/local.py +112 -0
  127. labagent-0.3.0/labagent/packs/rag_ide/modal_gateway.py +132 -0
  128. labagent-0.3.0/labagent/packs/rag_ide/pack.py +408 -0
  129. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/registry.py +14 -2
  130. {labagent-0.2.1 → labagent-0.3.0}/labagent/run.py +32 -2
  131. labagent-0.3.0/labagent/terraform/databricks_aws/.terraform.lock.hcl +98 -0
  132. labagent-0.3.0/labagent/terraform/databricks_aws/main.tf +213 -0
  133. labagent-0.3.0/labagent/terraform/databricks_aws/outputs.tf +25 -0
  134. labagent-0.3.0/labagent/terraform/databricks_aws/tests/workspace.tftest.hcl +119 -0
  135. labagent-0.3.0/labagent/terraform/databricks_aws/variables.tf +74 -0
  136. labagent-0.3.0/labagent/terraform/databricks_aws/versions.tf +21 -0
  137. labagent-0.3.0/labagent/terraform/databricks_azure/.terraform.lock.hcl +51 -0
  138. labagent-0.3.0/labagent/terraform/databricks_azure/main.tf +118 -0
  139. labagent-0.3.0/labagent/terraform/databricks_azure/outputs.tf +25 -0
  140. labagent-0.3.0/labagent/terraform/databricks_azure/tests/workspace.tftest.hcl +86 -0
  141. labagent-0.3.0/labagent/terraform/databricks_azure/variables.tf +55 -0
  142. labagent-0.3.0/labagent/terraform/databricks_azure/versions.tf +13 -0
  143. {labagent-0.2.1 → labagent-0.3.0}/labagent/tf.py +1 -1
  144. labagent-0.3.0/labagent.egg-info/PKG-INFO +120 -0
  145. labagent-0.3.0/labagent.egg-info/SOURCES.txt +231 -0
  146. {labagent-0.2.1 → labagent-0.3.0}/labagent.egg-info/entry_points.txt +0 -1
  147. labagent-0.3.0/labagent.egg-info/requires.txt +41 -0
  148. {labagent-0.2.1 → labagent-0.3.0}/pyproject.toml +10 -3
  149. labagent-0.3.0/scripts/build_lakehouse_data.py +141 -0
  150. {labagent-0.2.1 → labagent-0.3.0}/scripts/check_no_pii.py +3 -3
  151. labagent-0.3.0/tests/__init__.py +0 -0
  152. labagent-0.3.0/tests/test_aml_copilot.py +220 -0
  153. labagent-0.3.0/tests/test_aml_corpus.py +217 -0
  154. labagent-0.3.0/tests/test_aml_docs.py +65 -0
  155. labagent-0.3.0/tests/test_aml_generator.py +308 -0
  156. labagent-0.3.0/tests/test_aml_lab.py +103 -0
  157. labagent-0.3.0/tests/test_aml_nl.py +37 -0
  158. labagent-0.3.0/tests/test_aml_rag.py +283 -0
  159. labagent-0.3.0/tests/test_azure_labs.py +360 -0
  160. {labagent-0.2.1 → labagent-0.3.0}/tests/test_cloudfront_and_cli.py +1 -1
  161. {labagent-0.2.1 → labagent-0.3.0}/tests/test_datasets.py +1 -1
  162. labagent-0.3.0/tests/test_dbx_lakehouse.py +454 -0
  163. labagent-0.3.0/tests/test_dbx_workspace.py +418 -0
  164. labagent-0.3.0/tests/test_encoding.py +47 -0
  165. {labagent-0.2.1 → labagent-0.3.0}/tests/test_nl.py +58 -50
  166. labagent-0.3.0/tests/test_pack_jobs.py +108 -0
  167. {labagent-0.2.1 → labagent-0.3.0}/tests/test_packaging.py +7 -0
  168. labagent-0.3.0/tests/test_packs.py +161 -0
  169. {labagent-0.2.1 → labagent-0.3.0}/tests/test_rag_app.py +0 -6
  170. labagent-0.3.0/tests/test_rag_ide.py +205 -0
  171. labagent-0.3.0/tests/test_rag_ide_ec2.py +242 -0
  172. labagent-0.3.0/tests/test_rag_ide_local.py +135 -0
  173. labagent-0.3.0/tests/test_rag_lab.py +122 -0
  174. labagent-0.3.0/tests/test_rag_local.py +385 -0
  175. {labagent-0.2.1 → labagent-0.3.0}/tests/test_rag_sec.py +14 -9
  176. labagent-0.3.0/tests/test_rag_tutorial.py +244 -0
  177. {labagent-0.2.1 → labagent-0.3.0}/tests/test_tf_wrapper.py +9 -7
  178. labagent-0.2.1/PKG-INFO +0 -120
  179. labagent-0.2.1/README.md +0 -82
  180. labagent-0.2.1/labagent/datasets.py +0 -101
  181. labagent-0.2.1/labagent/packs/rag/pack.py +0 -329
  182. labagent-0.2.1/labagent/packs/rag/sources/builtin.py +0 -41
  183. labagent-0.2.1/labagent/packs/rag/sources/builtin_corpus.jsonl +0 -25
  184. labagent-0.2.1/labagent/packs/rag/sources/datasets.json +0 -8
  185. labagent-0.2.1/labagent.egg-info/PKG-INFO +0 -120
  186. labagent-0.2.1/labagent.egg-info/SOURCES.txt +0 -93
  187. labagent-0.2.1/labagent.egg-info/requires.txt +0 -11
  188. labagent-0.2.1/tests/test_packs.py +0 -369
  189. {labagent-0.2.1 → labagent-0.3.0}/CONTRIBUTING.md +0 -0
  190. {labagent-0.2.1 → labagent-0.3.0}/LICENSE +0 -0
  191. {labagent-0.2.1 → labagent-0.3.0}/SECURITY.md +0 -0
  192. {labagent-0.2.1 → labagent-0.3.0}/docs/account-cleanup.md +0 -0
  193. {labagent-0.2.1 → labagent-0.3.0}/docs/e2e-test-plan.md +0 -0
  194. {labagent-0.2.1 → labagent-0.3.0}/docs/examples/oidc-trust-policy.example.json +0 -0
  195. {labagent-0.2.1 → labagent-0.3.0}/docs/examples/permissions-read.example.json +0 -0
  196. {labagent-0.2.1 → labagent-0.3.0}/docs/examples/permissions-write.example.json +0 -0
  197. {labagent-0.2.1 → labagent-0.3.0}/docs/examples/runner-workflow.example.yml +0 -0
  198. {labagent-0.2.1 → labagent-0.3.0}/docs/state-and-secrets.md +0 -0
  199. {labagent-0.2.1 → labagent-0.3.0}/examples/config.example.json +0 -0
  200. {labagent-0.2.1 → labagent-0.3.0}/examples/rulesets/legacy-cleanup.example.json +0 -0
  201. {labagent-0.2.1 → labagent-0.3.0}/labagent/audit.py +0 -0
  202. {labagent-0.2.1 → labagent-0.3.0}/labagent/cleanup.py +0 -0
  203. {labagent-0.2.1 → labagent-0.3.0}/labagent/context.py +0 -0
  204. {labagent-0.2.1 → labagent-0.3.0}/labagent/discovery.py +0 -0
  205. {labagent-0.2.1 → labagent-0.3.0}/labagent/envelope.py +0 -0
  206. {labagent-0.2.1 → labagent-0.3.0}/labagent/iam_ops.py +0 -0
  207. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/__init__.py +0 -0
  208. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/databricks/__init__.py +0 -0
  209. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/databricks/auth.py +0 -0
  210. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/databricks/pg.py +0 -0
  211. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/db_agent/__init__.py +0 -0
  212. {labagent-0.2.1/labagent/packs/rag → labagent-0.3.0/labagent/packs/dbx_lakehouse}/__init__.py +0 -0
  213. {labagent-0.2.1/tests → labagent-0.3.0/labagent/packs/rag}/__init__.py +0 -0
  214. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/rag/app/app.yaml +0 -0
  215. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/rag/app/requirements.txt +0 -0
  216. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/rag/app/retrieval.py +0 -0
  217. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/rag/app/static/index.html +0 -0
  218. {labagent-0.2.1 → labagent-0.3.0}/labagent/packs/rag/chunking.py +0 -0
  219. {labagent-0.2.1 → labagent-0.3.0}/labagent/plan.py +0 -0
  220. {labagent-0.2.1 → labagent-0.3.0}/labagent/rules.py +0 -0
  221. {labagent-0.2.1 → labagent-0.3.0}/labagent/secrets_box.py +0 -0
  222. {labagent-0.2.1 → labagent-0.3.0}/labagent/sweep.py +0 -0
  223. {labagent-0.2.1 → labagent-0.3.0}/labagent/terraform/cohort_iam/.terraform.lock.hcl +0 -0
  224. {labagent-0.2.1 → labagent-0.3.0}/labagent/terraform/cohort_iam/main.tf +0 -0
  225. {labagent-0.2.1 → labagent-0.3.0}/labagent/terraform/cohort_iam/outputs.tf +0 -0
  226. {labagent-0.2.1 → labagent-0.3.0}/labagent/terraform/cohort_iam/sandbox-policy.json.tftpl +0 -0
  227. {labagent-0.2.1 → labagent-0.3.0}/labagent/terraform/cohort_iam/tests/cohort.tftest.hcl +0 -0
  228. {labagent-0.2.1 → labagent-0.3.0}/labagent/terraform/cohort_iam/variables.tf +0 -0
  229. {labagent-0.2.1 → labagent-0.3.0}/labagent/terraform/cohort_iam/versions.tf +0 -0
  230. {labagent-0.2.1 → labagent-0.3.0}/labagent/terraform/state_backend/.terraform.lock.hcl +0 -0
  231. {labagent-0.2.1 → labagent-0.3.0}/labagent/terraform/state_backend/main.tf +0 -0
  232. {labagent-0.2.1 → labagent-0.3.0}/labagent/terraform/state_backend/tests/bootstrap.tftest.hcl +0 -0
  233. {labagent-0.2.1 → labagent-0.3.0}/labagent.egg-info/dependency_links.txt +0 -0
  234. {labagent-0.2.1 → labagent-0.3.0}/labagent.egg-info/top_level.txt +0 -0
  235. {labagent-0.2.1 → labagent-0.3.0}/scripts/make_test_job.py +0 -0
  236. {labagent-0.2.1 → labagent-0.3.0}/setup.cfg +0 -0
  237. {labagent-0.2.1 → labagent-0.3.0}/tests/conftest.py +0 -0
  238. {labagent-0.2.1 → labagent-0.3.0}/tests/test_classify.py +0 -0
  239. {labagent-0.2.1 → labagent-0.3.0}/tests/test_cleanup.py +0 -0
  240. {labagent-0.2.1 → labagent-0.3.0}/tests/test_db_agent.py +0 -0
  241. {labagent-0.2.1 → labagent-0.3.0}/tests/test_iam_ops.py +0 -0
  242. {labagent-0.2.1 → labagent-0.3.0}/tests/test_plan.py +0 -0
  243. {labagent-0.2.1 → labagent-0.3.0}/tests/test_repo_hygiene.py +0 -0
  244. {labagent-0.2.1 → labagent-0.3.0}/tests/test_sweep_moto.py +0 -0
@@ -4,6 +4,8 @@ recursive-include examples *.json
4
4
  recursive-include scripts *.py
5
5
  recursive-include tests *.py
6
6
  recursive-include labagent/terraform *.tf *.tftpl *.hcl
7
+ recursive-include labagent/ai/rag/lab *.py *.md
8
+ recursive-include labagent/packs/dbx_lakehouse *.sql *.md
7
9
  # never ship operational data or state
8
10
  global-exclude *.tfstate *.tfstate.* *.tfvars *.pem job*.json result*.json plan*.json lab.json *.pyc
9
11
  prune .venv
@@ -0,0 +1,120 @@
1
+ Metadata-Version: 2.4
2
+ Name: labagent
3
+ Version: 0.3.0
4
+ Summary: Open-source CLI and AI agent to launch and tear down hands-on labs for RAG, LLM and Databricks, plus AWS and Terraform sandboxes.
5
+ Author: BeCloudReady
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/becloudready/labagent
8
+ Project-URL: Source, https://github.com/becloudready/labagent
9
+ Project-URL: Issues, https://github.com/becloudready/labagent/issues
10
+ Project-URL: Documentation, https://github.com/becloudready/labagent/tree/main/docs
11
+ Keywords: hands-on-labs,rag,llm,databricks,lakebase,pgvector,text-to-sql,ollama,ai-agent,aws,terraform,training,workshop,sandbox,cleanup,iam,boto3
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Education
16
+ Classifier: Intended Audience :: System Administrators
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Software Development :: Build Tools
24
+ Classifier: Topic :: System :: Systems Administration
25
+ Requires-Python: >=3.9
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: boto3>=1.34
29
+ Requires-Dist: cryptography>=42
30
+ Provides-Extra: rag
31
+ Requires-Dist: psycopg[binary]>=3.1; extra == "rag"
32
+ Provides-Extra: rag-local
33
+ Requires-Dist: pydantic>=2; extra == "rag-local"
34
+ Requires-Dist: chromadb>=0.5; extra == "rag-local"
35
+ Requires-Dist: sentence-transformers>=3; extra == "rag-local"
36
+ Requires-Dist: streamlit>=1.35; extra == "rag-local"
37
+ Requires-Dist: pypdf>=4; extra == "rag-local"
38
+ Provides-Extra: modal
39
+ Requires-Dist: modal>=1.0; extra == "modal"
40
+ Provides-Extra: aml
41
+ Requires-Dist: openpyxl>=3.1; extra == "aml"
42
+ Requires-Dist: python-docx>=1.1; extra == "aml"
43
+ Requires-Dist: pyarrow>=15; extra == "aml"
44
+ Provides-Extra: rag-lab
45
+ Requires-Dist: pydantic>=2; extra == "rag-lab"
46
+ Requires-Dist: chromadb>=0.5; extra == "rag-lab"
47
+ Requires-Dist: sentence-transformers>=3; extra == "rag-lab"
48
+ Requires-Dist: streamlit>=1.35; extra == "rag-lab"
49
+ Requires-Dist: pypdf>=4; extra == "rag-lab"
50
+ Requires-Dist: groq>=0.9; extra == "rag-lab"
51
+ Requires-Dist: langchain>=0.3; extra == "rag-lab"
52
+ Requires-Dist: qdrant-client>=1.9; extra == "rag-lab"
53
+ Requires-Dist: jupyterlab>=4; extra == "rag-lab"
54
+ Requires-Dist: ipykernel>=6; extra == "rag-lab"
55
+ Provides-Extra: dev
56
+ Requires-Dist: pytest>=8; extra == "dev"
57
+ Requires-Dist: pydantic>=2; extra == "dev"
58
+ Requires-Dist: moto[all]>=5; extra == "dev"
59
+ Requires-Dist: build>=1.2; extra == "dev"
60
+ Requires-Dist: twine>=5; extra == "dev"
61
+ Requires-Dist: openpyxl>=3.1; extra == "dev"
62
+ Requires-Dist: python-docx>=1.1; extra == "dev"
63
+ Dynamic: license-file
64
+
65
+ # labagent: CLI to launch hands-on labs for RAG, text-to-SQL, Databricks, AWS and Azure
66
+
67
+ [![PyPI](https://img.shields.io/pypi/v/labagent)](https://pypi.org/project/labagent/)
68
+ [![Python](https://img.shields.io/pypi/pyversions/labagent)](https://pypi.org/project/labagent/)
69
+ [![CI](https://github.com/becloudready/labagent/actions/workflows/ci.yml/badge.svg)](https://github.com/becloudready/labagent/actions/workflows/ci.yml)
70
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
71
+
72
+ labagent builds a lab with one command and removes it with one more. Each lab is a **pack**: ordered, re-runnable steps. `launch` resumes after a failure. `destroy` removes only what the pack created.
73
+
74
+ ```bash
75
+ pip install labagent
76
+ labagent packs # list labs (add --json for a machine-readable catalog)
77
+ labagent launch <pack> --name demo --param k=v # build or resume
78
+ labagent destroy <pack> --name demo # remove what launch created
79
+ ```
80
+
81
+ Extras: `labagent[rag]` (Databricks RAG), `[rag-local]` (laptop RAG), `[rag-lab]` (laptop RAG with JupyterLab), `[aml]`, `[modal]`. Python 3.9+. Add `--dry-run` to any launch to see the steps.
82
+
83
+ ## Packs
84
+
85
+ | Pack | What it builds | Where |
86
+ |---|---|---|
87
+ | `azure-labs` | Copy Azure VMs, disks and network from one resource group to another with snapshots, or snapshot a dead VM or disk. Source is read-only. An Azure Lab Services alternative. [Guide](docs/azure-labs.md) | Azure (needs `az login`) |
88
+ | `rag-sec-tutorial` | Nine notebooks: RAG on SEC 10-K filings with embeddings, pgvector, hybrid search, citations, an evaluation gate, a deployed app | Databricks Free Edition |
89
+ | `db-agent` | [db-agent](https://github.com/db-agent/db-agent) text-to-SQL app on Databricks Apps, pinned commit | Databricks Free Edition |
90
+ | `dbx-lakehouse` | Medallion lakehouse (bronze, silver, gold) from real open data, with masks, a row filter, notebooks and exercises. [Guide](docs/dbx-lakehouse.md) | Databricks Free Edition, AWS, Azure |
91
+ | `dbx-workspace` | Premium Databricks workspace via Terraform. Plan only unless `apply=yes`. [Guide](docs/dbx-workspace.md) | AWS or Azure (costs money) |
92
+ | `aml` | Synthetic anti-money-laundering lab with an answer key: RAG for developers, Microsoft 365 Copilot for staff. [Guide](docs/aml.md) | Your machine |
93
+ | `rag-ide` | Private browser VS Code per learner with the RAG lab | Modal, EC2 or Docker |
94
+
95
+ Also: `labagent rag init --dir ~/rag-lab` makes a laptop RAG lab of nine notebooks (needs `[rag-lab]`), and `labagent rag destroy --dir ~/rag-lab` removes it. See [docs/rag-local.md](docs/rag-local.md). AWS cohort sandboxes (Terraform IAM, plan-then-apply cleanup) run through `labagent run --job job.json`: see [docs/job-contract.md](docs/job-contract.md).
96
+
97
+ ## Azure: move VMs between resource groups
98
+
99
+ ```bash
100
+ export LABAGENT_ALLOWED_AZURE_SUBSCRIPTIONS=$(az account show --query id -o tsv)
101
+ labagent launch azure-labs --name move1 --param source_rg=legacy-rg --param target_rg=new-rg
102
+ labagent launch azure-labs --name old1 --param source_rg=legacy-rg --param target_rg=archive-rg --param snapshot_only=true
103
+ labagent destroy azure-labs --name move1 --param target_rg=new-rg
104
+ ```
105
+
106
+ Parameters: `source_rg`, `target_rg`, `vms` (comma list, default all), `snapshot_only`, `subscription`. Same subscription and region. It does not copy availability sets, scale sets, unmanaged VHDs, customer-key encryption, extensions or public IP addresses (a new address is created). Tested on a real subscription with Ubuntu VMs. Not Azure Lab Services and not from Microsoft.
107
+
108
+ ## For AI coding agents and scripts
109
+
110
+ - Output is one JSON envelope on stdout (`status`: `ok`, `partial`, `failed`; `items` per step). Exit code 0, 1, 2. Logs go to stderr and never contain secrets.
111
+ - `labagent packs --json` lists every pack with parameters, defaults, platforms and cost tier.
112
+ - Every `launch` is idempotent. Run it again to resume. `destroy` deletes only resources carrying the pack's tags or state.
113
+ - Safety gates: `LABAGENT_ALLOWED_ACCOUNTS` (AWS), `LABAGENT_ALLOWED_SUBSCRIPTIONS` (Databricks on Azure), `LABAGENT_ALLOWED_AZURE_SUBSCRIPTIONS` (azure-labs). An empty list refuses to run.
114
+ - Plain English front end: `labagent "deploy rag-tutorial"` prints the command it understood and asks first (local Ollama or any OpenAI-compatible endpoint).
115
+
116
+ ## Status
117
+
118
+ Run end to end on real services: Databricks Free Edition labs, the AWS premium workspace, and azure-labs copy and delete on Azure. Tested only against mocks so far: Azure and custom-network `dbx-workspace`, and `dbx-lakehouse` on AWS and Azure. Try labs in a throwaway workspace or account first.
119
+
120
+ Apache-2.0. [SECURITY.md](SECURITY.md), [CONTRIBUTING.md](CONTRIBUTING.md), [docs/packs.md](docs/packs.md). Related: [db-agent](https://github.com/db-agent/db-agent), [labagent-datasets](https://github.com/becloudready/labagent-datasets). Maintained by [BeCloudReady](https://becloudready.com/).
@@ -0,0 +1,56 @@
1
+ # labagent: CLI to launch hands-on labs for RAG, text-to-SQL, Databricks, AWS and Azure
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/labagent)](https://pypi.org/project/labagent/)
4
+ [![Python](https://img.shields.io/pypi/pyversions/labagent)](https://pypi.org/project/labagent/)
5
+ [![CI](https://github.com/becloudready/labagent/actions/workflows/ci.yml/badge.svg)](https://github.com/becloudready/labagent/actions/workflows/ci.yml)
6
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
7
+
8
+ labagent builds a lab with one command and removes it with one more. Each lab is a **pack**: ordered, re-runnable steps. `launch` resumes after a failure. `destroy` removes only what the pack created.
9
+
10
+ ```bash
11
+ pip install labagent
12
+ labagent packs # list labs (add --json for a machine-readable catalog)
13
+ labagent launch <pack> --name demo --param k=v # build or resume
14
+ labagent destroy <pack> --name demo # remove what launch created
15
+ ```
16
+
17
+ Extras: `labagent[rag]` (Databricks RAG), `[rag-local]` (laptop RAG), `[rag-lab]` (laptop RAG with JupyterLab), `[aml]`, `[modal]`. Python 3.9+. Add `--dry-run` to any launch to see the steps.
18
+
19
+ ## Packs
20
+
21
+ | Pack | What it builds | Where |
22
+ |---|---|---|
23
+ | `azure-labs` | Copy Azure VMs, disks and network from one resource group to another with snapshots, or snapshot a dead VM or disk. Source is read-only. An Azure Lab Services alternative. [Guide](docs/azure-labs.md) | Azure (needs `az login`) |
24
+ | `rag-sec-tutorial` | Nine notebooks: RAG on SEC 10-K filings with embeddings, pgvector, hybrid search, citations, an evaluation gate, a deployed app | Databricks Free Edition |
25
+ | `db-agent` | [db-agent](https://github.com/db-agent/db-agent) text-to-SQL app on Databricks Apps, pinned commit | Databricks Free Edition |
26
+ | `dbx-lakehouse` | Medallion lakehouse (bronze, silver, gold) from real open data, with masks, a row filter, notebooks and exercises. [Guide](docs/dbx-lakehouse.md) | Databricks Free Edition, AWS, Azure |
27
+ | `dbx-workspace` | Premium Databricks workspace via Terraform. Plan only unless `apply=yes`. [Guide](docs/dbx-workspace.md) | AWS or Azure (costs money) |
28
+ | `aml` | Synthetic anti-money-laundering lab with an answer key: RAG for developers, Microsoft 365 Copilot for staff. [Guide](docs/aml.md) | Your machine |
29
+ | `rag-ide` | Private browser VS Code per learner with the RAG lab | Modal, EC2 or Docker |
30
+
31
+ Also: `labagent rag init --dir ~/rag-lab` makes a laptop RAG lab of nine notebooks (needs `[rag-lab]`), and `labagent rag destroy --dir ~/rag-lab` removes it. See [docs/rag-local.md](docs/rag-local.md). AWS cohort sandboxes (Terraform IAM, plan-then-apply cleanup) run through `labagent run --job job.json`: see [docs/job-contract.md](docs/job-contract.md).
32
+
33
+ ## Azure: move VMs between resource groups
34
+
35
+ ```bash
36
+ export LABAGENT_ALLOWED_AZURE_SUBSCRIPTIONS=$(az account show --query id -o tsv)
37
+ labagent launch azure-labs --name move1 --param source_rg=legacy-rg --param target_rg=new-rg
38
+ labagent launch azure-labs --name old1 --param source_rg=legacy-rg --param target_rg=archive-rg --param snapshot_only=true
39
+ labagent destroy azure-labs --name move1 --param target_rg=new-rg
40
+ ```
41
+
42
+ Parameters: `source_rg`, `target_rg`, `vms` (comma list, default all), `snapshot_only`, `subscription`. Same subscription and region. It does not copy availability sets, scale sets, unmanaged VHDs, customer-key encryption, extensions or public IP addresses (a new address is created). Tested on a real subscription with Ubuntu VMs. Not Azure Lab Services and not from Microsoft.
43
+
44
+ ## For AI coding agents and scripts
45
+
46
+ - Output is one JSON envelope on stdout (`status`: `ok`, `partial`, `failed`; `items` per step). Exit code 0, 1, 2. Logs go to stderr and never contain secrets.
47
+ - `labagent packs --json` lists every pack with parameters, defaults, platforms and cost tier.
48
+ - Every `launch` is idempotent. Run it again to resume. `destroy` deletes only resources carrying the pack's tags or state.
49
+ - Safety gates: `LABAGENT_ALLOWED_ACCOUNTS` (AWS), `LABAGENT_ALLOWED_SUBSCRIPTIONS` (Databricks on Azure), `LABAGENT_ALLOWED_AZURE_SUBSCRIPTIONS` (azure-labs). An empty list refuses to run.
50
+ - Plain English front end: `labagent "deploy rag-tutorial"` prints the command it understood and asks first (local Ollama or any OpenAI-compatible endpoint).
51
+
52
+ ## Status
53
+
54
+ Run end to end on real services: Databricks Free Edition labs, the AWS premium workspace, and azure-labs copy and delete on Azure. Tested only against mocks so far: Azure and custom-network `dbx-workspace`, and `dbx-lakehouse` on AWS and Azure. Try labs in a throwaway workspace or account first.
55
+
56
+ Apache-2.0. [SECURITY.md](SECURITY.md), [CONTRIBUTING.md](CONTRIBUTING.md), [docs/packs.md](docs/packs.md). Related: [db-agent](https://github.com/db-agent/db-agent), [labagent-datasets](https://github.com/becloudready/labagent-datasets). Maintained by [BeCloudReady](https://becloudready.com/).
@@ -0,0 +1,76 @@
1
+ ---
2
+ license: cc-by-4.0
3
+ language:
4
+ - en
5
+ pretty_name: Synthetic AML Transactions with Ground Truth (Canada and US)
6
+ size_categories:
7
+ - 10K<n<100K
8
+ task_categories:
9
+ - tabular-classification
10
+ - question-answering
11
+ tags:
12
+ - finance
13
+ - anti-money-laundering
14
+ - aml
15
+ - synthetic
16
+ - transaction-monitoring
17
+ - fintrac
18
+ - bank-secrecy-act
19
+ - rag
20
+ ---
21
+
22
+ # Synthetic AML Transactions with Ground Truth (Canada and US)
23
+
24
+ Draft dataset card. The release is not published yet. Replace the placeholders marked `TODO` after you publish it.
25
+
26
+ A synthetic anti-money laundering dataset for a made-up credit union, Maple Ridge Credit Union. It has customers, accounts, transfers, alerts, a short profile for each customer, name-screening results, and an answer key for every alert. Policies, case files and exercises are built from the same data by the [labagent](https://github.com/becloudready/labagent) `aml` pack.
27
+
28
+ ## What is in it
29
+
30
+ | File | Rows (small set) | Holds |
31
+ |---|---|---|
32
+ | `customers` | 300 | Synthetic name, person or business, occupation or industry, country, risk rating, expected monthly activity, onboarding date |
33
+ | `accounts` | 429 | Account, owner, type, open date, branch |
34
+ | `transactions` | about 42,000 | Time, from, to, amount, currency, channel (wire, cash, e-transfer, card, crypto off-ramp), description |
35
+ | `alerts` | 72 | Rule triggered, account, date, amount, risk score |
36
+ | `ground_truth` | 72 | Label (escalate, monitor, dismiss), pattern, accounts and transfers involved, reason |
37
+ | `kyc_profiles` | 300 | One short text profile per customer |
38
+ | `sanctions_hits` | 6 | Customer names seeded to match 12 OFAC SDN entity names, tagged TEST DATA |
39
+
40
+ A `medium` set has 2,000 customers, about 281,000 transfers and 552 alerts. Files are CSV, and Parquet when available. Generated with seed 42 unless the release says otherwise.
41
+
42
+ ## How it was made
43
+
44
+ A seeded Python generator creates normal activity first (payroll, rent, card spending, business sales, supplier payments). It then adds labelled cases:
45
+
46
+ - the 8 laundering patterns from Altman et al. (2023), arXiv 2306.16424: fan-out, fan-in, gather-scatter, scatter-gather, cycle, random, bipartite and stack;
47
+ - laundering disguised as payroll or supplier invoices, as described in the same paper;
48
+ - name matches to OFAC SDN entity names, exact and slightly misspelled;
49
+ - look-alikes that deserve a closer look (monitor), such as many small gifts or a loan and its repayment;
50
+ - ordinary events that trigger a rule for a harmless reason (dismiss), such as a house sale.
51
+
52
+ The patterns follow IBM's [AMLSim](https://github.com/IBM/AMLSim) (Apache-2.0) and the paper. No IBM code or data is included. The evidence-bundle design follows arXiv 2604.19755.
53
+
54
+ ## Intended uses
55
+
56
+ - Teaching and testing retrieval-augmented generation over policies, regulations and case files.
57
+ - Practising alert triage, narrative writing and citation checking.
58
+ - Training non-technical staff to use Microsoft 365 Copilot on ordinary Excel and Word files.
59
+
60
+ ## Limits
61
+
62
+ - **Labels come from how the data was built.** No investigator reviewed them. A model that scores well here may not do well on real data.
63
+ - Amounts, timing and customer behaviour are simplified. Real laundering is rarer and messier.
64
+ - Names are invented. A name may match a real person by chance.
65
+ - The sanctions names are real entity names from a US government list, used only to practise screening. The list changes. This is not a current list.
66
+ - It covers Canada and the United States. Rules cited in the documents were read from the real text on the date in each file. They are not legal advice.
67
+
68
+ ## Licence
69
+
70
+ Data: CC BY 4.0. Code: Apache-2.0. Regulation text, if you download it with the pack, keeps its own terms: US government work for 31 CFR Chapter X, and the Open Government Licence - Canada for the PCMLTFA and its regulations. FINTRAC guidance is downloaded on your machine and is not part of this dataset.
71
+
72
+ ## Cite
73
+
74
+ Altman, E., Blanuša, J., von Niederhäusern, L., Egressy, B., Anghel, A., Atasu, K. (2023). Realistic Synthetic Financial Transactions for Anti-Money Laundering Models. arXiv:2306.16424. Please cite it if you use the patterns.
75
+
76
+ Dataset: BeCloudReady, labagent AML pack. TODO: release URL and version.
@@ -0,0 +1,28 @@
1
+ # Kaggle dataset description (draft, not published)
2
+
3
+ **Title:** Synthetic AML Transactions with Ground Truth (Canada and US)
4
+
5
+ **Subtitle:** Customers, accounts, transfers, alerts and an answer key for a made-up credit union. For RAG, triage and Copilot practice.
6
+
7
+ **Description**
8
+
9
+ This dataset is synthetic. Maple Ridge Credit Union does not exist, and every name and number is invented.
10
+
11
+ It has seven tables: customers, accounts, transactions, alerts, ground truth, customer profiles and name-screening results. The small set has 300 customers, about 42,000 transfers and 72 alerts. Each alert has a decision (escalate, monitor or dismiss), a pattern and a plain-English reason.
12
+
13
+ The laundering cases use the 8 patterns from the IBM paper "Realistic Synthetic Financial Transactions for Anti-Money Laundering Models" (fan-out, fan-in, gather-scatter, scatter-gather, cycle, random, bipartite, stack), plus laundering disguised as payroll or supplier invoices. There are also look-alikes that deserve a closer look and ordinary events that trigger a rule for a harmless reason.
14
+
15
+ **Labels:** they come from how the data was built, not from an investigator.
16
+
17
+ **Use it to:**
18
+ - test a retrieval-augmented generation app over policies and regulations,
19
+ - practise alert triage and report narrative writing,
20
+ - teach Microsoft 365 Copilot on Excel and Word files.
21
+
22
+ **Generate more:** `pip install labagent`, then `labagent launch aml --name demo`. Same seed, same data. See the lab guide in the labagent repository, docs/aml.md.
23
+
24
+ **Licence:** CC BY 4.0. Credit: BeCloudReady labagent. Patterns after Altman et al. (2023), arXiv 2306.16424, and IBM AMLSim (Apache-2.0). No IBM data is included.
25
+
26
+ **Tags:** finance, banking, anti-money laundering, synthetic data, tabular data, classification
27
+
28
+ **Link back:** https://github.com/becloudready/labagent
@@ -0,0 +1,103 @@
1
+ # AML RAG lab: instructor notes
2
+
3
+ For the instructor of the build-it-yourself notebooks in an AML lab folder (`labagent launch aml --param mode=rag`). Add
4
+ `--param solutions=yes` to get `solutions/`. The guide for learners is `LAB_GUIDE.md` in the lab folder; the data and the finished
5
+ tool are described in [aml.md](aml.md).
6
+
7
+ **Audience:** developers who have done the [RAG lab](rag-local.md) (at least notebooks 1 to 6) and want to apply it to a regulated
8
+ domain. **Not for:** AML investigators who need to learn to *use* an AI assistant (use `mode=copilot`).
9
+ **Prerequisites:** Python functions, the RAG lab's `TinyStore` idea, `pip install -e '.[rag-local]'` and `jupyterlab`. No AML knowledge:
10
+ the policy text in the lab explains each rule, and the first notebook has learners read it.
11
+
12
+ ## The design: demo first, then build
13
+
14
+ The launch gives learners a **finished** assistant (`aml_tools.AmlLab`). They use it for 10 to 15 minutes (the tasks in `LAB_GUIDE.md`
15
+ and the top of notebook 1), so they know what good looks like. Then they build the parts themselves and compare with it at the end of
16
+ each notebook. Do not skip the demo: without it the build has no target.
17
+
18
+ ## Learning objectives
19
+
20
+ By the end a learner can:
21
+ 1. filter retrieval by metadata and explain why that is a correctness rule in compliance work;
22
+ 2. build an evidence bundle, **measure its completeness** against known-bad cases, and test it for answer leakage;
23
+ 3. verify the references in generated text (existence and support) and design a gate that silence cannot pass;
24
+ 4. score decisions against a key, beat a baseline, parse model output strictly, and read errors by pattern;
25
+ 5. say what a synthetic benchmark does and does not show.
26
+
27
+ ## Time arithmetic
28
+
29
+ Estimates from a timed solution run and a build, **not from a classroom**. The solutions run in about 15 seconds per notebook.
30
+
31
+ | Item | Minutes |
32
+ |---|---|
33
+ | Demo and the guide's tasks | 15 |
34
+ | Notebooks 1 to 4 (25 + 35 + 30 + 35) | 125 |
35
+ | Setup, if not done beforehand | 20 |
36
+ | Break | 15 |
37
+ | Live review of the "Your turn" questions | 30 |
38
+ | Float | 15 |
39
+ | **Total wall-clock** | **220 (3 h 40 min)** |
40
+
41
+ Run it as one half-day, or two sessions (notebooks 1 and 2, then 3 and 4). Notebook 2 is the longest and has the most to discuss.
42
+
43
+ ## Before the day
44
+
45
+ 1. `labagent launch aml --name demo --param mode=rag --param jurisdiction=ca --param solutions=yes` and run `solutions/` yourself.
46
+ `regulations=auto` downloads the regulation text from two government sites; if the room has no internet, launch beforehand and copy the folder.
47
+ 2. A Groq key for you (and optionally a shared fallback). Without a key notebooks 3 and 4 show the mock provider, and the checks still pass.
48
+ That is deliberate: the build is the lesson, not the model.
49
+ 3. Choose `jurisdiction`: `ca` or `us` for a single-rule room. `both` is a good stretch (the jurisdiction filter then matters), but it makes
50
+ the rule in notebook 4 reach about 0.81, not 0.89.
51
+
52
+ ## Numbers you will see (seed 42, size small, Canada)
53
+
54
+ | Measure | Value |
55
+ |---|---|
56
+ | Policy hit rate, 14 questions, MiniLM, top 5 | 0.86 (two misses: record keeping, the six narrative questions) |
57
+ | Key-transaction recall, own account only | 0.72 (worst alert 0.20) |
58
+ | Key-transaction recall, 5 hops, common parties cut | 1.00, about 21 rows per bundle |
59
+ | Always guessing "dismiss" | 0.42 |
60
+ | The solution's simple rule | 0.89 (US 0.89, both 0.81) |
61
+ | The packaged reference rule on the learner's bundles | 1.00 |
62
+
63
+ Numbers move a little with the embedding model version. The checks use thresholds, not exact values.
64
+
65
+ ## Where learners get stuck
66
+
67
+ | Symptom | Cause | Fix |
68
+ |---|---|---|
69
+ | `ModuleNotFoundError` in the launch | Old checkout. The rag-mode import was broken until the fix in this branch | Pull `main` |
70
+ | `FileNotFoundError: config.json` in a notebook | Jupyter was started outside the lab folder | Start `jupyter lab` in the lab folder, or open the notebook from `notebooks/` |
71
+ | `No module named aml_tools` | Same cause | Same fix |
72
+ | Notebook 2 recall stays at 0.72 | `hops` never reaches the code that follows other accounts | The loop must start again from the newly reached accounts, not from the alert account |
73
+ | Notebook 2 recall is high but the bundle has 500 rows | The common-party rule is missing | Skip transfers where either end is common, and do not step into common parties |
74
+ | Notebook 3 gate passes on mock output | It does not: `acceptable` rejects text with no citations | Check that `acceptable` requires at least two transactions and a rule |
75
+ | Notebook 4 stuck below 0.75 | Rules are too coarse | Print the disagreements, read two `reason` fields, add one rule at a time |
76
+
77
+ ## Judgment questions for live review
78
+
79
+ **Notebook 2: the bundle leaks if it uses the answer key for the alert itself. Is using the key for earlier cases also leakage?**
80
+ Target: no, if the earlier decisions really were made before this alert, as in practice. Yes, if "earlier" is judged by id rather than date, or if the data was split
81
+ carelessly. Fork: "then use all other alerts as examples." That leaks the future; ask what the model would see in production.
82
+
83
+ **Notebook 2: why is recall of the key transactions the right test for a bundle?**
84
+ Target: because the bundle sets the ceiling for every later step. Fork: "just give the model everything." Ask what 42,000 transfers cost in tokens and what the model does with them.
85
+
86
+ **Notebook 3: a citation check passes a text that cites nothing. What else catches a wrong claim?**
87
+ Target: a separate check that every amount is in the evidence or recomputable, and a human reviewer. Fork: "a second model checks the first." Useful, correlated errors, and
88
+ costs the same again; use as a filter, not a guarantee.
89
+
90
+ **Notebook 4: the reference rule scores 1.0. Is AML triage solved?**
91
+ Target: no. The labels were generated from the same patterns the rule reads. Fork: "then it will work on real data." Ask for three differences between this data and a real credit union
92
+ and what each does to the number.
93
+
94
+ ## What the lab does not cover
95
+
96
+ Entity resolution, network analytics at scale, model monitoring, regulatory expectations on model risk, and how to run a real case review. Say so.
97
+
98
+ ## Honest limits of this build
99
+
100
+ - Timings are estimates, not measured with learners.
101
+ - The model-based steps were exercised with the mock provider only. The parser and the prompt are checked structurally, not against a real model's output.
102
+ - The "family support" dismiss cases are the main remaining error of the solution's rule. That is intended: it gives the error analysis something to find.
103
+ - Tested on macOS with Python 3.9. Windows and Python 3.11 or newer are untested.
@@ -0,0 +1,143 @@
1
+ # AML lab: synthetic anti-money laundering data for RAG and Copilot
2
+
3
+ `labagent launch aml` builds a lab around a made-up credit union, **Maple Ridge Credit Union**. It generates customers, accounts, transfers and alerts, with an answer key for every alert. It also writes the policies, the case files and the regulation text. Every name and number is invented. The laws are real.
4
+
5
+ Two audiences use the same data:
6
+
7
+ | Mode | Who | What they get |
8
+ |---|---|---|
9
+ | `mode=rag` | Developers | An indexed corpus, a Python helper, three quality checks and a lab guide |
10
+ | `mode=copilot` | Staff at financial firms learning Microsoft 365 Copilot | A folder of Excel, Word and text files, a plain-English exercise guide, and a separate instructor folder with the answers |
11
+
12
+ ```bash
13
+ pip install "labagent[rag-local] @ git+https://github.com/becloudready/labagent" # rag mode: search and embeddings
14
+ pip install "labagent[aml] @ git+https://github.com/becloudready/labagent" # copilot mode: writes Excel and Word files
15
+ labagent launch aml --name demo --param mode=rag --param jurisdiction=ca
16
+ labagent launch aml --name spring --param mode=copilot --param jurisdiction=ca --param size=small
17
+ labagent destroy aml --name demo
18
+ labagent "set up the AML copilot lab for Canada" # plain English; it shows the command and asks first
19
+ ```
20
+
21
+ Options: `jurisdiction=ca|us|both`, `size=small|medium`, `seed=42`, `generator=builtin|snapshot`, `regulations=auto|fetch|skip`, `solutions=no|yes` (rag mode: also write the solved notebooks). Same seed, same data.
22
+
23
+ ## Synthetic AML dataset for RAG
24
+
25
+ In `mode=rag` the pack writes a lab folder:
26
+
27
+ | Path | What it holds |
28
+ |---|---|
29
+ | `data/` | Policy manual, alert procedure, report guide, regulation text and one case file per alert, as Markdown |
30
+ | `tables/` | `customers`, `accounts`, `transactions`, `alerts`, `kyc_profiles`, `sanctions_hits` as CSV |
31
+ | `answer_key/` | `ground_truth.csv`: the decision and the reason for every alert, kept apart |
32
+ | `aml_tools.py` | `AmlLab`: `ask`, `show`, `check`, `triage`, `score`. The finished assistant: the demo |
33
+ | `notebooks/` | Four build-it-yourself notebooks: the lab |
34
+ | `solutions/` | The solved notebooks, only with `--param solutions=yes` (for instructors) |
35
+
36
+ The corpus is indexed with the same client as the local RAG lab (`labagent.ai.rag`). Policies and regulations are chunked by section. Case files keep only the summary and the customer profile as text. Transactions stay in tables, because a table is the right shape for them.
37
+
38
+ Learners do three tasks: ask policy questions and read the citations, pull the **evidence bundle** for an alert, and draft a report narrative that cites real transaction IDs and sections. The bundle holds the customer profile, the alert trigger, the transactions around it, the matching policy and rule text, and similar earlier cases. The design follows the explainable triage paper (arXiv 2604.19755).
39
+
40
+ ### Two ways to use the folder: the demo and the lab
41
+
42
+ - **The demo is `aml_tools.AmlLab`.** It is a finished assistant, so learners see what a good result looks like before they build one. The tasks in `LAB_GUIDE.md` use it.
43
+ - **The lab is `notebooks/`.** Learners write the same parts themselves, and each part is tested against the data and the answer key:
44
+
45
+ | # | Notebook | The learner writes | Tested against |
46
+ |---|---|---|---|
47
+ | 1 | `01_policy_search` | a search with metadata filters (country, document type), and a hit-rate measure | the launch's own 14-question set |
48
+ | 2 | `02_evidence_bundle` | the transactions around an alert (own account, then following the money), similar earlier cases, the whole bundle | recall of the answer key's key transactions (0.72 own-account only, 1.00 with hops), and a canary test for answer leakage |
49
+ | 3 | `03_citations_and_narrative` | a citation checker, a gate that cannot be passed by saying nothing, the narrative prompt | invented IDs and sections, and a real ID from the wrong alert |
50
+ | 4 | `04_triage_and_evaluation` | a scorer, a rule that decides, a strict parser for a model's decision, an error analysis by pattern | the answer key and a majority-label baseline |
51
+
52
+ They use the same stub, check and solution format as the [RAG lab](rag-local.md), and start from working copies of the earlier exercises. Learners
53
+ need the RAG lab's `pip install -e '.[rag-local]'` and `jupyterlab`. Instructor notes: [aml-lab-instructor.md](aml-lab-instructor.md).
54
+ `destroy` removes the notebooks unless the learner has edited them: an edited notebook is their work and stays.
55
+
56
+ ### Quality checks
57
+
58
+ Every launch runs three checks and reports them in the result:
59
+
60
+ 1. **Retrieval hit rate** on 14 policy and regulation questions per country, each with a known answer. Gate: 0.6. With a real embedding model (all-MiniLM-L6-v2, top 5, seed 42) the hit rate was 0.79 to 0.86 for Canada, the United States and both. With the keyword-only fallback embedder it is about 0.43, so the gate is reported but not applied there.
61
+ 2. **Citation validity.** Every transaction ID, regulation section and policy section a reference narrative cites must exist. Gate: 1.0.
62
+ 3. **Triage agreement** with the answer key on 12 alerts (4 per label). Reported only. A fixed reference rule agrees on 99.9 percent of 1,152 alerts across 16 generated datasets. That shows the evidence is enough to decide. It does not measure a model. Set `llm=env` to score your chat model the same way.
63
+
64
+ ## AML transaction monitoring data with labels
65
+
66
+ The built-in generator is pure Python, needs no Java and no network, and is deterministic for a seed.
67
+
68
+ | Size | Customers | Accounts | Transfers | Alerts |
69
+ |---|---|---|---|---|
70
+ | `small` | 300 | 429 | about 42,000 | 72 |
71
+ | `medium` | 2,000 | 2,889 | about 281,000 | 552 |
72
+
73
+ Normal activity comes first: payroll, rent, card spending, business sales and supplier payments. Labelled cases are laid on top:
74
+
75
+ - **The 8 laundering patterns** from Altman et al. (2023): fan-out, fan-in, gather-scatter, scatter-gather, cycle, random, bipartite and stack.
76
+ - **Two disguised-payment cases**: illegal money paid out as payroll, or as supplier invoices just under the 10,000 limit.
77
+ - **Name matches** to a fixed set of 12 entity names from the OFAC SDN list. Fuzzy variants are included. Every row is tagged TEST DATA.
78
+ - **Monitor look-alikes**: many small gifts, cash at a cash business, a loan and its repayment, a payment passed to a supplier.
79
+ - **Dismiss cases**: a house sale, a bonus, a repeat family payment, a tuition wire.
80
+
81
+ Each alert has a label (`escalate`, `monitor` or `dismiss`), a pattern, the accounts and transactions involved, and a plain-English reason. In the small set: 22 escalate, 20 monitor and 30 dismiss.
82
+
83
+ **The labels come from how the data was built, not from an investigator.** They show what a good answer looks like. They do not show that a model which scores well here will do well on a real bank's data.
84
+
85
+ Tables are written as CSV, and as Parquet when `pyarrow` is installed. The schema is the same for every generator.
86
+
87
+ ## Copilot training data for banking
88
+
89
+ In `mode=copilot` the pack writes two folders and two zips:
90
+
91
+ ```
92
+ spring/ learner folder (spring.zip)
93
+ Policies/ policy manual, alert procedure, report guide (.docx)
94
+ Regulations/ excerpts of the rules, and FINTRAC guidance if fetched (.docx)
95
+ Cases/ one Excel workbook and one Word file per case, plus a case list
96
+ Data/ all transfers, customers, accounts, alerts; one file per month
97
+ Exercise Guide.docx 13 exercises, no answers
98
+ spring-instructor/ instructor folder (spring-instructor.zip)
99
+ Exercise Guide with Answers.docx
100
+ Instructor Answer Key.docx
101
+ ```
102
+
103
+ Every workbook holds real Excel tables, because Copilot in Excel works on tables. Learners upload the folder to OneDrive or SharePoint and turn on AutoSave. Microsoft documents these limits: Copilot in Excel needs `.xlsx` files in OneDrive or SharePoint with AutoSave on, files under 150 MB, and at most five files in one multi-file action. The guide tells learners about each one.
104
+
105
+ The 13 exercises cover four parts: policies, regulations, cases and data. Examples: "Summarize this case and list the red flags", "Which section covers cash deposits just under 10,000?", "Find all transfers over 5,000 to new payees in March". Each part ends with a **catch the AI's mistake** exercise: a short AI-style draft with planted errors that learners find by checking the files. The expected answers are computed from the data.
106
+
107
+ The learner files use no technical terms (no RAG, vectors, Databricks or code). The launch fails if a learner file contains one, if an instructor file is in the learner folder, or if a workbook has no table.
108
+
109
+ I have not run these files against a live Microsoft 365 Copilot tenant. Check the large Transactions file in your tenant before a class, and use the monthly files if Copilot struggles.
110
+
111
+ ## FINTRAC STR narrative practice
112
+
113
+ For Canada, the guide to writing the narrative asks six questions: who, what, when, where, why it is suspicious, and how the money moved. The rules the pack cites were read from the real text:
114
+
115
+ - PCMLTFA s. 7 requires a report when there are reasonable grounds to suspect.
116
+ - PCMLTF STR Regulations s. 9: send the report as soon as practicable after the measures that let you establish those grounds.
117
+ - PCMLTF Regulations s. 10 and s. 132: a financial entity keeps a record of $10,000 or more in cash, and reports it within 15 days.
118
+ - PCMLTF Regulations s. 148: keep records at least five years.
119
+
120
+ The US version cites 31 CFR 1020.320 (a SAR within 30 calendar days of detecting the facts), 31 CFR 1010.311 (currency transactions of **more than** $10,000) and 31 CFR 1010.306 (15 days). Note the difference: Canada says "$10,000 or more", the United States says "more than $10,000". The data contains cases where that difference matters.
121
+
122
+ In `mode=rag`, `lab.check(text)` tests a narrative: every transaction ID and section it cites must exist. Section numbers are checked against `labagent/packs/aml/data/reg_index.json`.
123
+
124
+ ## Sources and licences
125
+
126
+ | Source | How it is used | Licence |
127
+ |---|---|---|
128
+ | Built-in generator, policies, case files | Written by labagent | CC BY 4.0 for published data; Apache-2.0 for code |
129
+ | OFAC SDN list | 12 entity names, kept in the repository with their list uids and the list date | US government work (public domain) |
130
+ | eCFR, 31 CFR Chapter X parts 1010 and 1020 | Downloaded at launch from govinfo. Redistributable, so it may go in a snapshot | US government work. The eCFR is an unofficial compilation |
131
+ | PCMLTFA and two regulations (Justice Laws XML) | Downloaded at launch. Redistributable with attribution | Open Government Licence - Canada. Not the official version |
132
+ | FINTRAC indicators and STR guidance | Downloaded on the instructor's machine at launch, never committed | FINTRAC's terms (not reviewed) |
133
+ | IBM AMLSim and Altman et al. (arXiv 2306.16424) | Source of the 8 patterns and the idea of disguised payments. No IBM code or data is included | AMLSim is Apache-2.0 |
134
+ | Triage paper (arXiv 2604.19755) | Design of the evidence bundle and the three labels. No code or data used | CC BY 4.0 (paper) |
135
+
136
+ A snapshot can only contain sources marked "bundled" in `labagent/packs/aml/licences.py`. Building a snapshot with a fetch-only source fails. OpenSanctions (CC BY-NC 4.0) is not used. FFIEC manual sections, the IBM Kaggle dataset, SAML-D and Elliptic2 are not used either: their redistribution terms were not verified.
137
+
138
+ ## Not built yet
139
+
140
+ - Databricks Lakebase platform and the `rag-ide` option.
141
+ - `generator=amlsim` (run IBM AMLSim in Docker) and the optional importers.
142
+ - A published `aml-synthetic` snapshot. Until it exists, `generator=snapshot` stops with a clear message.
143
+ - Upload to SharePoint through Microsoft Graph.
@@ -0,0 +1,99 @@
1
+ # Azure Labs: move Azure VMs from one resource group to another
2
+
3
+ A simple lift and shift for Azure VMs. It copies the VMs, their disks and their network into another resource group, and it never changes the source.
4
+ It can also just snapshot disks, for an old VM or disk you want to keep somewhere else.
5
+
6
+ This is an alternative for people moving off Azure Lab Services (retiring June 28, 2027). It is not Azure Lab Services and not from Microsoft.
7
+ Lab VMs are ordinary Azure VMs, so this works for any VM in a resource group, not only lab VMs.
8
+
9
+ ## What you need
10
+
11
+ - The Azure CLI, signed in: `az login`.
12
+ - Your subscription ID in the allow list. labagent refuses to run on any other subscription.
13
+
14
+ ```bash
15
+ export LABAGENT_ALLOWED_AZURE_SUBSCRIPTIONS=$(az account show --query id -o tsv)
16
+ ```
17
+
18
+ PowerShell: `$env:LABAGENT_ALLOWED_AZURE_SUBSCRIPTIONS = az account show --query id -o tsv`
19
+
20
+ ## Copy VMs to another resource group
21
+
22
+ ```bash
23
+ labagent launch azure-labs --name move1 --param source_rg=azure-labs-legacy --param target_rg=azure-labs-new
24
+ ```
25
+
26
+ | Parameter | Meaning |
27
+ |---|---|
28
+ | `source_rg` | Group to copy from. It is only read. |
29
+ | `target_rg` | Group to copy into. Created if it does not exist. |
30
+ | `vms` | Comma list of VM names. Default: every VM in the source group. |
31
+ | `snapshot_only` | `true` copies only disk snapshots (no VMs, no network). With no `vms`, it also takes disks that no VM is using. |
32
+ | `subscription` | Subscription ID or name. Default: the one `az login` selected. |
33
+
34
+ What it does, in order: reads the source, checks vCPU quota, creates the target group if needed, snapshots every disk into the target,
35
+ copies the virtual network, subnets, network security groups (with their rules), public IPs and NICs, creates disks from the snapshots,
36
+ creates the VMs on those disks, and checks that each VM is provisioned. Every copied resource keeps its name and gets these tags:
37
+ `labagent=1`, `pack=azure-labs`, `name`, `migrated_from`, `created_at`.
38
+
39
+ Run it again after a failure: it skips what already exists and carries on. Add `--dry-run` to see the steps without running them.
40
+
41
+ The new VMs boot the same operating system with the same accounts and data (a specialized copy), so no password is needed or created.
42
+ They start running. The source VMs keep running too, and both count against your vCPU quota. Stop the sources, or copy fewer VMs at a time with `vms=`.
43
+
44
+ ## Snapshot an old VM or disk
45
+
46
+ ```bash
47
+ labagent launch azure-labs --name old1 --param source_rg=azure-labs-legacy --param target_rg=azure-labs-archive --param snapshot_only=true
48
+ ```
49
+
50
+ Snapshots land in the target group as `snap-<disk name>`. Create a disk or VM from one whenever you need it.
51
+
52
+ ## Delete
53
+
54
+ ```bash
55
+ labagent destroy azure-labs --name move1
56
+ ```
57
+
58
+ Deletes only what that migration created in the target group (found by its tags), dependants first. It deletes the target group too if labagent created it
59
+ and nothing else is in it. Anything in the group without the tags is reported and left alone. The source group is never touched.
60
+
61
+ ## What it does not copy
62
+
63
+ It stops before creating anything, and lists the reasons, if a VM is in an availability set or scale set, uses an unmanaged VHD,
64
+ uses encrypted disks with your own keys, has a NIC with more than one IP configuration, or uses application security groups.
65
+
66
+ - Public IP addresses change: you get a new address with the same name.
67
+ - Data disk order is kept, but LUN numbers and caching settings are not.
68
+ - VM extensions, managed identities, boot diagnostics settings and backups are not copied.
69
+ - Same subscription and same region only. Copying across subscriptions is not built.
70
+ - Managed images are not copied. Create a VM from the image, then snapshot that.
71
+
72
+ ## Try it on a test group
73
+
74
+ Create a small legacy group first. Three B1s VMs fit a 10-vCPU quota twice over.
75
+
76
+ ```bash
77
+ az group create -n azure-labs-legacy -l canadacentral
78
+ az network nsg create -g azure-labs-legacy -n legacy-nsg
79
+ az network nsg rule create -g azure-labs-legacy --nsg-name legacy-nsg -n allow-ssh --priority 100 --destination-port-ranges 22 --access Allow --protocol Tcp
80
+ az network vnet create -g azure-labs-legacy -n legacy-vnet --address-prefixes 10.30.0.0/16 --subnet-name app --subnet-prefixes 10.30.1.0/24 --network-security-group legacy-nsg
81
+ for i in 1 2 3; do
82
+ az vm create -g azure-labs-legacy -n legacy-vm$i --image Ubuntu2204 --size Standard_B1s --vnet-name legacy-vnet --subnet app \
83
+ --public-ip-address "" --nsg "" --admin-username azureuser --generate-ssh-keys
84
+ done
85
+ az vm disk attach -g azure-labs-legacy --vm-name legacy-vm1 --name legacy-vm1-data --new --size-gb 8
86
+ az disk create -g azure-labs-legacy -n old-dead-disk --size-gb 4
87
+ ```
88
+
89
+ Then run the copy, check the result, and delete it:
90
+
91
+ ```bash
92
+ labagent launch azure-labs --name test1 --param source_rg=azure-labs-legacy --param target_rg=azure-labs-new
93
+ az vm list -g azure-labs-new -d -o table # 3 VMs, running
94
+ az resource list -g azure-labs-legacy -o table # unchanged
95
+ labagent destroy azure-labs --name test1
96
+ az group exists -n azure-labs-new # false
97
+ ```
98
+
99
+ Clean up the test source with `az group delete -n azure-labs-legacy --yes`.