Logo Lanfrica

mrithwik/legal-assitant

Record type:

software
Creator:
mri
Host:
assistant to do the prep work for legal cases in Kenya # Litigation Prep Assistant > **AI-assisted litigation preparation** for Kenyan law: turn case text (or a PDF) into a structured legal brief, streamed step-by-step to the browser over **Server-Sent Events (SSE)**. **Litigation Prep Assistant** is a production-style monorepo: a **FastAPI** backend with a **multi-step LLM pipeline** (extraction, RAG-grounded strategy, drafting, quality review), a **Next.js 16** App Router frontend, **Clerk** authentication, and **Pinecone** for statute retrieval. The corpus lives under `data/raw/`; embeddings use OpenAI `text-embedding-3-small`. > **Disclaimer:** This system is a **research and productivity aid**, not legal advice. Always have qualified counsel review outputs. **Provenance:** This repository continues the Andela AI Engineering Bootcamp team project **litigation-prep-assistant**. The work here **further enhances** that codebase and documentation as part of the **Andela AI Engineering Bootcamp** program requirements (for example production-oriented guides, RAG and infrastructure updates, and follow-on implementation work). For detailed documentation, see the **docs/** folder. --- ## At a glance | Layer | Technology | |--------|------------| | UI | Next.js 16, React, Tailwind, shadcn-style components | | API | FastAPI, async SQLAlchemy, Uvicorn | | Auth | Clerk (Bearer JWT, JWKS validation on the API) | | LLM | OpenAI or OpenRouter (`gpt-4o` default) via `instructor` + Pydantic | | RAG | Pinecone (serverless, cosine, 1536d) + retrieval pipeline in `backend/src/rag/` | | DB | SQLite in dev/CI, PostgreSQL (Aurora in prod) | | CI | GitHub Actions: ruff, mypy, pytest (≥70% cov), Next lint/test/build, ECR deploy on `main` | --- ## Architecture The backend runs **five** user-visible pipeline stages. **Extraction** and **Pinecone retrieval** are scheduled together; the UI receives the fact section as soon as extraction finishes, even if RAG is still in flight. **Strategy** consumes extraction plus retrieved …

Licenses