diff --git a/app/bots/legal-expert/README.md b/app/bots/legal-expert/README.md new file mode 100644 index 0000000..0a00ad9 --- /dev/null +++ b/app/bots/legal-expert/README.md @@ -0,0 +1,53 @@ +# Lex - AI Legal Assistant + +## Overview + +Lex is an AI-powered legal assistant that runs on a private AI node. It can be deployed for individuals, lawyers, or entire law firms. The system keeps confidential documents secure while providing fast legal research, document analysis, and compliance checks. + +## Features + +- **Legal Research** – Search statutes and case law with precision +- **Document Analysis** – Summarize and extract key clauses from contracts and filings +- **Case Law Insights** – Surface relevant precedents for your matter +- **Regulatory Compliance** – Check requirements across jurisdictions +- **Contract Review** – Highlight risks and missing clauses automatically + +## File Structure + +``` +legal-expert/ +├── page.tsx # Main page component +├── styles.css # Custom styles for the bot +├── README.md # This documentation +└── components/ # Modular UI components + ├── hero/ # Hero section + ├── disclaimer/ # Legal disclaimer + ├── features/ # Feature cards + ├── how-it-works/ # Step-by-step guide + ├── usecases/ # Common use cases + └── cta/ # Call to action +``` + +## Architecture + +Lex follows the same architecture as other bots in this repository. Each section of the page is implemented as an isolated React component, making the code easy to maintain and extend. TailwindCSS is used for styling and responsive design. + +## Development + +1. Run the development server: + ```bash + npm run dev + ``` +2. Navigate to `http://localhost:3000/bots/legal-expert` to see the page. +3. Unit tests can be executed with: + ```bash + npm test + ``` + +## Security + +Lex runs on a private AI node, ensuring that uploaded documents never leave your infrastructure. No user data is shared with third parties when deployed privately. Always follow best practices for access control and data encryption. + +## License + +MIT diff --git a/app/bots/legal-expert/components/cta/CallToActionSection.tsx b/app/bots/legal-expert/components/cta/CallToActionSection.tsx new file mode 100644 index 0000000..59717bf --- /dev/null +++ b/app/bots/legal-expert/components/cta/CallToActionSection.tsx @@ -0,0 +1,26 @@ +import React from 'react'; + +interface Props { + getTryLink: () => string; +} + +const CallToActionSection: React.FC = ({ getTryLink }) => ( +
+
+

Ready to Get Started?

+

+ Deploy your own private AI legal assistant and keep your data secure. +

+
+ + Try Lex Now + + + Learn More + +
+
+
+); + +export default CallToActionSection; diff --git a/app/bots/legal-expert/components/disclaimer/DisclaimerSection.tsx b/app/bots/legal-expert/components/disclaimer/DisclaimerSection.tsx new file mode 100644 index 0000000..572dd6f --- /dev/null +++ b/app/bots/legal-expert/components/disclaimer/DisclaimerSection.tsx @@ -0,0 +1,14 @@ +import React from 'react'; + +const DisclaimerSection: React.FC = () => ( +
+

+ Lex provides information for educational purposes only and is not a substitute for professional legal advice. +

+

+ Always consult a qualified attorney for specific legal matters. Use of Lex does not create an attorney-client relationship. +

+
+); + +export default DisclaimerSection; diff --git a/app/bots/legal-expert/components/features/FeaturesSection.tsx b/app/bots/legal-expert/components/features/FeaturesSection.tsx new file mode 100644 index 0000000..f669628 --- /dev/null +++ b/app/bots/legal-expert/components/features/FeaturesSection.tsx @@ -0,0 +1,56 @@ +import React, { useState } from 'react'; + +interface FeatureItem { + title: string; + description: string; + icon: string; +} + +interface FeaturesSectionProps { + features: FeatureItem[]; +} + +const FeaturesSection: React.FC = ({ features }) => { + const [expanded, setExpanded] = useState(null); + + const toggle = (index: number) => { + if (expanded === index) setExpanded(null); else setExpanded(index); + }; + + return ( +
+

Key Capabilities

+

+ Build a private AI node that keeps your confidential documents secure while providing powerful legal insights. +

+
+ {features.map((f, idx) => ( +
toggle(idx)} + > +
+ {f.icon} +
+

{f.title}

+

{f.description}

+ {expanded === idx && ( +
+

Securely deployed for individuals, lawyers, or entire firms with full control over your data.

+
+ )} +
+ {expanded === idx ? 'Show less' : 'Learn more'} + + + +
+
+ ))} +
+
+ ); +}; + +export default FeaturesSection; diff --git a/app/bots/legal-expert/components/hero/HeroSection.tsx b/app/bots/legal-expert/components/hero/HeroSection.tsx new file mode 100644 index 0000000..638f7c4 --- /dev/null +++ b/app/bots/legal-expert/components/hero/HeroSection.tsx @@ -0,0 +1,61 @@ +import React from 'react'; +import Link from 'next/link'; + +interface HeroSectionProps { + title: string; + overview: string; + getTryLink: () => string; +} + +const HeroSection: React.FC = ({ title, overview, getTryLink }) => { + return ( +
+
+
+
+ ⚖️ Private AI Node +
+

+ {title}: Your AI Legal Assistant +

+

+ {overview} +

+
+ + Chat with Lex + + + + + Explore Features +
+
+
+
+
+ ⚖️ +
+
+

Lex

+

AI Legal Assistant

+
+
+
+
+

How can I help with your legal research today?

+
+
+

I need a summary of recent cases on data privacy in Europe.

+
+
+

I'll search through the latest directives and case law to provide a concise overview.

+
+
+
+
+
+ ); +}; + +export default HeroSection; diff --git a/app/bots/legal-expert/components/how-it-works/HowItWorksSection.tsx b/app/bots/legal-expert/components/how-it-works/HowItWorksSection.tsx new file mode 100644 index 0000000..b4f1400 --- /dev/null +++ b/app/bots/legal-expert/components/how-it-works/HowItWorksSection.tsx @@ -0,0 +1,35 @@ +import React from 'react'; + +const steps = [ + { + title: 'Ask a question or upload documents', + description: 'Provide a legal query or drag and drop your files for analysis.', + }, + { + title: 'AI analysis on your private node', + description: 'Lex processes information using your dedicated model without exposing data to third parties.', + }, + { + title: 'Receive structured insights', + description: 'Get clear explanations, references, and next steps for your legal matter.', + }, +]; + +const HowItWorksSection: React.FC = () => ( +
+

How It Works

+
    + {steps.map((step, idx) => ( +
  1. +
    {idx + 1}
    +
    +

    {step.title}

    +

    {step.description}

    +
    +
  2. + ))} +
+
+); + +export default HowItWorksSection; diff --git a/app/bots/legal-expert/components/usecases/UseCasesSection.tsx b/app/bots/legal-expert/components/usecases/UseCasesSection.tsx new file mode 100644 index 0000000..6692d40 --- /dev/null +++ b/app/bots/legal-expert/components/usecases/UseCasesSection.tsx @@ -0,0 +1,46 @@ +import React from 'react'; + +const useCases = [ + { + title: 'Contract Review', + description: 'Identify potential issues in agreements before you sign.', + icon: 'document-text', + }, + { + title: 'Legal Research', + description: 'Find precedents and regulations relevant to your question.', + icon: 'search', + }, + { + title: 'Compliance Check', + description: 'Ensure business practices align with current regulations.', + icon: 'shield-check', + }, +]; + +const iconPaths: Record = { + 'document-text': 'M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z', + search: 'M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z', + 'shield-check': 'M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z', +}; + +const UseCasesSection: React.FC = () => ( +
+

Common Use Cases

+
+ {useCases.map((u, idx) => ( +
+
+ + + +
+

{u.title}

+

{u.description}

+
+ ))} +
+
+); + +export default UseCasesSection; diff --git a/app/bots/legal-expert/page.tsx b/app/bots/legal-expert/page.tsx index cb41333..3f04718 100644 --- a/app/bots/legal-expert/page.tsx +++ b/app/bots/legal-expert/page.tsx @@ -1,211 +1,59 @@ 'use client'; import React from 'react'; -import Link from 'next/link'; import bots from '../../../data/bots'; import BotNavigation from '../BotNavigation'; +import './styles.css'; + +import HeroSection from './components/hero/HeroSection'; +import DisclaimerSection from './components/disclaimer/DisclaimerSection'; +import FeaturesSection from './components/features/FeaturesSection'; +import HowItWorksSection from './components/how-it-works/HowItWorksSection'; +import UseCasesSection from './components/usecases/UseCasesSection'; +import CallToActionSection from './components/cta/CallToActionSection'; export default function LegalExpert() { const bot = bots.find(b => b.slug === 'legal-expert'); - // Menu items for navigation const menuItems = [ { id: 'features', label: 'Features', icon: '⚖️', section: 'features' }, + { id: 'how-it-works', label: 'How It Works', icon: '🔎', section: 'how-it-works' }, { id: 'use-cases', label: 'Use Cases', icon: '📝', section: 'use-cases' }, - { id: 'limitations', label: 'Limitations', icon: '⚠️', section: 'limitations' }, - { id: 'legal-topics', label: 'Legal Topics', icon: '📚', section: 'legal-topics' }, { id: 'get-started', label: 'Get Started', icon: '🚀', section: 'get-started' } ]; - // Function to get the chat link - const getChatLink = () => { - return bot?.tryLink || 'https://chat.openai.com/'; - }; + const getTryLink = () => bot?.tryLink || 'https://chat.openai.com/'; if (!bot) { - return
Bot not found
; + return
Lex configuration not found
; } + const featureItems = [ + { title: 'Legal Research', description: 'Search statutes and case law with precision.', icon: '📚' }, + { title: 'Document Analysis', description: 'Understand contracts and legal briefs instantly.', icon: '📄' }, + { title: 'Case Law Insights', description: 'Surface relevant precedents for your matter.', icon: '💡' }, + { title: 'Regulatory Compliance', description: 'Check requirements across jurisdictions.', icon: '✅' }, + { title: 'Contract Review', description: 'Highlight risks and missing clauses automatically.', icon: '✍️' }, + ]; + return (
- {/* Bot-specific Navigation */} - +
- {/* Title and Overview */} -
-

Lex

- - {/* Legal Disclaimer */} -
-
- - - -
-

Important Disclaimer

-

- Lex provides information of a general nature and is designed for informational purposes only. - It is not a substitute for professional legal advice. Always consult with a qualified attorney for specific legal matters. -

-
-
-
- -

{bot.overview}

-
- - {/* Features Section */} -
-
-

Features

-
    - {bot.features.map((feature, index) => ( -
  • - - - - {feature} -
  • - ))} -
-
- -
-

How It Works

-
    -
  1. -
    - 1 -
    -
    -

    Ask a legal question

    -

    Type your legal question or upload a document for analysis.

    -
    -
  2. -
  3. -
    - 2 -
    -
    -

    AI Analysis

    -

    Our AI analyzes your question using legal knowledge and resources.

    -
    -
  4. -
  5. -
    - 3 -
    -
    -

    Get Insights

    -

    Receive clear explanations and insights to better understand your legal matter.

    -
    -
  6. -
-
-
- - {/* Interactive Demo Section */} -
-

Try Lex

-
-

Enter a legal question or upload a document for analysis.

- -
-