A experimental GraphRAG system for European Union regulations, German legal documents (SGB, BGB, etc.), and cross-border legal knowledge. Built on Neo4j with native support for ELI, ECLI, and EuroVoc ontologies.
Create the first open-source GraphRAG system for EU regulatory compliance that:
- β Natively integrates ELI (European Legislation Identifier) and ECLI (European Case Law Identifier)
- β Enables automated EU-to-national law transposition analysis
- β Provides temporal tracking of legal amendments
- β Supports multilingual legal search across 24 EU languages
- Docker & Docker Compose
- Python 3.11+
- Neo4j AuraDB (free tier) or local Neo4j instance
# Clone repository
git clone https://github.com/sopra-steria-cassa/EU-GraphRAG.git
cd EU-GraphRAG
# Set up Python environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Start Neo4j database
docker-compose up -d
# Initialize graph schema
python scripts/init_database.py
# Ingest sample data (SGB I-III)
python scripts/ingest_sgb.py# Start Streamlit UI
streamlit run src/ui/streamlit_app.py
# Or use REST API
uvicorn src.api.app:app --reloadNavigate to http://localhost:8501 for the UI or http://localhost:8000/docs for API documentation.
βββββββββββββββββββ
β User Query β
ββββββββββ¬βββββββββ
β
ββββββΌβββββββββββββββββββββββββββββββββ
β GraphRAG Query Engine β
β ββββββββββββββ¬βββββββββββββββββββ β
β β Vector β Graph Traversal β β
β β Search β (Cypher) β β
β ββββββββββββββ΄βββββββββββββββββββ β
ββββββββββ¬βββββββββββββββββββββββββββββ
β
ββββββββββΌβββββββββββββββββββββββββ
β Neo4j Knowledge Graph β
β ββββββββββββ¬βββββββββββββββ β
β β ELI β ECLI β β
β β Ontology β Metadata β β
β ββββββββββββΌβββββββββββββββ€ β
β β EuroVoc β SGB Domain β β
β β Concepts β Model β β
β ββββββββββββ΄βββββββββββββββ β
βββββββββββββββββββββββββββββββββββ
- LegalDocument: EU directives, regulations, German laws
- Article/Section: Individual provisions with ELI URIs
- LegalConcept: EuroVoc thesaurus descriptors
- TemporalVersion: Historical versions of legal texts
- CourtDecision: Case law with ECLI identifiers
- IMPLEMENTS: EU Directive β German Law
- REFERENCES: Article β Cited Article
- SUPERSEDES: New Version β Old Version
- CONCERNS: Document β Legal Concept (EuroVoc)
Query: "What changed in SGB II Β§ 7 since January 2023?"
GraphRAG retrieves:
- Amendment history via
SUPERSEDESrelationships - BGBl (Federal Law Gazette) references
- Effective dates and consolidation status
Query: "Which German laws implement the EU Data Act (2023/2854)?"
GraphRAG analyzes:
IMPLEMENTSrelationships- Implementation gaps and deadlines
- Cross-references to national legislation
Query: "How does SGB VI interact with EU Regulation 883/2004?"
GraphRAG provides:
- Coordination rules between German pension law and EU social security regulation
- Relevant articles in both legal frameworks
- Conflict resolution mechanisms
- EUR-Lex: Official EU legal database (SPARQL endpoint)
- CELLAR: Publications Office repository
- CJEU: Court of Justice case law
- Gesetze im Internet: ~5,000 federal laws
- Bundesgesetzblatt: Official law gazette (BGBl I & II)
- Federal Courts: Supreme court decisions (ECLI-compliant)
- SGB I-XII: Complete social law books
- BA/DRV regulations: Employment and pension insurance
| Component | Technology | Purpose |
|---|---|---|
| Graph Database | Neo4j 5.x | Knowledge graph storage |
| Vector Search | Neo4j Vector Index | Semantic article retrieval |
| LLM | OpenAI GPT-4 / Llama 3 | Entity extraction, Q&A |
| Embeddings | E5-multilingual | Multilingual embeddings |
| API | FastAPI | REST service |
| UI | Streamlit | Demo interface |
| ETL | Apache Airflow | Data ingestion orchestration |
- GraphRAG Concept: Comprehensive technical specification
- Ontology Specification: ELI, ECLI, EuroVoc schemas
- API Documentation: REST API reference
- User Guide: End-user documentation
- Contributing: Development guidelines
# Run all tests
pytest
# Unit tests only
pytest tests/unit/
# Integration tests (requires Neo4j)
pytest tests/integration/
# Test coverage
pytest --cov=src --cov-report=htmlTarget: 100% test coverage for core modules.
- Project setup and repository
- ELI ontology schema
- Gesetze im Internet scraper
- SGB I-III ingestion (500+ articles)
- Basic Cypher queries
- LLM entity extraction pipeline
- Hybrid retrieval (vector + graph)
- Streamlit Q&A interface
- 100% test coverage
- EUR-Lex API integration
- EuroVoc concept mapping
- ECLI case law ingestion
- Multilingual support (DE/EN/FR)
- FastAPI REST service with authentication
- Performance optimization (100K+ nodes)
- BA/DRV pilot deployment
- EU funding secured (SIMPL, GovTech)
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
# Install development dependencies
pip install -r requirements-dev.txt
# Pre-commit hooks
pre-commit install
# Code formatting
black src/ tests/
isort src/ tests/
# Linting
flake8 src/ tests/
mypy src/This project is licensed under the MIT License - see the LICENSE file for details.
Cassa (Law2Logic) - Sopra Steria Product for Regulatory Compliance
- Product Owner: [Your Name]
- Tech Lead: [Your Name]
- Contributors: See CONTRIBUTORS.md
- EU Publications Office: ELI and ECLI standards
- EuroVoc Team: Multilingual thesaurus
- Neo4j Community: Graph database support
- Gesetze im Internet: German federal law portal
- Email: law2logic@sopra-steria.com
- GitHub Issues: Report bugs or request features
- Discussions: Community forum
- ELI Ontology: https://op.europa.eu/en/web/eu-vocabularies/eli
- ECLI Portal: https://e-justice.europa.eu/ecli
- EuroVoc Thesaurus: https://op.europa.eu/en/web/eu-vocabularies/th-concept-scheme/-/resource/eurovoc
- Gesetze im Internet: https://www.gesetze-im-internet.de
- Neo4j GraphRAG: https://neo4j.com/labs/genai-ecosystem/
β Star this repository if you find it useful!
π’ Follow updates: Watch this repo for the latest developments in EU legal knowledge graphs.