SCALAC.AI

AI Assistant for Legislation Database Navigation

Navigate complexities of Polish legislation quickly and efficiently using AI legal assistant

What was the challenge?
The Polish legal system is vast and complicated, making it difficult for both legal professionals and public to find relevant information quickly and efficiently. Traditional legal research methods are often time-consuming and require high level of expertise. Users need to search through multiple legal sources – codexes, statutes, and court judgments – to find due comprehensive answers to legal questions.
Solution we offered.
We developed Lex-GPT.pl – a sophisticated AI assistant specifically designed for Polish law. The system utilizes a hierarchical multi-agent architecture with a “Plan-and-Execute Agent” as the main orchestrator and multiple “ReAct Agents” as specialized workers. When a user asks a legal question, the Plan-and-Execute Agent analyzes the query and creates a comprehensive research plan. Based on this plan, it dynamically spawns multiple ReAct agents to work in parallel, for example, spawning several codex search agents to investigate different aspects of the question, along with judgment search agents to find relevant case law. Each ReAct agent operates in an iterative loop: reasoning about the task, using RAG (Retrieval-Augmented Generation) tools to search the legal database, evaluating results, and refining queries as needed. The agents can rephrase and search repeatedly until they find the most relevant legal information. All agents are implemented using Scala Typed Actors with Finite State Machines (FSMs), providing robust state management and true concurrent execution. The legal database is indexed using PostgreSQL with the pgvector extension, enabling efficient semantic search across codexes and court judgments.
What’s the business value?
Lex-GPT.pl efficiently accelerates legal research rapidly providing users with precise and relevant information. This empowers legal professionals to be more efficient, while also making legal information more accessible to public. The hierarchical multi-agent system ensures a comprehensive and structured approach for answering legal queries and parallel execution significantly reduces response time for complex questions. Ability to dynamically spawn multiple specialized agents allows the system to tackle multi-faceted legal questions that would traditionally require hours of manual research.
Tools and Technologies
  • Scala
  • Scala Typed Actors with FSMs
  • Python
  • PostgreSQL with PGVector
  • RAG (Retrieval-Augmented Generation)
  • Hierarchical Multi-Agent System (Plan-and-Execute + ReAct)