Uppsats

AI-Powered Hybrid Legal Reasoning: Combining Graph and Structured Databases : Multi-Pipeline Query Execution for Legal Knowledge Retrieval

Master-uppsats

KTH/Skolan för elektroteknik och datavetenskap (EECS)

Publicerad: 2025

Språk: Engelska

Sammanfattning

As artificial intelligence becomes increasingly integrated across industries, its ineffective or superficial application can lead not only to underwhelming performance but also to critical errors that undermine trust in automation. This risk is especially acute in domains with strict accuracy and reliability demands, such as the legal sector, where misinformation or incomplete analysis can have serious consequences. In precedent-based legal systems, efficient and accurate information retrieval is further complicated by the need to understand and leverage complex relationships among cases, statutes, and doctrines. Existing AI-powered research tools, like conventional Retrieval- Augmented Generation (RAG) systems, primarily rely on vector similarity search, often missing the intricate relational structures vital for legal analysis. Graph-based RAG systems, though using schema-less graph databases like Neo4j, typically rely on rigid, predefined sets of entity and relationship types in their extraction and query logic, limiting adaptability to evolving legal documents. This inability to dynamically capture and utilize both semantic and relational information restricts the effectiveness of automated legal research - a significant practical and academic challenge that remains unresolved. This thesis presents a novel Dynamic Entity-Aware Graphand Vector-Enhanced Retrieval-Augmented Generation system, advancing legal information retrieval through a Large Language Model-driven, adaptive query processing architecture. The system features a dual-database engine: PostgreSQL with pgvector for high-performance semantic search and neo4j for flexible, relationship-centric graph traversal. Key innovations include: (i) real-time semantic query decomposition without reliance on predefined patterns, (ii) intelligent entity matching with automatic generation of legal terminology variants, (iii) schema-aware graph query construction that dynamically adapts to evolving legal structures, and (iv) hybrid retrieval that combines graph-based entity identification with vector-based context enrichment, preserving relational integrity while capturing semantic nuance. Evaluation on complex legal queries-spanning case arguments, statutory relationships, and multi-entity reasoning-demonstrates that the proposed system significantly outperforms both conventional and existing graph-based RAG approaches in retrieval accuracy and transparency. The results show that legal professionals can now access more precise, interpretable, and contextually rich information, supporting advanced legal analysis that was previously infeasible with static or single-modality systems. This research thus represents a paradigm shift from static to adaptive legal research systems, enabling more effective, reliable, and interpretable access to critical legal knowledge and offering a foundation for future advancements in AI-driven legal practice.

Utforska vidare

Liknande uppsatser

Uppsatser med liknande ämnen och nyckelord.