Skip to content

letuandatt/LexMindChatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LexMind - Vietnam Law Chatbot

Hệ thống hỏi đáp thông minh về văn bản quy phạm pháp luật Việt Nam sử dụng AI.

Tính năng

  • Tra cứu văn bản pháp luật - Tìm kiếm và hỏi đáp về các Chỉ thị, Nghị định, Quyết định
  • Phân tích PDF - Upload tài liệu và chat trực tiếp với nội dung
  • Phân tích ảnh - Chụp ảnh văn bản để trích xuất thông tin
  • Multi-Agent System - Kiến trúc đa tác tử với Supervisor điều phối
  • Quản lý phiên chat - Lưu trữ và quản lý lịch sử hội thoại

Screenshots

Trang chủ

Giao diện Chat

Đăng nhập

Đăng ký

Quản lý File

Hồ sơ người dùng

Tech Stack

Frontend

  • Next.js 14
  • TypeScript
  • Tailwind CSS

Backend

  • FastAPI (Python)
  • MongoDB
  • Redis

AI/ML

  • Google Gemini (LLM)
  • Google File Search Store (RAG)
  • LangChain + LangGraph
  • Cohere Rerank

Cấu trúc thư mục

chatbot_newtech/
├── frontend/          # Next.js frontend
├── backend/           # FastAPI backend (auth, sessions, routers)
├── chatbot/           # Core chatbot (LLM, agents, tools, RAG)
├── docs/              # Documentation & images
└── requirements.txt   # Python dependencies

Cài đặt

1. Clone repository

git clone https://github.com/your-username/chatbot_newtech.git
cd chatbot_newtech

2. Backend

# Install dependencies
pip install -r requirements.txt

# Create .env file
cp chatbot/.env.example chatbot/.env
# Edit .env with your API keys

# Run backend
cd backend
uvicorn main:app --reload --port 8000

3. Frontend

cd frontend
npm install
npm run dev

4. Environment Variables

# Google AI
GOOGLE_API_KEY=your_google_api_key
LAW_MAIN_STORE_NAME=your_file_store_name

# MongoDB
MONGO_URI=mongodb://localhost:27017

# Redis
REDIS_URL=redis://localhost:6379

# JWT
JWT_SECRET_KEY=your_secret_key

# Email (Gmail SMTP)
GMAIL_USER=your_email
GMAIL_APP_PASSWORD=your_app_password
FRONTEND_URL=http://localhost:3000

API Endpoints

Endpoint Method Description
/auth/register POST Đăng ký tài khoản
/auth/login POST Đăng nhập
/chat/text POST Chat văn bản
/chat/image POST Chat với ảnh
/chat/pdf POST Chat với PDF
/sessions/ GET Lấy danh sách phiên
/sessions/{id} GET Chi tiết phiên

Kiến trúc Multi-Agent

User Query
    ↓
┌─────────────┐
│  Supervisor │  ← Điều phối và phân loại câu hỏi
└─────────────┘
    ↓
┌─────────────────────────────────────────┐
│                                         │
↓                ↓                ↓       ↓
LawResearcher    PersonalAnalyst  Vision  General
(RAG Search)     (User Files)     (Image) (Chitchat)

License

MIT License

Author

Lê Tuấn Đạt - 2025

About

A Retrieval-Augmented Multi-Agent Conversational System for Legal Document Question Answering

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published