mirror of
https://github.com/bitbaum/botsmann.git
synced 2026-12-04 05:30:41 +01:00
* fix(ai): pick chain vendors by id, and make main green again main has been red since #203 bumped @bitbaum/ai-kit to 1.10, which put Gemini second in freeChain('BOTSMANN'). vendorChain() indexed [1] for OpenRouter, so a BYOK OpenRouter user's key would have been sent down the Gemini link. Look vendors up by id instead (code and both tests). Also clears the rest of the red verify from the same bump: prettier 3.x reformat of six files and the new next lint rule on relative window.location.href assignments (sign-out keeps its full reload). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Cato <41178744+catomean@users.noreply.github.com> * fix(ai): context extraction runs only on the user's own key Every professional-chat turn fired a second, unasked model call (extractAndSaveContext, fire-and-forget after the answer) on the shared free-tier Groq key. Standing rule (2026-09-25): free-tier keys are spent only when a person deliberately asks. Extraction now requires the user's own key and uses their provider; without one it returns before any call. Adds tests/__tests__/no-free-background-ai.test.ts: walks the import graph from the timer route (/api/rebuild, appcron-botsmann-rebuild), /api/warmup and /api/health and fails if any reaches a model client. Proven by mutation: importing lib/nlp into /api/rebuild fails it, and dropping the own-key guard fails the three new extractor cases. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Cato <41178744+catomean@users.noreply.github.com> --------- Signed-off-by: Cato <41178744+catomean@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
10 KiB
10 KiB
Lex - AI Legal Assistant Platform
Democratizing access to justice through AI-powered collaborative data rooms
🎯 What is Lex?
Lex is a revolutionary legal platform that combines:
- AI-powered analysis - Instant document review and case research
- Human expertise - Real lawyers available when you need them
- Collaborative data rooms - Secure workspaces for all parties
- No appointments - Chat 24/7 with AI, lawyers join seamlessly
The Problem We're Solving
- Legal help is expensive and inaccessible for most people
- Finding the right lawyer is time-consuming and uncertain
- Case management is fragmented across emails, files, and apps
- Clients lack transparency into what their lawyers are doing
Our Solution
A unified platform where AI handles routine work, lawyers provide expert guidance, and everyone collaborates in secure, transparent data rooms with multi-level access control.
✨ Key Features
1. 🌍 Global Jurisdiction Coverage
- 130+ jurisdictions with hierarchical selection
- US: All 50 states
- EU: All 27 member countries
- Switzerland: All 26 cantons (Zürich, Bern, Geneva, etc.)
- UAE: Dubai, Abu Dhabi, Sharjah, etc.
- Popular cities: Singapore, Hong Kong, and more
2. 💬 Interactive Data Rooms
The heart of Lex - a secure collaborative workspace with:
- Real-time chat: AI + human lawyer, no appointments
- Smart file management: Auto-categorized documents
- Activity timeline: Full audit trail
- Multi-level access: Granular permissions for team members
- End-to-end encryption: Bank-level security
3. 🤖 AI-Powered Intelligence
- Document analysis: Extract key clauses, dates, entities
- Auto-categorization: 8 file categories automatically organized
- Smart responses: Context-aware answers based on your case
- Precedent matching: Find relevant case law instantly
- Risk assessment: Identify potential issues early
4. 👨⚖️ Smart Lawyer Matching
- AI matches you with lawyers based on:
- Expertise in your legal area
- Jurisdiction knowledge
- Availability and response time
- Hourly rates and languages
- Past case success rates
5. 📱 Mobile-First Design
- Responsive on all devices
- Touch-optimized interface
- Progressive disclosure (show complexity when needed)
- Fast, smooth interactions
🚀 Getting Started
Prerequisites
- Node.js 18+
- npm or yarn
- Git
Installation
# Clone the repository
git clone <repo-url>
cd botsmann
# Install dependencies
npm install
# Run development server
npm run dev
# Open in browser
open http://localhost:3000/bots/legal-expert
Project Structure
/app/bots/legal-expert/
├── page.tsx # Main page
├── components/
│ ├── demo/ # 🔥 Core demo components
│ │ ├── DemoSection.tsx # 4-step wizard
│ │ ├── DataRoomDemo.tsx # Live chat interface
│ │ ├── JurisdictionSelector.tsx # Hierarchical picker
│ │ ├── FileUploader.tsx # File upload
│ │ ├── LawyerMatcher.tsx # Lawyer selection
│ │ ├── AIWorkspace.tsx # File organization
│ │ ├── jurisdictions.ts # 130+ jurisdictions
│ │ ├── constants.ts # Mock data
│ │ ├── types.ts # TypeScript types
│ │ └── README.md # Component docs
│ ├── hero/ # Landing section
│ ├── features/ # Features showcase
│ ├── testimonials/ # User testimonials
│ ├── vision/ # Long-term vision
│ └── cta/ # Call-to-action
└── styles.css # Custom styles
📖 Documentation
For New Engineers
- Project Overview - Start here! Complete context and vision
- Technical Architecture - System design and data models
- Mobile-First Improvements - UX/UI decisions
- Demo Improvements - Feature evolution
- Component README - Demo architecture
For Product/Design
- Review the 4-step demo flow in action
- See mobile-first responsive design
- Understand progressive disclosure strategy
- Explore data room collaboration features
For Business/Legal
- Understand multi-level access control
- See transparency and audit trail features
- Review security and compliance approach
- Explore lawyer matching algorithm
🎨 Demo Flow
Step 1: Case Input
- Select jurisdiction (hierarchical drill-down)
- Choose legal area (12 high-demand categories)
- Describe your case (min 20 chars)
- Set urgency level
- Upload files (optional, drag-and-drop)
Step 2: Lawyer Matching
- AI filters lawyers by expertise
- View matched lawyers with full profiles
- Select your lawyer (one tap)
- Review case summary
Step 3: AI Workspace
- See files auto-organized into 8 categories
- View AI insights for each category
- Understand multi-level access control
- Learn about transparency features
Step 4: Data Room (NEW! 🔥)
- Live chat with AI and lawyer
- File management (browse, comment, download)
- Activity timeline (full audit trail)
- Real-time collaboration (no appointments needed)
🏗️ Tech Stack
Frontend
- Framework: Next.js 14+ (React 18)
- Language: TypeScript
- Styling: Tailwind CSS
- State: React Hooks
- Icons: Emojis + custom SVG
Backend (Production)
- API: Node.js + Express / GraphQL
- Database: PostgreSQL
- Cache: Redis
- File Storage: AWS S3
- Real-time: Socket.io / WebSocket
AI Services
- LLM: OpenAI GPT-4 / Anthropic Claude
- Vector DB: Pinecone / Weaviate
- NLP: spaCy / Hugging Face
Infrastructure
- Hosting: Vercel (Frontend) + AWS (Backend)
- CDN: CloudFlare
- Monitoring: Sentry + DataDog
- CI/CD: GitHub Actions
🔐 Security & Privacy
Data Protection
- ✅ End-to-end encryption for messages
- ✅ Files encrypted at rest (AES-256)
- ✅ Zero-knowledge architecture
- ✅ GDPR/HIPAA compliant
Access Control
- ✅ Role-based permissions
- ✅ Granular file access
- ✅ Full audit trail
- ✅ Session management
Compliance
- ✅ Attorney-client privilege protected
- ✅ Multi-jurisdiction support
- ✅ Data portability (GDPR)
- ✅ Right to erasure
📊 Current Status
✅ Completed
- Hierarchical jurisdiction system (130+ jurisdictions)
- 4-step interactive demo wizard
- Live data room with real-time chat
- AI + human lawyer simulation
- File upload and auto-categorization
- Smart lawyer matching
- Mobile-first responsive design
- Progressive disclosure UI
- Comprehensive documentation
🚧 In Progress
- Backend API development
- Real AI integration (currently simulated)
- WebSocket implementation
- Payment processing
- Video consultation
🔮 Roadmap
- Mobile apps (React Native)
- E-signatures integration
- Court filing automation
- Blockchain audit trail
- Multi-language support
🤝 Contributing
For Team Members
- Create feature branch:
git checkout -b feature/your-feature - Make changes (follow TypeScript + functional components)
- Test on mobile and desktop
- Create PR with clear description
- Request review from 1+ team members
Code Style
- TypeScript strict mode
- Functional components with hooks
- Tailwind for styling (no custom CSS unless needed)
- JSDoc for exported functions
- Descriptive variable names
📈 KPIs & Metrics
Live Metrics (Shown on Page)
- Waitlist Members: 0 (honest tracking)
- Active Cases: 0
- Data Rooms Created: 0
- Expected Launch: Q2 2025
Target Metrics (Q2 2025)
- 10,000+ waitlist signups
- 1,000+ beta users
- 50+ verified lawyers
- 95%+ user satisfaction
🎯 What Makes Lex Different
- Human-in-the-Loop AI - Not replacing lawyers, augmenting them
- Collaborative Data Rooms - Multi-party secure workspaces
- No Appointments - Chat with AI 24/7, lawyer joins when needed
- Full Transparency - Every action logged and visible
- Democratized Access - Quality legal help for everyone
- Mobile-First - Built for how people actually use phones
- Progressive Disclosure - Simple on surface, powerful underneath
📞 Contact & Support
Development Team
- Project Lead: TBD
- Lead Engineer: TBD
- Design Lead: TBD
Resources
- Issues: GitHub Issues
- Slack: #lex-platform
- Email: dev@lex.legal
📝 License
MIT License - see LICENSE for details
🙏 Acknowledgments
- OpenAI for GPT-4 API
- Anthropic for Claude
- Next.js team for amazing framework
- Tailwind CSS for utility-first CSS
- All contributors and early users
🚀 Next Steps
For New Engineers
- Read: LEX_PROJECT_OVERVIEW.md - Full context
- Explore: Try the demo at
/bots/legal-expert - Review: Check Technical Architecture
- Build: Pick an issue and start coding!
For Product Team
- Test: Mobile experience on real devices
- Feedback: Gather user feedback on demo flow
- Iterate: Improve based on insights
- Plan: Prioritize Phase 2 features
For Business Team
- Launch: Beta waitlist campaign
- Partner: Reach out to law firms
- Fund: Prepare investor deck
- Hire: Recruit legal experts for advisory board
This is not just a demo—it's the foundation of a revolution in legal services.
Built with ❤️ by the Lex team
Last Updated: January 2026 Version: 1.0.0 Status: Active Development