Work in progress: this page is under construction · noindex · the product is a private, password-gated preview.
← Back to portfolio

Case study · in progress

Qela — structuring resilience

A local-first “case workbench” that turns years of scattered documents into a validated, navigable knowledge base — and prepares precise, source-backed handover packages for a lawyer. It organises and substantiates; it does not give legal advice.

Python 3.12 Local-first Claude Agent SDK Human-in-the-loop AI Legal-tech (RDG) Privacy by design
Qela — structuring resilience
Role
Solo — architecture, AI system design, engineering
Stack
Python 3.12 · PyMuPDF · libpff · Pillow · Claude Agent SDK · YAML / JSONL
Timeline
In progress since mid-2026, part-time
Year
2026
Status
In progress (private preview at qela.legal, password-gated)

Collect behind your own wall, order and substantiate, then act with precision — only the final step ever leaves your machine, and only once you approve it.

The challenge

People caught in long-running disputes inside small property-owner associations (in Germany, two-party WEGs) are structurally outmatched: floods of paper used as an attrition tactic, cost asymmetry, statute-of-limitation traps, and evidence scattered across years — emails, messenger chats, scans, photos, court files. Law firms often decline these matters because the sheer cost of getting up to speed is unpayable. Someone who is in the right can still lose simply because they cannot get their own material into order.

The name says the intent. Qela is the Hebrew qelaʿ — both the woven curtains that enclose a courtyard and David’s sling. The enclosure is the local-first data; the sling is precise, well-prepared input for a lawyer. Not force — preparation and accuracy.

The approach

  • Local-first by design (data sovereignty). The entire document set is ingested on the user’s own machine — email (mbox/Thunderbird, PST, IMAP), WhatsApp exports, mobile devices, PDFs, scans and photos. The central data pool never leaves the user’s disk; only model-API calls go out, using the user’s own key.
  • A validated knowledge base. Messages live in a JSONL store; facts, people, proceedings and relationships in human-readable, diff-able YAML registers. Every fact carries a confidence level, and a bidirectional lifecycle weighs a claim against the document that would prove it.
  • Human-in-the-loop AI with adversarial checks. Five fixed check-loops run after every finding; an explicit human-gate requires active confirmation; and an “advocatus diaboli” refutation pass tries to break each conclusion before anything can leave the send-gate.
  • Compliant by design (RDG). The tool orders, links, documents, calculates and prepares — it never renders legal advice. Deadlines and legal classifications are always flagged “to be checked by a lawyer.” The law-firm interface is part of the architecture, not an afterthought.
  • A request interface for the lawyer, not a data dump. Instead of handing over raw files, the firm gets a structured, AI-searchable request channel: queries are bundled, processed locally on the user’s machine, and results released only after explicit approval. The handover packages cut the onboarding a firm would otherwise have to charge for.

The result

  • A working Python core (the “M1 harness”): ingest pipeline, registers, confidence system, the five check-loops, a validator with a send-gate, and an AI layer with provider routing on the Claude Agent SDK — all backed by an extensive test suite.
  • A private, password-gated preview at qela.legal.
  • The case-neutral distillation of a real, hyper-complex long-running matter — under an iron rule that no real case data ever enters the codebase; all test data is synthetic.

What this demonstrates

  • Systems thinking on a genuinely hard domain: ingest pipelines, a confidence model, human-in-the-loop AI with adversarial verification, and legal compliance built into the architecture rather than bolted on.
  • Serious AI engineering: multi-provider routing by data class × task type, an agent harness, and a GDPR consent gate.
  • Judgement about where automation must stop — the human-gate and the “organises, does not advise” line are deliberate design decisions, not limitations.
  • Local-first privacy treated as a first principle, not a feature.

Tech at a glance

Python 3.12 · PyMuPDF · libpff (PST) · Pillow (vision) · pytest · Claude Agent SDK · YAML registers · JSONL store · Local-first · Human-in-the-loop · RDG-compliant architecture