LEXOS
🧠 Legal Intelligence Operating System
1. Introduction
LEXOS is an internal Legal Intelligence Operating System.
It is not a document storage tool.
It is not a chatbot over PDFs.
It is not a contract lifecycle management (CLM) clone.
It is a system that transforms static legal documents into:
- Structured knowledge
- Governed intelligence
- Actionable deadlines
- Auditable decisions
- Calendar-integrated workflows
The purpose of LEXOS is to ensure:
We never miss legal obligations.
We understand our agreements structurally.
We can query our legal position safely and reliably.
We maintain full auditability over decisions and changes.
The first phase focuses on building the Core Value Spine:
Upload → Extract → Ask → Suggest → Apply → Calendar → Audit
If this loop works reliably and safely, LEXOS becomes foundational to our legal operations.
2. Why We Are Building This
Legal documents contain:
- Expiration terms
- Notice windows
- Renewal mechanics
- Insurance requirements
- Governing law clauses
- Patent milestones
- Compliance obligations
Today these are:
- Buried in PDFs
- Tracked manually
- Distributed across inboxes and spreadsheets
- Difficult to query
- Easy to forget
LEXOS solves this by introducing:
- Structured fact modeling
- Human-in-the-loop automation
- Evidence-based AI assistance
- Deterministic deadline generation
- Calendar-native visibility
- Full audit logging
The long-term goal is not automation for its own sake.
The goal is legal clarity + operational reliability.
3. What LEXOS Is (Conceptually)
LEXOS is composed of four logical layers:
3.1 Truth Layer (Structured Legal Registry)
This layer models legal reality.
Core primitives:
legal_objectlegal_object_versionclause_factdeadlinecalendar_itemrisk_flagsuggestion
Key principle:
Documents are evidence. Facts are truth.
Documents are stored and parsed.
Facts are normalized and validated via JSON schemas.
All derived outputs (deadlines, risks, calendar items) originate from facts.
3.2 Intelligence Layer (Ask Zara)
Zara is not a generic LLM chat assistant.
Zara is:
- Scope-aware
- Version-aware
- Evidence-constrained
- Citation-required
- Action-suggesting (not auto-mutating)
Zara must:
- Resolve the correct legal object versions
- Retrieve structured facts and clauses
- Refuse when evidence is insufficient
- Suggest safe actions (create deadline, create calendar item, etc.)
Zara does not:
- Provide unbounded legal advice
- Access unrelated documents
- Mutate state without explicit human apply
3.3 Action Layer (Suggestion + Apply)
Automation in LEXOS is always:
- Explicit
- Human-triggered
- Idempotent
- Audited
When Zara detects:
- A notice window
- A missing deadline
- A structural inconsistency
It creates a suggestion.
Only when a human clicks Apply does the system:
- Create deadlines
- Generate calendar items
- Create relationships
- Trigger scans
Every apply action:
- Requires idempotency key
- Validates schema
- Checks permissions
- Writes audit log
- Emits domain events
No silent automation is allowed.
3.4 Visibility Layer (Calendar + UI)
Legal obligations must be visible where work happens.
LEXOS generates:
- Deadlines
- Renewal windows
- Patent milestones
- Reminders
These appear:
- In the LEXOS UI
- In subscribed iCal calendars (Outlook, Google, Apple)
Calendar feeds are:
- Tokenized
- Revocable
- Scoped
- Auditable
This ensures legal events become operational events.
4. Design Philosophy
4.1 Evidence First
If the system cannot cite a clause or fact, it must refuse.
Trust > coverage.
4.2 Human-in-the-Loop
AI proposes.
Humans apply.
Everything is logged.
4.3 Deterministic Outputs
Deadlines and calendar items are computed from:
- Structured facts
- Explicit rules
- Known dates
Not from probabilistic LLM guesses.
4.4 Tenant-Safe Architecture
All data:
- Is tenant-scoped
- Enforced via Row-Level Security
- Checked at both DB and application layers
No cross-tenant leakage is acceptable.
4.5 Security by Design
Threat surfaces addressed:
- Prompt injection
- ICS feed leakage
- Suggestion replay
- Payload tampering
- Unauthorized relationship creation
Security is foundational, not optional.
5. What We Are NOT Building (Yet)
In Phase 1 we are not building:
- Full CLM
- Negotiation automation
- Advanced ML clause classification
- External patent API integrations
- Large risk scoring engines
- Enterprise dashboard analytics
We are building the spine first.
Expansion comes only after validation.
6. The Core Value Spine
The spine defines success.
A real contract must be able to go through:
- Upload document
- Add or extract expiration fact
- Ask Zara about notice period
- Zara suggests a deadline
- User applies suggestion
- Deadline generates calendar item
- Event appears in iCal
- All actions are auditable
If this works smoothly and safely, LEXOS is viable.
7. Long-Term Vision
Once the spine is validated internally, LEXOS can expand into:
- Conflict detection across agreements
- Patent lifecycle automation (EPO → CY → US)
- Risk posture dashboards
- Coverage metrics
- Compliance verification
- Legal knowledge graph
But all of that rests on the spine.
8. Summary for Engineers
You are not building:
- A chatbot
- A PDF viewer
- A task manager
You are building:
A structured, governed, auditable legal intelligence system.
Your priorities:
- Correctness over speed.
- Auditability over convenience.
- Explicit actions over automation.
- Tenant isolation over shortcuts.
- Determinism over guesswork.
If these principles are respected, LEXOS will become infrastructure, not a tool.
9. A 4 Week Execution Roadmap (Spine Sprint)
9.1. Objective
Deliver the LEXOS Core Value Spine in 4 weeks:
Upload document → Extract fact → Ask Zara → Suggest action → Apply → Calendar event → Visible in iCal → Fully audited.
This sprint focuses on:
- Trust
- Auditability
- Human-in-the-loop
- End-to-end working flow
Not included:
- Advanced ML extraction
- Full conflict engine
- Patent automation
- Dashboard analytics
🧠 Guiding Principles
- Evidence-first answers only
- No silent automation
- Everything auditable
- Strict schema validation
- Tenant isolation enforced at DB level
🗓 Week 1 – Core Domain + Security Foundation
🎯 Goal
Establish secure data foundation and minimal legal object lifecycle.
Deliverables
1️⃣ Database Core (Postgres + RLS)
Tables:
tenantprincipallegal_objectlegal_object_versionclause_factcalendar_itemsuggestionaudit_log
Requirements:
- Every table includes
tenant_id - Row-Level Security enabled
- JWT tenant claim enforced
2️⃣ Legal Object Service
Endpoints:
POST /v1/legal-objectsPOST /v1/legal-objects/{id}/versionsGET /v1/legal-objects/{id}
Minimum fields:
- type (contract | patent_application | insurance)
- status
- title
3️⃣ Manual Fact Entry
Endpoint:
POST /v1/legal-objects/{version_id}/facts
Support:
EFFECTIVE_DATEEXPIRATION_DATENOTICE_PERIOD_NON_RENEWALAUTO_RENEWAL
Schema validation required.
4️⃣ Audit Logging
Every write action must:
- Insert audit record
- Include
actor_id,tenant_id, timestamp - Emit domain event (outbox pattern)
✅ Week 1 Exit Criteria
- Can create legal object + version
- Can add verified fact
- Tenant isolation enforced
- All writes logged
- Basic API auth working
🗓 Week 2 – Ask Zara (Governed + Evidence-Based)
🎯 Goal
Implement safe, citation-required Q&A.
Deliverables
1️⃣ Scope Resolver
Function:
- Resolve applicable version(s)
- Return ordered list
No global searches allowed.
2️⃣ Retrieval Layer
Retrieve:
- Verified facts
- Clauses (simple full-text for now)
- Deadlines (if exist)
Must respect:
- Tenant
- Permission scope
3️⃣ Zara Policy Layer
Rules:
- If
require_citations=true → refuseif no citations - Must list
based_on_versions - Must include citations array
Answer format:
{
"answer_type": "extractive | refusal",
"answer_text": "...",
"citations": [...],
"based_on_versions": [...],
"suggested_actions": [...]
}
4️⃣ Suggestion Creation (Not Apply Yet)
When Zara detects:
- Expiration date + notice period
- Missing deadline
Create:
- suggestion record (
create_deadline)
✅ Week 2 Exit Criteria
- Can ask: “When must we send notice?”
- Zara answers with citation
- Zara proposes
create_deadlinesuggestion - Suggestion visible in UI
- Refuses if no evidence
🗓 Week 3 – Suggestion Apply + Calendar Engine
🎯 Goal
Close the automation loop safely.
Deliverables
1️⃣ Apply Endpoint
POST /v1/suggestions/{id}/apply
Must:
- Require Idempotency-Key
- Validate schema
- Check permissions
- Be fully transactional
- Emit audit events
2️⃣ Deadline Creation Logic
Applying create_deadline:
- Insert deadline
- Generate
calendar_itementries:deadlinewindow_close(if applicable)reminder(optional)
3️⃣ Calendar Service
Model:
calendar_item(kind,severity,starts_at, etc.)
Endpoints:
GET /v1/calendar-items?cursor=- Filter by severity, date range
4️⃣ ICS Feed Endpoint
GET /v1/calendars/{feed_id}.ics
Requirements:
- 256-bit random token
- Token hashed in DB
- 365-day forward limit
- 2000 event max
- Proper ICS escaping
- Stable UID
- Cancellation support
✅ Week 3 Exit Criteria
- Apply suggestion creates deadline
- Deadline generates calendar items
- iCal subscription works
- Cancelled items disappear from client
- Replay apply is idempotent
🗓 Week 4 – Hardening + Internal Alpha
🎯 Goal
Stabilize and prepare internal release.
Deliverables
1️⃣ Security Hardening
- Prompt injection guard
- Suggestion override validation
- ICS abuse protection
- Rate limiting on:
- Zara
- Apply endpoint
- ICS feed
2️⃣ Logging + Monitoring
Track:
- Suggestion applies per user
- Zara refusal rate
- ICS feed access patterns
- Error rate