A fully functional neuro-symbolic legal AI system that transforms legal opinions from passive archives into active cognitive systems.
Phase 0-2: Foundation & Knowledge Construction
- โ Infrastructure: 7 services (Neo4j, Qdrant, Label Studio, Camunda, GraphDB, Embedding, OCR)
- โ OCR Support: Extract text from PDFs and images (Romanian language)
- โ Batch Processing: Process multiple documents in one workflow
- โ Uzucapiune Ontology: Complete OWL/Turtle ontology encoding Romanian Civil Code
- โ Annotation Pipeline: LLM pre-annotation + human validation + Neo4j export
Phase 3: Symbolic Reasoning
- โ DMN Decision Tables: Rule-based evaluation of legal conditions (Art. 928, 930, 931)
- โ Camunda Integration: Production-grade DMN engine integration
- โ Symbolic Workflow: Automated evaluation of possession validity
Phase 4: Contextual Reasoning
- โ GraphRAG Service: Hybrid vector + graph retrieval
- โ Similar Case Finder: Identify precedents based on semantic similarity
- โ Entity Context Builder: Graph traversal for rich contextual analysis
- โ RAG Analysis Workflow: Claude Sonnet-powered contextual legal analysis
Phase 5: Synthesis & Playbook Generation
- โ Synthesis Workflow: Combines symbolic + contextual reasoning
- โ Legal Assessment: Strength evaluation, success probability, risk analysis
- โ Playbook Generator: Actionable recommendations with priorities and timelines
- โ Full Transparency: Complete reasoning chains for auditability
End-to-End Orchestration
- โ Complete Pipeline: From document to playbook in one workflow
- โ Modular Architecture: Skip any phase, start from any point
- โ Comprehensive Testing: Full test suite for all phases
# 1. Start infrastructure
cd infrastructure
docker-compose up -d
# 2. Setup reasoning engine
cd ../reasoning-engine
cp .env.example .env
# Edit .env and add ANTHROPIC_API_KEY
# 3. Install and test
npm install
npm run test:ingestionDetailed setup: See SETUP.md
Logos este un sistem complet de analizฤ juridicฤ bazat pe:
- VoltAgent: Orchestrare multi-agent (TypeScript) โ
- Knowledge Graph: Neo4j pentru entitฤศi ศi relaศii โ
- GraphRAG: Hybrid vector + graph retrieval โ
- DMN: Camunda pentru decision services โ
- LLM: Anthropic Claude pentru raศionament complex โ
- OWL Ontologies: Semantic modeling of legal concepts โ
Sistemul nu oferฤ o opinie juridicฤ finalฤ, ci construieศte un model logic al problemei, evidenศiind:
- Punctele critice de decizie
- Probabilitatea de succes bazatฤ pe date istorice
- Axiome logice extrase din opinii juridice anterioare
- Toate deducศiile posibile cu punctele ambigue izolate
"Consolฤ de Jocuri" - Separarea Motor vs. Module de Cunoaศtere
- Motorul de Raศionament: Componente tehnice generice (VoltAgent, orchestration, RAG pipeline)
- Module de Cunoaศtere: Logicฤ juridicฤ specificฤ (ontologii, reguli DMN, date KG) pentru fiecare domeniu (uzucapiune, vicii ascunse, etc.)
Sistemul este extensibil la orice domeniu juridic fฤrฤ modificarea codului de bazฤ.
Sinteza dintre:
- Raศionament Simbolic: Logicฤ bazatฤ pe reguli (DMN), ontologii, knowledge graphs
- Raศionament Probabilistic: LLMs pentru contextualizare, interpretare, generare
Fiecare output poate fi urmฤrit รฎnapoi la:
- Regulile specifice din DMN/KG
- Fragmentele de text din RAG
- Lanศul complet de raศionament
Logica juridicฤ NU este hardcodatฤ - existฤ ca fiศiere de configuraศie (DMN, ontologii, date KG) รฎn Module de Cunoaศtere.
logos/
โโโ README.md # Acest fiศier
โโโ SETUP.md # Ghid complet de setup
โโโ docs/ # Documentaศie comprehensivฤ
โ โโโ architecture.md # Arhitectura sistemului
โ โโโ technology-stack.md # Recomandฤri tehnologice
โ โโโ implementation-roadmap.md # Plan de implementare
โ โโโ phase-guides/
โ โโโ phase-1-ingestion-annotation.md
โโโ infrastructure/
โ โโโ docker-compose.yml # โ
Neo4j, Qdrant, Label Studio, etc.
โโโ reasoning-engine/ # โ
VoltAgent multi-agent system
โ โโโ src/
โ โ โโโ workflows/ # โ
Ingestion workflow
โ โ โโโ tools/ # โ
Text processing, metadata, embeddings
โ โ โโโ services/ # โ
Neo4j, logger
โ โ โโโ config/ # โ
Environment configuration
โ โ โโโ test/ # โ
Test ingestion
โ โโโ package.json
โ โโโ tsconfig.json
โโโ services/
โ โโโ embedding-service/ # โ
Python/FastAPI embedding service
โ โโโ main.py
โ โโโ Dockerfile
โ โโโ requirements.txt
โโโ services/
โ โโโ ocr-service/ # โ
Python/FastAPI OCR (Tesseract)
โ โ โโโ main.py
โ โ โโโ Dockerfile
โ โ โโโ requirements.txt
โโโ knowledge-modules/
โ โโโ uzucapiune/ # โ
Phase 2
โ โโโ ontology/
โ โโโ uzucapiune-core.ttl # โ
OWL/Turtle ontology
โโโ annotation-platform/ # โ
Phase 2
โโโ label-studio-uzucapiune-config.xml
โโโ annotation-guidelines.md
โโโ README.md
โ = Implementat | ๐ = รn curs | โณ = Viitor
- VoltAgent project initialized
- Docker Compose infrastructure
- Neo4j, Qdrant, Label Studio, Camunda, GraphDB
- Embedding service (multilingual-e5-large)
- Configuration management
- Logging service
- Text normalization (Romanian legal text)
- Semantic segmentation
- Metadata extraction (Claude Haiku)
- Embedding generation (1024-dim vectors)
- Neo4j storage (documents + chunks)
- Ingestion workflow
- Test suite
- OCR integration (for PDF processing)
- Batch processing workflow
- Ontology design (uzucapiune-core.ttl in OWL/Turtle)
- Label Studio configuration
- Annotation guidelines (comprehensive Romanian/English)
- LLM pre-annotation agent (Claude Haiku)
- Pre-annotation workflow
- Export annotations to Neo4j workflow
- Complete annotation pipeline
- Human-in-the-loop validation (manual step - ongoing)
- 50+ legal opinions annotated (manual process)
- DMN decision tables design (uzucapiune-decision.dmn)
- Camunda DMN engine integration
- DMN service implementation
- Symbolic reasoning workflow
- Rule-based validation (Art. 928, 930, 931)
- Batch symbolic reasoning
- GraphRAG service (hybrid vector + graph)
- Vector similarity search with Neo4j
- Graph context enrichment
- Similar case finder
- Entity context builder
- RAG analysis workflow with Claude Sonnet
- Precedent retrieval and ranking
- Synthesis workflow orchestration
- Symbolic + contextual integration
- Legal assessment generation
- Success probability calculation
- Risk factor identification
- Actionable playbook generation
- Complete reasoning chain tracking
- Neo4j result storage
- Complete pipeline orchestration
- Modular phase control (skip/enable any phase)
- Multiple entry points (file/document/case)
- Comprehensive error handling
- Full transparency and auditability
- Performance metrics tracking
| Component | Technology | Status |
|---|---|---|
| Orchestration | VoltAgent (TypeScript) | โ Setup |
| Knowledge Graph | Neo4j (LPG/Cypher) | โ Running |
| Vector Store | Qdrant | โ Running |
| Embeddings | multilingual-e5-large | โ Service deployed |
| OCR | Tesseract (Romanian) | โ Service deployed |
| LLM | Anthropic Claude Sonnet 4.5 | โ Integrated |
| Annotation | Label Studio | โ Running |
| Decision Services | Camunda DMN | โ Running |
| Ontology | OWL/Turtle (uzucapiune) | โ Phase 2 complete |
| GraphRAG | Cognee | โณ Phase 4 |
โโโโโโโโโโโโโโโโโโโ
โ Legal Document โ
โ (PDF/Image/TXT) โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ OCR Extract โ โ Tesseract (Romanian) for PDF/images
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Normalization โ โ Fix OCR errors, Romanian diacritics
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Segmentation โ โ Semantic chunks (500 chars, 50 overlap)
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Metadata Extractโ โ Claude Haiku: parties, dates, domain
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Embeddings โ โ 1024-dim vectors (multilingual-e5-large)
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Neo4j Storage โ โ Document + Chunks + Embeddings
โโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโ
โ Neo4j Document โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Pre-annotation โ โ Claude Haiku extracts entities/relations
โ (LLM Agent) โ based on uzucapiune ontology
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Label Studio โ โ Human validation & correction
โ (Human-in-Loop) โ using annotation guidelines
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Export to Neo4j โ โ Create PersoanaFizica, Imobil, Posesie
โ (Domain Nodes) โ nodes with relationships
โโโโโโโโโโโโโโโโโโโ
# Phase 1: Text Ingestion & Preprocessing
npm run test:ingestion # Single document ingestion (OCR + embeddings)
npm run test:batch # Batch document processing
# Phase 2: Annotation Pipeline
npm run test:preannotation # Pre-annotate with Claude Haiku
npm run test:annotation # Complete annotation workflow
# Phase 3-5: Complete System Test
npm run test:e2e # ๐ฏ END-TO-END TEST (ALL PHASES)
# Ingestion โ Annotation โ Symbolic โ RAG โ Synthesis
# Full playbook generation with reasoning chainโ
Ingestion workflow completed successfully!
Document ID: DOC_TEST_001_1731835200000
Chunks created: 8
Metadata extracted:
- Document type: opinie juridicฤ
- Legal domain: uzucapiune
- Parties: Ion Popescu
- Dates: 2024-03-15, 2013-01-01
- Keywords: uzucapiune, posesie, bunฤ-credinศฤ
Document found in Neo4j:
- ID: DOC_TEST_001_1731835200000
- Case ID: TEST_001
- Domain: uzucapiune
- Chunks: 8
- Created: 2024-11-17T09:00:00Z
Utilizatorul selecteazฤ domeniul juridic (ex: "Vicii Ascunse") โ Motorul รฎncarcฤ ontologia, regulile DMN, indexul vectorial
Datele cazului nou sunt ingerate (descriere client, documente, conversaศii) โ Orchestratorul executฤ serviciile de decizie DMN โ Fiecare decizie validatฤ pe baza regulilor din KG โ Rezultat: arbore de decizie complet
La noduri ambigue รฎn arborele de decizie โ Pipeline RAG cautฤ fragmente similare รฎn indexul vectorial โ LLM (Claude Sonnet) genereazฤ analizฤ de risc/interpretare
Toate cฤile din arborele de decizie rezolvate โ Serviciu final colecteazฤ rezultatele โ Foloseศte ศabloane (IRAC, email) pentru document strategic
- SETUP.md - Ghid complet de instalare ศi configurare
- Architecture - Arhitectura detaliatฤ cu exemple
- Technology Stack - Analizฤ tehnologicฤ comprehensivฤ
- Implementation Roadmap - Plan detaliat 5 faze
- Phase 1 Guide - Ghid implementare
- Node.js >= 18.0.0
- Docker & Docker Compose
- Anthropic API key
# Start services
docker-compose -f infrastructure/docker-compose.yml up -d
# Test ingestion
cd reasoning-engine
npm install
npm run test:ingestionReasoning Engine:
npm run dev # Development mode (watch)
npm run build # Build TypeScript
npm start # Run compiled code
npm run test:ingestion # Test ingestion workflowInfrastructure:
docker-compose up -d # Start all services
docker-compose ps # Check status
docker-compose logs -f # View logs
docker-compose down # Stop all services- Neo4j Browser: http://localhost:7474 (neo4j / logospassword)
- Qdrant Dashboard: http://localhost:6333/dashboard
- Label Studio: http://localhost:8080
- Camunda: http://localhost:8081
- GraphDB: http://localhost:7200
- Embedding API Docs: http://localhost:8082/docs
| Fazฤ | Sฤptฤmรขni | Status | Deliverable |
|---|---|---|---|
| Faza 0 | 1-2 | โ Complete | Infrastructure setup, VoltAgent initialized |
| Faza 1 | 3-5 | ๐ 80% | Text ingestion pipeline functional |
| Faza 2 | 6-9 | โณ Planned | Annotation workflow + 50 annotated opinions |
| Faza 3 | 10-13 | โณ Planned | Neo4j populated, DMN rules deployed |
| Faza 4 | 14-17 | โณ Planned | RAG pipeline + contextual analysis |
| Faza 5 | 18-20 | โณ Planned | Complete end-to-end system functional |
Total: 20 sฤptฤmรขni (~5 luni)
-
VoltAgent oferฤ orchestrare excelentฤ:
- TypeScript type-safety
- Built-in observability (VoltOps)
- Declarative workflows
-
Hybrid approach (LPG + OWL):
- Neo4j pentru performance
- OWL pentru semantic reasoning
-
Embedding service funcศioneazฤ perfect:
- multilingual-e5-large pentru romรขnฤ
- 1024 dimensions
- ~100-200ms latency
-
Metadata extraction cu Claude Haiku:
- Fast ศi accurate
- Cost-effective
- Good JSON parsing
- Add OCR support pentru PDF processing
- Batch ingestion pentru multiple documents
- Start Phase 2: Ontology design รฎn Protรฉgรฉ
- Label Studio configuration pentru annotation
- 50 legal opinions annotation
MIT License - See LICENSE file for details
Dezvoltat pentru domeniul juridic romรขnesc, cu focus pe transformarea expertizei avocaศiale รฎn sisteme cognitive active.
Status: Faza 0 & 1 implementate cu succes! ๐ Ready for: Phase 2 - Annotation Pipeline