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
3οΈβ£ Internal Documentationβ
Document:
- How to ask Zara
- How to apply suggestions
- How to subscribe to calendar
- What is automated vs manual
4οΈβ£ Alpha Datasetβ
Upload:
- 10 real contracts
- Add real expiration + notice facts
- Test full loop
β Week 4 Exit Criteriaβ
- Full spine works in real scenarios
- At least 5 real deadlines generated
- At least 2 users actively using Zara
- Calendar feed actively subscribed
- No cross-tenant leaks
- Audit trail verified
π Success Metricsβ
Within 2 weeks of alpha:
- 80% of renewal deadlines generated via Zara suggestion
- Zero missed deadlines
- Users consult Zara before checking raw PDFs
- Calendar feed becomes daily workflow tool
π« Explicitly Deferredβ
- Patent automation
- Conflict engine
- Dashboard analytics
- Advanced ML extraction
- External integrations
These begin only after spine validation.
π§ Definition of βSpine Completeββ
We consider the spine complete when:
- A real contract is uploaded
- Zara identifies a notice window
- Zara suggests a deadline
- A user clicks βApplyβ
- Deadline appears in LEXOS
- Deadline appears in iCal
- All actions are auditable