ExigoTech-Beno rewrites the backend in Python and wires in AustLII for Australian legal search

A single 1,800-line commit replaces the TypeScript backend with a Python FastAPI service targeting Azure AI Foundry, and ships two Semantic Kernel plugins covering roughly 90 AustLII database paths across Commonwealth and state/territory courts. The Azure plumbing is all-in; the AU legal data is portable.

searchcompliance

The commit (10b1c82e) adds a parallel backend-agent/ Python service built on FastAPI and Semantic Kernel. The upstream TypeScript backend stays untouched - this is an additive implementation, presumably the start of a planned cutover. The Azure stack is fully specified: AzureChatCompletion for the model layer, asyncpg against Azure PostgreSQL Flexible Server, Azure Blob Storage replacing Cloudflare R2, and Entra External ID handling JWT validation in backend-agent/app/auth/middleware.py. The agent.yaml declares two Foundry protocols: responses for OpenAI-compatible streaming chat and Teams, invocations for batch tabular extraction.

The interesting part for anyone not targeting Azure Foundry is the plugin layer. backend-agent/app/plugins/austlii.py builds a AUSTLII_DATABASES registry of ~90 SINO mask paths - HCA, FCA, FCAFC, AAT, FWC, OAIC, NCAT, VCAT, QCAT, plus consol_act, consol_reg, and bill paths per jurisdiction - and exposes four Semantic Kernel functions: search_austlii, get_austlii_document, browse_legislation, lookup_act. A companion australian_legislation.py adds the 13 Australian Privacy Principles with a compliance checker. That's roughly 700 lines of AU-legal reference data and query construction.

Before pulling anything, check three things. The AustLII plugin uses a hard-coded Chrome User-Agent to bypass a 403 - fragile, and the code itself notes it's a TOS grey area for bulk/commercial use. The AzureChatCompletion(... ad_token_provider=None) call in chat.py passes None for the AAD token provider, which disables token acquisition entirely and will either fall back to an API key or fail; almost certainly a bug. And there are no tests, no migrations, and pydantic-settings silently defaults every secret to "" on missing env vars.

The austlii.py and australian_legislation.py files are the portable piece. The AUSTLII_DATABASES constants and SINO query structure work fine outside Azure and outside Semantic Kernel with minimal adaptation. Everything else in this commit is Azure-Foundry-specific and only relevant if that's also your deployment target.

So what Worth a look if you're building for Australian legal customers and need AustLII coverage -- the two plugin files are a ready-made ~700-line AU-law reference layer you'd otherwise have to build yourself. Skip the FastAPI scaffolding and Azure Foundry wiring unless you're already on that platform. Fix the `ad_token_provider=None` bug before any production use.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

1 commit from ExigoTech-Beno/mikeoss, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
10b1c82e feat: Azure-native Python backend agent with AustLII integration Ben Opit 2026-05-07 ↗ GitHub
commit body
- Add backend-agent/ Python FastAPI app replacing TypeScript backend
  - Azure AI Foundry Hosted Agents (Responses + Invocations protocols)
  - Semantic Kernel with AzureChatCompletion
  - Entra External ID JWT auth middleware
  - asyncpg connection pool for Azure PostgreSQL
  - Azure Blob Storage layer replacing Cloudflare R2
  - Full CRUD routes: chat, documents, projects, tabular, workflows, user, downloads

- Add Australian legal plugins for Semantic Kernel
  - austlii.py: AustLII SINO search engine integration
    - 90+ database mask_path values (all courts/tribunals across 9 jurisdictions)
    - 21 known Commonwealth Acts with consol_act identifiers
    - search_austlii, get_austlii_document, browse_legislation, lookup_act tools
    - Correct sinosrch.cgi endpoint + browser User-Agent (required to avoid 403)
  - australian_legislation.py: All 13 APPs + legislation.gov.au + APP compliance checker

- Add Dockerfile and agent.yaml for Foundry Hosted Agent deployment
- Add azure-approval-request.html for Azure resource provisioning request

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-179.md from inside the repo you want the changes in.

⬇ Download capture-thread-179.md