Contributing to LexRAG
Thank you for your interest in LexRAG! We welcome contributions from the legal-tech and AI community.
Code of Conduct
All contributors must abide by our Code of Conduct.
Getting Started
- Fork the repository
- Clone your fork:
git clone https://github.com/eulogik/LexRAG.git - Create a virtual environment:
python3 -m venv venv && source venv/bin/activate - Install dependencies:
pip install -r requirements.txt - Install dev dependencies:
pip install pytest pytest-cov - Run tests:
pytest
Development Workflow
- Create a feature branch:
git checkout -b feat/my-feature - Write tests for your changes
- Ensure all tests pass:
pytest - Run linting:
ruff check .(if available) - Commit with conventional commits:
feat:,fix:,docs:,refactor:, etc. - Push and open a Pull Request
Pull Request Guidelines
- Link to any relevant issues
- Include test coverage for new functionality
- Update documentation (README, inline docs) as needed
- Ensure the PR passes CI checks
Project Structure
LexRAG/
βββ api/ # FastAPI server, RAG engine, memory, utils
βββ embeddings/ # Vector embedding models (fastembed + Qdrant)
βββ scrapers/ # Legal document scrapers (UAE, India)
βββ scripts/ # Ingestion, updates, batch processing
βββ ui/ # Terminal-style SPA frontend
βββ tests/ # Test suite
βββ data/ # SQLite DB, raw/processed documents
Adding a New Scraper
- Create
scrapers/<jurisdiction>_scraper.py - Implement functions that call
scripts.ingest.ingest_text() - Add the scraper to
scripts/daily_update.py - Write tests for the scraper
Adding a New LLM Provider
- Add a streaming function in
api/rag_engine.py(e.g.,stream_anthropic()) - Register in
stream_provider()dispatcher - Add the provider to
MODEL_CATALOGinapi/main.py - Add the provider label in
ui/app.js - Document the required environment variable
Questions?
Open an issue at https://github.com/eulogik/LexRAG/issues Or reach out to engineering@eulogik.com