Case study

Lawyers back on legal judgment.

One of the largest pharmacy networks in its market runs 900+ pharmacies with 5,600+ employees, in one of the most regulated retail sectors there is. Drug pricing, consumer protection, labor law and criminal matters from in-store theft all land on the same desk: a legal team of four. Today, a legal assistant built on FlowX.AI is live for that team: four agents on one knowledge base, two the lawyers work with directly (case analysis and document drafting) and two in the background that keep the knowledge base current (legislation monitoring and knowledge ingestion).

  • Healthcare
  • Pharmacy retail
  • Legal department
  • Labor law
  • Human-in-the-loop

Live in production, on the identity provider already in place

0+
Pharmacies covered by a legal team of four
~0
Labor-law acts in a knowledge base that updates itself from a daily legislative alert
0
Sections in every case analysis, in the same order, every time
0
Case categories covered, from authority controls to criminal matters

What if in-house lawyers spent their time on legal judgment, not on the research and drafting?

A typical case starts with a piece of paper: an employee complaint, an invitation from the consumer protection authority, a summons from a local authority. The lawyer works out which laws apply, checks whether the article they know by heart was amended since last year, searches for precedent, drafts the response and tracks the case until it is decided. Then the outcome disappears into an archive and into the lawyer’s memory.

The team described its load as “26 to 29 hours of work a day”, and most of those hours went on finding the law, not taking action.

The starting position

The pressure was structural, not just operational.

Four uncomfortable truths defined the starting state.

0
Lawyers in the legal team
~0
Legal cases per year
0%+
Lawyer time on research and extraction
01

Four lawyers carried the legal exposure of 900+ pharmacies

Roughly 200 cases a year, 15-to-30-day regulatory deadlines, and more than 80% of the team’s time spent finding information instead of deciding what to do with it.

02

Research outside the routine was improvised

Experience covered the daily cases. Everything else looked, in the team’s own words, like this: “He goes to the portal, types three words, gets a pile of normative acts, then goes to Google, then to ChatGPT and asks which laws he should rely on.”

03

The law moved faster than the team could read it

One amending act can touch five others; a Constitutional Court decision can void an article overnight. Daily legislative alerts arrived, but turning one into an updated legal position was manual work.

04

The department had no memory of its own

Case history sat in different places, consolidated by hand once a month. Every fine annulled or dismissal upheld was a precedent the company had paid for, and none of it was searchable. With 5,600+ employees, the risk was not only slowness. It was treating two identical cases differently.

What changed

Finding the law, handed to the agents.

The research, the drafting and the reading of new legislation moved to the assistant. The legal judgment, and the responsibility for it, stayed with the lawyers.

  1. Pain point

    Research outside the routine improvised; no consistent way to find the applicable law.

    How we solved it

    A case analysis agent reads the chat, up to 10 attached documents (including scans via OCR) and the knowledge base, and returns the same seven sections every time, in the local language or English.

  2. Pain point

    Every viewpoint, summons, sanctioning decision or criminal complaint written from a blank page.

    How we solved it

    A document drafting agent turns the analysis into an editable Word draft from the department’s templates. The target is a draft of 90% there, so the lawyer changes two or three words.

  3. Pain point

    Daily legislative alerts turned into updated legal positions by hand.

    How we solved it

    A legislation monitoring agent reads each alert, fetches the acts from the official national legislation portal, judges their relevance to labor law and updates the knowledge base.

  4. Pain point

    No precedent system; decisions consolidated by hand every month.

    How we solved it

    A case lifecycle that feeds the knowledge base: only cases a lawyer closes with a real outcome become precedent, and the history is searchable in natural language.

  5. Pain point

    An AI answer is a liability if nobody can correct it or own it.

    How we solved it

    Assistive, not authoritative. A lawyer reviews, edits and sends every document and keeps legal responsibility. Any cited law or precedent can be unchecked and the analysis rerun.

The assistant

Four agents on one living knowledge base.

The lawyer describes a matter and attaches the documents. The assistant returns the same seven-section analysis every time, then an editable Word draft from the department’s own templates.

01

Case analysis

Seven fixed sections, always in the same order: case summary; legal framework (laws and articles, with EU rules as transposed into national law); recommended actions; legal arguments; vulnerability analysis (weak points and the counter-arguments to expect); required documents; and relevant jurisprudence (similar internal cases, newest first, plus external decisions marked “External”). The lawyer can uncheck any law or precedent and the next run excludes it: a structured way to correct the agent without prompt engineering.

02

Document drafting

Once the analysis is right, the lawyer presses “Generate document” and picks a template: a formal viewpoint for authority controls; an employee summons, final report or sanctioning decision for HR; a criminal complaint; written notes for litigation; a substantiation note, a dissolution decision or a termination decision. The template carries the company header, mandatory sections and closing formula; the agent writes the content.

03

Legislation monitoring

The knowledge base is seeded with ~30 labor-law acts chosen by the legal team. Each daily alert email triggers the agent, which tracks new labor-law acts and adds or updates them. The source is an alert the team already paid for plus a free official portal, so the corpus stays current without a commercial legislation contract. Lawyers see exactly which acts the agent is reading.

04

Knowledge ingestion

Internal regulations, procedures and external jurisprudence are uploaded per category, and the agent writes a three-to-five-line summary of each so the lawyer can confirm it is understood. Versions are replaced, never merged.

The memory loop

Only human-closed cases become precedent.

Every case the lawyer closes with a real outcome flows back in as precedent. Over time, the department’s own history becomes the agent’s jurisprudence.

Status 01

Draft

  1. 1

    Leave and resume

    A case starts as a Draft the lawyer can leave and resume days later, a status that exists because one lawyer described being called to another floor mid-analysis.

Status 02

Pending

  1. 2

    The lawyer’s document of record

    Saved as final, it becomes Pending, and the lawyer’s final edited document, not the AI draft, becomes the document of record.

Status 03

Resolved

  1. 3

    Precedent, human-closed

    Once the real-world outcome is known, it becomes Resolved, turns read-only and is indexed into the knowledge base. Only human-closed cases become precedent, so the agent never learns from unvalidated output.

In law you cannot defend yourself with ignorance of the law.

The company’s legal team
Delivery

Speed to value: from idea to production.

The business side moved fast: all requirements were validated in a 1-hour second workshop, and the third was skipped as unnecessary.

Kick-off
6 May

Scope, success criteria and governance agreed. Acceptance criteria fixed before the first workshop.

Discovery
5 June

Workshop 1 dropped three assumptions from the original vision (three case modes, handwritten documents, a “save once” lifecycle) and flagged the legislation source as the top risk. Workshop 2 validated all requirements, five case categories and the templates. The final alignment fixed the ~30-act labor-law baseline and the alert-driven monitoring flow.

Build
3 July

Built in 2 sprints, in under 3 weeks.

UAT
28 August

About six weeks. Testing capacity on the client side was at times limited, and data anonymization raised challenges that required improvements to the agentic solution.

Live
31 August

Live for the legal team.

The kick-off targets

What the assistant is measured against.

Agreed at kick-off, by request complexity: the time a request takes today, and the target.

0min
Low-complexity requests, from 30 minutes today
0h
Medium-complexity requests, from 1 day today
0d
High-complexity requests, from 3-5 days today
What travels

Four patterns any regulated in-house team can reuse.

What the project created as reusable assets: patterns that travel to any regulated in-house team with a dense, moving body of rules, whether compliance, HR or procurement.

01

A corpus that keeps itself current

A legal corpus that keeps itself current from public sources and alerts the client already receives.

02

Scope by the law, not the cases

Scope a legal agent by the law it reads, not the cases it handles, and put the data-source decision on the critical path with its own owner and date.

03

A structured way to correct the agent

“Uncheck this law” beats “rephrase your prompt”.

04

Only human-validated precedent

Only human-validated outcomes become precedent, so the knowledge base never learns from its own drafts.

What comes next

A place where experience accumulates.

The legal assistant, Phase 1, is the proof point, and the third project the company and FlowX.AI have delivered on the same identity provider. Phase 1 covers labor law by design. The rest of the original vision is the natural extension: pharmaceutical and commercial law, handwritten inspector minutes, an admin role. Each adds a corpus and a source; the four agents, the seven-section output, the lifecycle and the precedent loop stay the same.

The deeper change is not speed. Before go-live, the company’s legal knowledge lived in four heads and an archive. Every case closed in the assistant now becomes a precedent the next lawyer, or the next hire, can see, with the law it relied on and the outcome it produced.

For the first time, the department has a place where its experience accumulates instead of leaving with the people who hold it.

About FlowX.AI

The orchestration platform for regulated work.

FlowX.AI is the enterprise orchestration platform that enables regulated institutions to deploy deterministic, source-traceable agentic workflows on top of legacy infrastructure. Companies run critical customer and operations journeys on FlowX.AI, including:

  • Manual Hand-off Automation
  • Regulatory Compliance
  • Supplier Coordination
  • Inventory Communications
  • Audit & Governance
  • Customer Service Triage
  • Internal Operations
  • and more
Next

Put an auditable agentbeside your in-house experts.

Bring a regulated team with a dense, moving body of rules and we will show you a path to production, with every source on record and the expert in charge of every decision.