Navigate complexities of Polish laws with an advanced AI legal assistant
What was the challenge?
Polish legal system is vast and complex, making it difficult for both legal professionals and the general public to find relevant information quickly and efficiently. Traditional legal research methods are often time-consuming and require a high level of expertise.
Solution we offered.
We developed Lex-GPT.pl, a sophisticated AI assistant specifically designed for Polish law. The system utilizes a hierarchical structure of agents, including a „plan and execute” agent and multiple ReAct agents. When a user asks a question, a planner
agent first creates a research plan. Then, specialized ReAct agents operate in an iterative loop, using Retrieval-Augmented Generation (RAG) techniques to find relevant articles and paragraphs from indexed legal codexes and court judgments. If the
retrieved information is not relevant, the ReAct agent can rephrase the query and search again, repeating this process until the correct information is found. For complex questions, the plan and execute agent can run multiple codex and judgment ReAct agents in parallel, significantly improving response time and comprehensiveness. Both the plan and execute agent and ReAct agents are implemented using Typed Actors with Finite State Machines (FSMs) in Scala, providing robust state management and
concurrent execution. The legal database is indexed using ostgreSQL with the
pgvector extension.
What’s the business value?
Lex-GPT.pl dramatically accelerates legal research, providing users with precise and relevant information in a fraction of the time. This empowers legal professionals to be more efficient and effective, while also making legal information more accessible to the public. The hierarchical agent system ensures a comprehensive and structured approach to answering legal queries, leading to more accurate and reliable results.
Tools and Technologies
- Scala
- Scala Typed Actors with FSMs
- Python
- PostgreSQL with pgvector
- RAG (Retrieval-Augmented Generation)
- ReAct Agent Framework
- Hierarchical Agent System (Plan and Execute)