BuildBotsBetter
BUILDBOTSBETTER
All Builds
Guided Build · ChatGPT Codex

Build Your Own AI Swarm in Databricks with Genie

Build three analytical lanes, verify their answers, and supervise the result.

4-6 hours; live account verification additionalwindows · macos · linux$0 required practice; optional cloud use needs approved budget

Finish with: Create a working free PRACTICE swarm and prepare a scoped live Genie SDK workflow with persistent evidence, failure drills and human approval.

Progress stays in this browser. Export to keep a portable record.

Do this now

Walkthrough

A step demonstration outline; use optional narration while you follow it.

Resources for this step

Check the result

This browser checks the evidence format and your checklist. It cannot inspect your computer or certify a live login.

When it does not work

Finish-line test

# Executive M&A due diligence: evidence gate Practice rehearsal: run the three-domain sample, inject a transient failure and a wrong metric, inspect retained history, compare independent totals and approve only unchanged passing bytes. This proves coordination machinery over invented fixtures. Real graduation: choose a new owner-approved company dataset and a fresh question spanning finance, retention and operations. Record period/currency/population, lawful access, metric definitions and independently executed reference SQL. Adapt QUESTIONS and EXPECTED deliberately; sample oracle values are invalid for a new dataset. Observe actual three-space calls, concurrency or quota-related serial limits, data provenance, incomplete/empty/truncated results, failure diagnosis, bounded retries, actual cost and an identified human review. Save report hashes and decisions. A general autonomous mission planner, distributed Delta queue, live dashboard monitoring and hard cloud budget controls remain extensions. Do not award arbitrary M&A valuation graduation from this fixed recipe.

Sources and verification limits

Sources checked 2026-10-13. Live Databricks SDK calls, account permissions and deployment have not been executed by the author. Required lab uses deterministic fixture workers and a fixed planner, not autonomous general AI planning. SQLite runtime is not integrated with Delta; templates do not implement distributed claiming or durable Apps storage. Dashboard displays completed practice runs, not live progress, tokens or DBU meters. Local limits cannot cancel remote jobs or guarantee a hard cloud spend ceiling. Practice sample metrics do not establish arbitrary M&A valuation or causal business conclusions. macOS/Linux commands are displayed but actual execution unverified; no rendered video claimed.

Complete lesson text and action cards

Source-owned text for offline reading and retrieval. Command success still requires actual local evidence.

Draw the mission path

Draw human -> coordinator -> queue -> finance/customer/operations specialists -> verifier -> report -> human approval. Mark which components are software and which still need your judgment. The required kit is deterministic PRACTICE, not AI.

Expected: Your diagram includes verification and approval, and labels practice workers.

Choose a completion track

Download Resources and extract into a new bbb-genie-practice folder outside shared or profile folders. Read README.md. Choose free offline practice or a separately authorized Databricks workspace. Live sign-in and spend are never required for practice.

Expected: Python 3.10+ is available; you can explain the difference between practice completion and live graduation.

windows

python --version

macos

python3 --version

linux

python3 --version

Check workspace prerequisites

For live work ask the workspace owner to confirm Unity Catalog, an accessible SQL warehouse, Genie availability, Databricks Apps availability and an approved spend plan. Record cloud and region. If absent, continue practice and mark live steps deferred. If this optional live or dependency check is unavailable, enter DEFERRED with a concrete reason; continue the free practice track without claiming live execution.

Expected: An access checklist names each available or deferred feature without recording secrets.

Create three scoped specialists

In Genie create an agent/space for finance, customers and operations. Choose your sample table, SQL warehouse and descriptions from workspace-guide.md. Add the exact metric definitions. Run each question directly before wiring orchestration. Do not add production tables. If this optional live or dependency check is unavailable, enter DEFERRED with a concrete reason; continue the free practice track without claiming live execution.

Expected: Each specialist returns its single expected sample total: revenue 3000, churned 3, late_orders 4; or the live check is explicitly deferred.

Inspect the work orders

Open swarm.py and read QUESTIONS and EXPECTED. Match each work order to one domain. Copy a mission contract into evidence.md: dataset, period, three questions, runtime, call count, acceptance conditions and approval owner.

Expected: Three domain questions share the same sample period and population.

Run your first mission

In the extracted folder run the command. Open the new JSON under runs. Identify the PRACTICE label, three results, call count, cost and AWAITING_HUMAN state. The report is a factual metric summary, not an investment recommendation.

Expected: Three verified results await human review; cost is 0 and the planner says fixed recipe.

windows

python swarm.py

macos

python3 swarm.py

linux

python3 swarm.py

Inspect task transitions

Open memory-guide.md and use the command to list events. For every lane locate QUEUED, ASSIGNED, RUNNING, VERIFYING and COMPLETED. A failed lane must never be silently marked completed.

Expected: Every successful lane has timestamped transitions associated with a unique run ID.

windows

python inspect_memory.py

macos

python3 inspect_memory.py

linux

python3 inspect_memory.py

Prepare Delta memory deliberately

Read queue.sql and replace YOUR_CATALOG and YOUR_SCHEMA with an owner-approved sandbox. Run only in an authorized Databricks SQL editor. This creates new swarm event tables; it does not connect the local runtime. Record the remaining adapter work in evidence.md. If this optional live or dependency check is unavailable, enter DEFERRED with a concrete reason; continue the free practice track without claiming live execution.

Expected: The two Delta tables exist in the sandbox, or live setup is deferred; the missing distributed claim/lease adapter is recorded.

Authenticate under your identity

Read workspace-guide.md. Create a virtual environment, install requirements and authenticate the Databricks CLI using OAuth under your own identity. Use databricks auth describe to confirm the host and identity locally. Never paste tokens into course evidence. If this optional live or dependency check is unavailable, enter DEFERRED with a concrete reason; continue the free practice track without claiming live execution.

Expected: The dependency installation succeeds; live identity is confirmed locally or explicitly deferred.

windows

python -m pip install -r requirements.txt

macos

python3 -m pip install -r requirements.txt

linux

python3 -m pip install -r requirements.txt

Connect and query the spaces

Copy config.example.json to config.json and enter the three real space IDs. Inspect Live.query in swarm.py: start_conversation_and_wait, query attachment, attachment results and provenance IDs. Run only after the owner approves cloud use. A timeout does not cancel remote SQL. If this optional live or dependency check is unavailable, enter DEFERRED with a concrete reason; continue the free practice track without claiming live execution.

Expected: The report says LIVE and includes conversation/message/attachment IDs and verified totals, or a diagnosed failed/deferred live check.

windows

python swarm.py --mode live --deadline 120

macos

python3 swarm.py --mode live --deadline 120

linux

python3 swarm.py --mode live --deadline 120

Prove overlap

Run the acceptance command. It compares the latest worker start with the earliest completion. Save the actual PASS output. The test uses temporary practice folders and retains their contents.

Expected: The overlap assertion passes and records actual simultaneous PRACTICE lanes.

windows

python test_swarm.py

macos

python3 test_swarm.py

linux

python3 test_swarm.py

Set a quota-aware boundary

Read the ThreadPoolExecutor max_workers=3 setting. In a copy of the practice script lower it to 1, rerun and inspect timestamps. Restore your copy to 3. For live spaces consult current workspace quotas; do not equate local threads with unlimited server capacity.

Expected: Your timestamps demonstrate the difference between serial and parallel execution.

Inject a recoverable failure

Run transient mode. Inspect finance RETRYING in memory and attempt=2 in its result. The call count is four. There is no alternate provider in this small lab; retry uses the same simulated specialist.

Expected: Finance recovers once, all lanes verify and the total call count is 4.

windows

python swarm.py --fault transient

macos

python3 swarm.py --fault transient

linux

python3 swarm.py --fault transient

Exhaust recovery safely

Run timeout mode; an exit code of 2 is expected. Compare retained attempts with the call cap. In live mode the code does not automatically resubmit ambiguous timed-out work. Inspect the existing conversation before deciding to retry.

Expected: Mission state is FAILED with no approval; the failed evidence remains available.

windows

python swarm.py --fault timeout

macos

python3 swarm.py --fault timeout

linux

python3 swarm.py --fault timeout

Reject plausible wrong numbers

Run bad-data mode. The customer lane returns 999 instead of 3 and the mission fails. Read verify(): column shape, finite numbers, exact sample totals, SQL and source presence.

Expected: The customer lane fails verification and the report cannot pass the human gate.

windows

python swarm.py --fault bad-data

macos

python3 swarm.py --fault bad-data

linux

python3 swarm.py --fault bad-data

Check source consistency

Open sample.csv and manually total the three columns. In live SQL use the independent checks from sample.sql. Confirm period, row count and definitions. Do not invent M&A valuation conclusions from three aggregates.

Expected: Both sample rows produce 3000 revenue, 3 churned and 4 late orders; a different dataset needs a different oracle.

Open the dashboard

After installing requirements, run this command in the extracted folder. Open http://127.0.0.1:8082 and run a sample mission. The button performs a short practice run; this dashboard shows the result after completion, not streaming worker telemetry. If this optional live or dependency check is unavailable, enter DEFERRED with a concrete reason; continue the free practice track without claiming live execution. If your assigned example port 8082 is occupied, use --server.port 8092 instead; if your fleet identity differs, use its allocated port from safety.md. Keep --server.address 127.0.0.1. Never borrow another agent’s assigned port.

Expected: PRACTICE label, AWAITING_HUMAN, report bytes, hash and retained history are visible.

windows

python -m streamlit run app.py --server.address 127.0.0.1 --server.port 8082

macos

python3 -m streamlit run app.py --server.address 127.0.0.1 --server.port 8082

linux

python3 -m streamlit run app.py --server.address 127.0.0.1 --server.port 8082

Review a failed mission

Choose bad-data in the dashboard and run. Confirm FAILED and no approval button. Read cost: only practice has 0; live cost is unknown until billing evidence is collected. Stop Streamlit with Ctrl+C when finished.

Expected: An invalid report has no release action and no invented cloud cost meter.

Trip a call boundary

Run with one call. Inspect FAILED lanes. Record max calls, SQL warehouse auto-stop, billing monitoring and a named owner for live spending. Budgets/alerts are not automatically hard spend stops. No autonomous external writes or publication are enabled.

Expected: At most one specialist call occurs and the mission fails closed.

windows

python swarm.py --max-calls 1

macos

python3 swarm.py --max-calls 1

linux

python3 swarm.py --max-calls 1

Approve exact reviewed bytes

Run a successful practice mission. Copy its run ID and REPORT_SHA256. Replace RUN_ID and SHA256 in the command, review that JSON and approve it. Then change a metric in a copy and repeat with the old hash: rejection is required. This gate is local evidence, not an authenticated enterprise approver service. Replace runs/RUN_ID.json with the actual saved report path and SHA256 with the printed REPORT_SHA256 after reading the report. A literal placeholder is rejected with exit 1.

Expected: A receipt binds the unchanged report hash; altered or failed reports are rejected.

windows

python swarm.py --approve runs/RUN_ID.json --hash SHA256

macos

python3 swarm.py --approve runs/RUN_ID.json --hash SHA256

linux

python3 swarm.py --approve runs/RUN_ID.json --hash SHA256

Repeat from a fresh run

Run the normal command again. Compare run IDs, inspect all three source-bearing results and record limitations. Retain prior runs and errors. No repeated-run proof should overwrite the first experiment.

Expected: A fresh unique run with three checked metrics and an unapproved final artifact is retained.

windows

python swarm.py

macos

python3 swarm.py

linux

python3 swarm.py

Write an evidence-based conclusion

In evidence.md write the totals, sources, verification method and uncertainty. State that this tiny sample does not establish causes, forecasts, company value or a general autonomous planner. Review before approving the local report.

Expected: Every factual claim maps to a result; unsupported strategic conclusions remain unanswered.

Prepare a Databricks App

Read deployment.md. Inspect app.yaml and requirements.txt, test locally first and copy only reviewed app resources to an approved workspace folder. Create an app in the workspace Apps UI and deploy that folder after checking cost and sharing. This app remains practice-only. If this optional live or dependency check is unavailable, enter DEFERRED with a concrete reason; continue the free practice track without claiming live execution.

Expected: The app configuration and required permissions are reviewed; deployment is verified in a workspace or marked deferred.

Choose the current agent route

Read current-route.md and the linked official docs. The October 12 docs label old Supervisor Agent and agent-server templates legacy. For new live multi-agent AI use current Genie Agents/Agent Bricks CLI guidance; do not copy a legacy deployment as a new recommended architecture. Rerun extracted-kit tests before release.

Expected: Practice acceptance passes and live deployment/modern orchestration evidence is clearly separate.

windows

python test_swarm.py

macos

python3 test_swarm.py

linux

python3 test_swarm.py

Attempt executive due diligence

Read capstone.md. For practice repeat the constrained three-metric due-diligence rehearsal and record its limited scope. For live graduation supply a new authorized dataset, independently checked questions/oracles, actual three-space results, failure handling, limits and approval. This shipped fixed planner does not solve arbitrary valuation challenges.

Expected: Your capstone record distinguishes the completed sample rehearsal from unearned general autonomous M&A graduation.

Build Bot Better and run later

Read safety.md. Save reports, config without tokens and a copy of memory.sqlite while the process is stopped; restore to a new folder and inspect. Onboard each real worker under its own login, folder and grants; never borrow peer credentials. Tomorrow open the extracted folder, run python test_swarm.py, then python swarm.py. Save one improvement and its reason in your own work journal. Record the restored backup folder and a retained run ID in your evidence; terminal history alone is not a backup.

Expected: A restored memory copy retains run IDs and failures; the run-later procedure and owner boundaries are recorded.

windows

python inspect_memory.py

macos

python3 inspect_memory.py

linux

python3 inspect_memory.py