Bhairyam is a private UK legal AI workspace for solicitors, barristers, in-house counsel, paralegals, and legal operations teams.
It helps a legal team upload matter documents, ask questions in plain English, find relevant passages, extract cited cases and legislation, and produce source-grounded answers for UK legal work.
Matter-based chat · PDF and Word review · UK case and legislation extraction · Drafts and agreements · Source-grounded answers · Private local AI · Mobile responsive
Bhairyam is built for UK legal teams that need a controlled AI workspace around their own matter files.
Typical use cases:
| Legal workflow | How Bhairyam helps |
|---|---|
| Initial matter review | Upload pleadings, correspondence, judgments, bundles, advice notes, and evidence files, then ask what the matter is about. |
| Legal research from uploaded documents | Ask questions against the matter record and receive answers grounded in uploaded sources. |
| Case and legislation extraction | See cases, neutral citations, CPR references, and legislation detected from each document. |
| Drafts and agreements | Turn a chat prompt into a structured legal draft, review note, checklist, or comparison document. |
| Source checking | Review the exact document chunks used to support an answer. |
| Chronology building | Maintain matter events and key factual timelines. |
| Issues lists | Track legal issues detected or added for a matter. |
| Evidence review | Link propositions to supporting or contradicting evidence. |
| Document workspace | Open the workspace view to inspect uploaded documents, sources, authorities, history, chronology, issues, and evidence. |
| Mobile work | Use the interface on desktop, tablet, or mobile. |
- Create and use legal matters.
- Keep research, documents, authorities, issues, chronology, and evidence organised by matter.
- Keep answers scoped to the selected matter rather than mixing unrelated client files.
- Ask questions in natural language.
- Receive source-grounded answers from uploaded matter documents.
- Answers include document labels such as
[D1],[D2], and[D3]. - If the AI generation step is slow, Bhairyam returns a fast extractive answer from the best retrieved passages.
- Upload PDF files.
- Upload Word/DOCX files.
- Upload text-based legal material.
- Uploaded files are stored locally.
- Text is extracted and indexed automatically.
- Document chunks are embedded for matter-specific retrieval.
- Extracts UK neutral case citations where detected.
- Extracts legislation references.
- Extracts CPR references.
- Creates Case Law UK links for supported neutral citations.
- Shows authorities detected from documents.
- Toggle Drafts & Agreements mode inside the existing chat.
- Choose a drafting or review skill.
- Prompt in plain English.
- Download a neatly formatted
.docxfile. - Use skills for commercial, finance, corporate, employment, real estate, and general transaction work.
- Edit the local
skills.mdlibrary through the draft-skills API when a firm wants to customise its own workflows.
Included drafting and review skills:
- BPO agreement review
- Commercial lease review
- Compare documents
- Corporate approvals review
- Conditions precedent checklist draft
- Credit agreement review
- Design partner agreement draft
- Design partner agreement review
- Data processing agreement draft
- Data processing agreement review
- Draft from template
- Employment agreement review
- Extract key terms
- Guarantee agreement review
- Issues list draft
- Master services agreement draft
- Master services agreement review
- Non-disclosure agreement review
- Proofread
- Shareholders' agreement review
Bhairyam is designed for UK legal use, including:
- England and Wales
- Scotland
- Northern Ireland
- UK-wide statutes and authorities
- UK court decisions
- CPR and procedural references
- UK regulatory and statutory materials when present in uploaded documents
Bhairyam uses local AI through Ollama:
| Purpose | Default model |
|---|---|
| Answer drafting | qwen3:8b |
| Document embeddings | embeddinggemma |
Your matter documents are processed against the local application stack.
- Users can register and sign in.
- User records are stored in the local database.
- Matters, documents, and research history are linked to the user and organisation records.
- Chat is designed to work across desktop and mobile.
- Workspace pages adapt to smaller screens.
- Navigation supports the document and research panels without requiring a wide monitor.
Install:
- Docker Desktop
- Ollama
Download the local AI models:
ollama pull qwen3:8b
ollama pull embeddinggemmaStart Bhairyam:
./scripts/start-production.shOpen:
http://localhost:3000/register
Create an account, upload a PDF or Word document, and ask a question about the matter.
If port 3000 is already in use:
BHAIRYAM_WEB_PORT=3001 ./scripts/start-production.shThen open:
http://localhost:3001/register
Open the app:
http://localhost:3000
Check the backend:
http://localhost:8000/health
Expected backend response:
{"ok":true,"service":"bhairyam-backend"}Check Docker:
docker compose psYou should see:
bhairyam-postgresbhairyam-backendbhairyam-web
For a clean demonstration:
- Register a user.
- Open the main chat workspace.
- Upload a UK judgment, pleading, advice note, contract, witness statement, or bundle extract.
- Open the document/workspace view and show the detected cases and legislation.
- Ask:
What is this case about? - Ask:
What are the key legal issues? - Ask:
Which authorities are cited? - Ask:
What facts support the claimant's position? - Toggle Drafts & Agreements and select
Issues List DraftorMaster Services Agreement Draft. - Ask:
Prepare a short solicitor-style case summary from the uploaded material. - Download the generated
.docx. - Show the answer citations and source chunks.
In plain English:
- Bhairyam saves the original file.
- It reads the text from the PDF or Word document.
- It looks for cases, statutes, CPR references, and other legal authorities.
- It splits the document into searchable passages.
- It creates local embeddings for those passages.
- It stores everything in the local database.
- When you ask a question, it searches only the selected matter.
- It answers using the most relevant passages.
Try questions like:
Summarise this matter for a partner.What are the strongest points for the claimant?What are the strongest points for the defendant?List the cases cited in this document.Which statutory provisions are relevant?What limitation issues arise?Create a chronology from the uploaded evidence.Find contradictions in the witness evidence.Draft a short advice note based only on the uploaded documents.What further documents should the solicitor request?Create an issues list as a downloadable Word document.Draft a first version of a non-disclosure agreement review note for the client.
Bhairyam stores:
- User accounts
- Organisations
- Matters
- Uploaded document records
- Extracted document text
- Search chunks and vectors
- Detected cases and legislation
- Research questions and answers
- Audit events
- Original uploaded files
Uploaded source files are stored locally in the application storage volume.
Stop:
docker compose downStart again:
docker compose up -dView logs if something is not working:
docker compose logs -f web
docker compose logs -f backendbhairyam/
frontend/ Web app and user interface
backend/ Document extraction and legal RAG backend
migrations/ Database schema
scripts/ Start scripts
docker-compose.yml
Run frontend tests:
cd frontend
npm testRun backend tests:
cd backend
.venv/bin/python -m pytest app/tests- Bhairyam is a legal AI workspace, not a solicitor.
- It does not create a solicitor-client relationship.
- Answers should be reviewed by a qualified legal professional before use.
- The quality of answers depends on the quality and completeness of uploaded documents.
- For urgent deadlines, limitation issues, injunctions, criminal matters, immigration detention, or risk of harm, seek immediate advice from a qualified UK lawyer.
This project is licensed under the MIT License.
See LICENSE.
