An AI-powered legal awareness assistant that provides structured, safe, and contextual legal guidance — designed as a “legal first-aid” system.
LegalAI is a full-stack conversational AI application that helps users understand legal situations in a structured and safe manner.
It does NOT replace a lawyer, but acts as a first step guidance system, helping users:
- Understand their situation
- Take immediate actions
- Stay aware of legal boundaries
- Decide when to consult a professional
- Context-aware responses
- Structured legal explanations
- Safe and non-definitive advice
- ChatGPT-like UI
- Real-time message flow
- Session-based conversations
- Create new chats automatically
- Sidebar with chat history
- Delete & manage conversations
- React frontend (Vite)
- Python backend (FastAPI)
- AI integration via Groq (LLaMA models)
- No legal guarantees
- Encourages professional consultation
- Built-in disclaimers
- React (Vite)
- Tailwind CSS
- Context API (State Management)
- Python (FastAPI)
- REST API architecture
- Groq API
- LLaMA 3.3 70B model
- Git & GitHub
- Postman (API testing)
legal-ai/
│
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── context/
│ │ ├── pages/
│ │ └── services/
│
├── backend/
│ ├── app/
│ ├── routes/
│ └── chat.py
│
├── .gitignore
└── README.md
- User enters a legal query
- Frontend sends request to backend
- Backend calls AI model (Groq API)
- AI generates structured legal response
- Response is displayed in chat UI
The AI responds in a structured format:
- Situation Understanding
- Immediate Steps
- Legal Awareness
- Caution
- Suggestion to consult a lawyer
- Disclaimer
git clone https://github.com/YOUR_USERNAME/legal-ai.git
cd legal-ai
cd backend
pip install -r requirements.txt
Create .env file:
GROQ_API_KEY=your_api_key_here
Run backend:
uvicorn app.main:app 1--reload
cd frontend
npm install
npm run dev
GROQ_API_KEY=your_api_key
VITE_API_BASE_URL=http://localhost:8000
Add your UI screenshots here 👇
- Chat Interface
- Sidebar
- AI Response Example
- 🔹 Chat history persistence (Database)
- 🔹 Voice input support
- 🔹 Emotion-aware responses
- 🔹 Lawyer connection system
- 🔹 Multi-language support
- 🔹 Authentication & user accounts
This project provides general legal information only and does NOT constitute legal advice. Always consult a qualified legal professional for serious matters.
Ayush Kumar
- GitHub: https://github.com/ayush-kumar-24
- Project: LegalAI
If you like this project:
⭐ Star the repo 🍴 Fork it 🧠 Contribute
Built with the vision of making legal awareness accessible to everyone, especially for people who lack immediate legal guidance.