Skip to content

About

Resources

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

LexAgent — Legal Document Action Agent

A full-stack legal document review app with a pipeline of specialized agents (Summarizer, Clause Extractor, Risk Analyzer, Action Recommendation) that parse and analyze legal documents.

Runs entirely without paid AI APIs — analysis uses rule-based pattern matching and local NLP. Optional free local LLM via Ollama (USE_OLLAMA=1).

Built With

  • Frontend: Vite, React, Tailwind CSS v3, Framer Motion, Axios
  • Backend: Python, FastAPI, SQLAlchemy (SQLite), PyPDF, python-docx, PyJWT

How to Run Locally

Run both the backend API and the frontend UI.

1. Start the Backend API (FastAPI)

cd server
pip install -r requirements.txt
python seed_data.py
uvicorn main:app --reload --port 8000

No API keys required.

2. Start the Frontend UI (React + Vite)

cd ..   # project root (ErrorOverdose-main)
npm install
npm run dev

Optional: Local LLM (Ollama)

For richer clause classification without cloud costs:

  1. Install and run Ollama, then ollama pull llama3
  2. Set environment variables before starting the server:
    $env:USE_OLLAMA = "1"
    $env:OLLAMA_MODEL = "llama3"

Optional: Image OCR

Image uploads (JPG/PNG) use free Tesseract OCR when installed:

pip install pytesseract pillow
# Also install Tesseract: https://github.com/tesseract-ocr/tesseract

Without Tesseract, upload PDF, DOCX, or TXT instead.


Testing

cd server
pytest test_main.py -v

Import server/postman_collection.json into Postman to test endpoints manually.

Limitations (free mode)

  • Analysis is rule-based, not generative — it detects known risk patterns (liability, non-compete, indemnification, etc.) rather than deep semantic understanding.
  • Chat agents return structured responses derived from the submitted text, not open-ended LLM conversation.
  • Translation uses free Google Translate via deep-translator (requires internet).
  • Image text extraction requires Tesseract to be installed locally.

About

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages