JusticeFusion – Technical Whitepaper

JusticeFusion is a legal AI assistant for local legal sources, private documents and everyday legal research in Bosnian, Croatian and Serbian. It uses a RAG approach to retrieve relevant material before generating a final answer.

RAG architecturePrivate documentsOn-premise / private cloudBHS languages

1. System overview

JusticeFusion is a modular AI system with connected layers for UI, document processing, embeddings/indexing, retrieval, LLM generation and answer review. This architecture supports law firms, notary offices, legal departments and institutions handling large legal document volumes.

2. Core workflow

  1. the user asks a question or uploads a document,
  2. the system extracts text from PDF, DOCX, text files or images,
  3. the document is cleaned, split and converted into embeddings,
  4. the retrieval layer finds relevant parts of user documents and/or legal databases,
  5. the LLM generates an answer based on retrieved context,
  6. an additional review layer analyzes answer quality,
  7. the user receives an answer and, when needed, a draft for expert editing.

3–18. Key components and usage

Document processing

Supports PDF, DOCX, scanned documents and images in Latin and Cyrillic, with OCR, cleaning and segmentation.

RAG architecture

Retrieval-first processing keeps outputs closer to source material and reduces manual legal research effort.

Hybrid retrieval

Combines vector search, keywords and BM25/TF-IDF signals for stronger contextual precision.

Legal database + user documents

Combines laws, regulations and case law with contracts, decisions, letters and internal acts.

Graph-aware retrieval

Advanced configurations can connect legal entities and relationships for context-aware retrieval.

Answer review

Automatic review with iterative refinement through additional retrieval when needed.

Draft generation

Prepares appeals, requests, official letters and contracts, with optional DOCX export for expert editing.

Privacy and deployment

Supports controlled SaaS, private cloud, on-premise and offline options based on requirements.

Security and audit

Options may include access control, audit trails and local storage depending on deployment choices.

UI and integrations

Includes uploads, question history, source previews and integration with DMS/ERP/CRM, APIs and webhooks.

Technology stack

Typical layers include Python backend, Streamlit, SentenceTransformers, FAISS/Weaviate, SQLite/LMDB and OCR tools.

Responsible use

The system supports professional work while final legal assessment and submission remain human responsibilities.

Architecture flow

User question / document uploadOCR & text processingEmbeddings & indexHybrid retrievalLLM answerAutomatic reviewFinal answer / DOCX draft

Deployment options

SaaS

  • Faster rollout.
  • Centralized maintenance.
  • Configured within agreed scope.

Private cloud

  • Runs in an isolated cloud setup.
  • Easier access and network policy control.
  • Useful for organizational standards.

On-premise / offline

  • Runs on client infrastructure.
  • Can limit internet dependency.
  • Suitable for strict control environments.

Security and integrations

JusticeFusion can integrate into legal workflows via DMS/ERP/CRM and legal databases. Access rights, integration depth and audit settings are defined according to environment and policy requirements.

Responsible use

JusticeFusion assists legal research and draft preparation, but final legal assessment and submission remain the responsibility of qualified professionals.