מערכת גילוי סתירות משפטית מבוססת AI
Legal Contradiction Detection System powered by AI
JETHRO 9.0 is a standalone contradiction detection service designed for legal document analysis. It identifies contradictions, inconsistencies, and discrepancies across multiple documents, and generates cross-examination questions.
Current release version is stored in VERSION.
# Clone the repository
git clone https://github.com/smaster1234/jethro9.0.git
cd jethro9.0
# Copy environment file
cp .env.example .env
# Start all services
docker compose up -d
# Check status
docker compose ps
# View logs
docker compose logs -f web
Access the application at: http://localhost:8000
הסקריפט מריץ נתיב זהב מקצה לקצה (כולל העלאת מסמכים לדוגמה):
./scripts/golden_path.sh
ברירת מחדל משתמשת ב־backend_lite/fixtures/*.txt ובכתובת http://localhost:8000.
ניתן להגדיר:
BASE_URL=http://localhost:8000 \
DOC1=backend_lite/fixtures/temporal_01.txt \
DOC2=backend_lite/fixtures/temporal_02.txt \
./scripts/golden_path.sh
הסקריפט מבצע:
docker compose up -dהסקריפט מזהה אוטומטית docker compose או docker-compose.
טיפ: ניתן להצביע על מסמכי DOCX/PDF קיימים ע"י שינוי DOC1/DOC2.
המערכת תומכת במשרדים (Organizations) עם תפקידים:
viewer (קריאה בלבד), intern (הכנה ללא ייצוא), lawyer/owner (כולל ייצוא).
# יצירת משרד
POST /api/v1/orgs
# רשימת משרדים למשתמש הנוכחי
GET /api/v1/orgs
# הוספת משתמש קיים
POST /api/v1/orgs/{org_id}/members (body: { user_id, role })
# הזמנה במייל
POST /api/v1/orgs/{org_id}/invites (body: { email, role, expires_in_days })
# קבלת הזמנה
POST /api/v1/invites/{token}/accept
בשדה organization_id ביצירת תיק (POST /cases) או באמצעות ברירת מחדל אוטומטית.
# התחלת אימון
POST /api/v1/cases/{case_id}/training/start
{ "plan_id": "...", "witness_id": "...", "persona": "cooperative" }
# תור אימון
POST /api/v1/training/{session_id}/turn
{ "step_id": "step-1", "chosen_branch": "לא זוכר" }
# חזרה צעד (מוגבל ל-2)
POST /api/v1/training/{session_id}/back
# סיום וסיכום
POST /api/v1/training/{session_id}/finish
תגיות משוב לשלב תובנות/צעדי תכנית:
הצגה בממשק:
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r backend_lite/requirements.txt
# Set environment variables
export DATABASE_URL=sqlite:///./dev.db
export REDIS_URL=redis://localhost:6379/0
export LLM_MODE=none
# Run the server
uvicorn backend_lite.api:app --reload --port 8000
אם
docker composeלא זמין, ניתן להשתמש ב־docker-compose.
jethro9.0/
├── backend_lite/ # Main application package
│ ├── api.py # FastAPI endpoints
│ ├── detector.py # Rule-based contradiction detection
│ ├── extractor.py # Claim extraction
│ ├── cross_exam.py # Cross-examination generation
│ ├── db/ # Database models (SQLAlchemy)
│ ├── jobs/ # Background tasks (RQ)
│ ├── storage/ # File storage (Local/S3)
│ ├── ingest/ # Document parsing
│ ├── llm/ # LLM integration
│ └── frontend_build/ # Pre-built React UI
├── Dockerfile
├── docker-compose.yml
├── .env.example
└── README.md
| Endpoint | Method | Description |
|---|---|---|
/analyze | POST | Analyze free text for contradictions |
/analyze_claims | POST | Analyze pre-extracted claims |
/health | GET | Health check |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/cases/{case_id}/documents | POST | Upload document |
/api/v1/cases/{case_id}/documents/zip | POST | Upload ZIP archive |
/api/v1/documents/{doc_id} | GET | Get document |
/api/v1/cases/{case_id}/analyze | POST | Start analysis job |
/api/v1/jobs/{job_id} | GET | Get job status |
| Endpoint | Method | Description |
|---|---|---|
/auth/register | POST | Register new firm |
/auth/login | POST | Login |
/auth/me | GET | Get current user |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/orgs | GET/POST | List/create organizations |
/api/v1/orgs/{id}/members | GET/POST | List/add org members |
/api/v1/orgs/{id}/invites | POST | Invite by email |
/api/v1/invites/{token}/accept | POST | Accept invite |
/api/v1/cases/{case_id}/training/start | POST | Start training session |
/api/v1/training/{session_id}/turn | POST | Record training turn |
/api/v1/training/{session_id}/back | POST | Undo last turn |
/api/v1/training/{session_id}/finish | POST | Finish + summary |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/feedback | POST | Create feedback (insight/plan_step) |
/api/v1/feedback?case_id=...&entity_type=... | GET | List feedback + aggregates |
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL | Yes | sqlite:///./dev.db | PostgreSQL connection string |
REDIS_URL | Yes | redis://localhost:6379/0 | Redis connection string |
STORAGE_BACKEND | No | local | local or s3 |
LLM_MODE | No | none | none, openrouter, deepseek, gemini |
PORT | No | 8000 | Server port |
BACKEND_LITE_ROLE | No | web | web or worker |
לבדיקה מהירה של DOCX ללא חשיפת טקסט:
python3 scripts/inspect_docx.py path/to/file.docx
For enhanced contradiction detection with AI:
# OpenRouter (recommended - access to multiple models)
LLM_MODE=openrouter
OPENROUTER_API_KEY=sk-or-v1-...
# Or DeepSeek
LLM_MODE=deepseek
DEEPSEEK_API_KEY=sk-...
# Or Gemini
LLM_MODE=gemini
GEMINI_API_KEY=...
/ (or leave empty)For the worker service, create a second Railway service with:
BACKEND_LITE_ROLE=worker# Build image
docker build -t jethro9 .
# Run web server
docker run -d \
-p 8000:8000 \
-e DATABASE_URL=postgresql://... \
-e REDIS_URL=redis://... \
jethro9
# Run worker
docker run -d \
-e DATABASE_URL=postgresql://... \
-e REDIS_URL=redis://... \
-e BACKEND_LITE_ROLE=worker \
jethro9
# Run all tests
pytest backend_lite/tests/ -v
# Run specific test
pytest backend_lite/tests/test_detector_rule_based.py -v
# With coverage
pytest backend_lite/tests/ --cov=backend_lite
detector.py - Rule-based contradiction detection engineextractor.py - Claim extraction from Hebrew legal textcross_exam.py - Cross-examination question generationplaybooks.yaml - Hebrew legal playbook templatesschemas.py - Pydantic models for APIProprietary - All rights reserved
For issues and feature requests, please contact the development team.
מערכת גילוי סתירות משפטית מבוססת AI
Legal Contradiction Detection System powered by AI
JETHRO 9.0 is a standalone contradiction detection service designed for legal document analysis. It identifies contradictions, inconsistencies, and discrepancies across multiple documents, and generates cross-examination questions.
Current release version is stored in VERSION.
# Clone the repository
git clone https://github.com/smaster1234/jethro9.0.git
cd jethro9.0
# Copy environment file
cp .env.example .env
# Start all services
docker compose up -d
# Check status
docker compose ps
# View logs
docker compose logs -f web
Access the application at: http://localhost:8000
הסקריפט מריץ נתיב זהב מקצה לקצה (כולל העלאת מסמכים לדוגמה):
./scripts/golden_path.sh
ברירת מחדל משתמשת ב־backend_lite/fixtures/*.txt ובכתובת http://localhost:8000.
ניתן להגדיר:
BASE_URL=http://localhost:8000 \
DOC1=backend_lite/fixtures/temporal_01.txt \
DOC2=backend_lite/fixtures/temporal_02.txt \
./scripts/golden_path.sh
הסקריפט מבצע:
docker compose up -dהסקריפט מזהה אוטומטית docker compose או docker-compose.
טיפ: ניתן להצביע על מסמכי DOCX/PDF קיימים ע"י שינוי DOC1/DOC2.
המערכת תומכת במשרדים (Organizations) עם תפקידים:
viewer (קריאה בלבד), intern (הכנה ללא ייצוא), lawyer/owner (כולל ייצוא).
# יצירת משרד
POST /api/v1/orgs
# רשימת משרדים למשתמש הנוכחי
GET /api/v1/orgs
# הוספת משתמש קיים
POST /api/v1/orgs/{org_id}/members (body: { user_id, role })
# הזמנה במייל
POST /api/v1/orgs/{org_id}/invites (body: { email, role, expires_in_days })
# קבלת הזמנה
POST /api/v1/invites/{token}/accept
בשדה organization_id ביצירת תיק (POST /cases) או באמצעות ברירת מחדל אוטומטית.
# התחלת אימון
POST /api/v1/cases/{case_id}/training/start
{ "plan_id": "...", "witness_id": "...", "persona": "cooperative" }
# תור אימון
POST /api/v1/training/{session_id}/turn
{ "step_id": "step-1", "chosen_branch": "לא זוכר" }
# חזרה צעד (מוגבל ל-2)
POST /api/v1/training/{session_id}/back
# סיום וסיכום
POST /api/v1/training/{session_id}/finish
תגיות משוב לשלב תובנות/צעדי תכנית:
הצגה בממשק:
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r backend_lite/requirements.txt
# Set environment variables
export DATABASE_URL=sqlite:///./dev.db
export REDIS_URL=redis://localhost:6379/0
export LLM_MODE=none
# Run the server
uvicorn backend_lite.api:app --reload --port 8000
אם
docker composeלא זמין, ניתן להשתמש ב־docker-compose.
jethro9.0/
├── backend_lite/ # Main application package
│ ├── api.py # FastAPI endpoints
│ ├── detector.py # Rule-based contradiction detection
│ ├── extractor.py # Claim extraction
│ ├── cross_exam.py # Cross-examination generation
│ ├── db/ # Database models (SQLAlchemy)
│ ├── jobs/ # Background tasks (RQ)
│ ├── storage/ # File storage (Local/S3)
│ ├── ingest/ # Document parsing
│ ├── llm/ # LLM integration
│ └── frontend_build/ # Pre-built React UI
├── Dockerfile
├── docker-compose.yml
├── .env.example
└── README.md
| Endpoint | Method | Description |
|---|---|---|
/analyze | POST | Analyze free text for contradictions |
/analyze_claims | POST | Analyze pre-extracted claims |
/health | GET | Health check |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/cases/{case_id}/documents | POST | Upload document |
/api/v1/cases/{case_id}/documents/zip | POST | Upload ZIP archive |
/api/v1/documents/{doc_id} | GET | Get document |
/api/v1/cases/{case_id}/analyze | POST | Start analysis job |
/api/v1/jobs/{job_id} | GET | Get job status |
| Endpoint | Method | Description |
|---|---|---|
/auth/register | POST | Register new firm |
/auth/login | POST | Login |
/auth/me | GET | Get current user |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/orgs | GET/POST | List/create organizations |
/api/v1/orgs/{id}/members | GET/POST | List/add org members |
/api/v1/orgs/{id}/invites | POST | Invite by email |
/api/v1/invites/{token}/accept | POST | Accept invite |
/api/v1/cases/{case_id}/training/start | POST | Start training session |
/api/v1/training/{session_id}/turn | POST | Record training turn |
/api/v1/training/{session_id}/back | POST | Undo last turn |
/api/v1/training/{session_id}/finish | POST | Finish + summary |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/feedback | POST | Create feedback (insight/plan_step) |
/api/v1/feedback?case_id=...&entity_type=... | GET | List feedback + aggregates |
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL | Yes | sqlite:///./dev.db | PostgreSQL connection string |
REDIS_URL | Yes | redis://localhost:6379/0 | Redis connection string |
STORAGE_BACKEND | No | local | local or s3 |
LLM_MODE | No | none | none, openrouter, deepseek, gemini |
PORT | No | 8000 | Server port |
BACKEND_LITE_ROLE | No | web | web or worker |
לבדיקה מהירה של DOCX ללא חשיפת טקסט:
python3 scripts/inspect_docx.py path/to/file.docx
For enhanced contradiction detection with AI:
# OpenRouter (recommended - access to multiple models)
LLM_MODE=openrouter
OPENROUTER_API_KEY=sk-or-v1-...
# Or DeepSeek
LLM_MODE=deepseek
DEEPSEEK_API_KEY=sk-...
# Or Gemini
LLM_MODE=gemini
GEMINI_API_KEY=...
/ (or leave empty)For the worker service, create a second Railway service with:
BACKEND_LITE_ROLE=worker# Build image
docker build -t jethro9 .
# Run web server
docker run -d \
-p 8000:8000 \
-e DATABASE_URL=postgresql://... \
-e REDIS_URL=redis://... \
jethro9
# Run worker
docker run -d \
-e DATABASE_URL=postgresql://... \
-e REDIS_URL=redis://... \
-e BACKEND_LITE_ROLE=worker \
jethro9
# Run all tests
pytest backend_lite/tests/ -v
# Run specific test
pytest backend_lite/tests/test_detector_rule_based.py -v
# With coverage
pytest backend_lite/tests/ --cov=backend_lite
detector.py - Rule-based contradiction detection engineextractor.py - Claim extraction from Hebrew legal textcross_exam.py - Cross-examination question generationplaybooks.yaml - Hebrew legal playbook templatesschemas.py - Pydantic models for APIProprietary - All rights reserved
For issues and feature requests, please contact the development team.