π Documentation β Lawyer Assistant
Everything you need to build, debug, or understand the app β organized so you find answers fast. Official repository: github.com/haal-lab/Lawyer-Assistant Β· issues & PRs welcome.
π₯ Start here
| I want to... | Read this |
|---|---|
| Use the app | QUICKSTART.md β from clone to first query |
| Fix something broken | TROUBLESHOOTING.md β 12 failure scenarios with exact fixes |
| Understand the architecture | ARCHITECTURE.md β system diagram, ports, runtime modes |
π Full index
| Document | What's inside | Who it's for |
|---|---|---|
| π QUICKSTART.md | Clone β install β run β first query β verify | New developers |
| π©Ί TROUBLESHOOTING.md | Backend down, Ollama missing, stale ports, empty results, GPU OOM, slow first query | Anyone debugging |
| π CHANGELOG.md | Recent feature history β answers "what changed recently?" | Everyone tracking progress |
| ποΈ ARCHITECTURE.md | System overview, Electron/Vite/FastAPI components, ports, runtime modes | High-level understanding |
| π BACKEND.md | FastAPI endpoints, AI routers, tools, retrieval pipeline, compliance scan, config | API & backend questions |
| βοΈ FRONTEND.md | React layout, chat flow, Zustand stores, streaming events, theming, API layer | UI/UX & state management |
| π¨ PIPELINE_EDITOR.md | Visual canvas: sub-nodes, toggles, bypass edges, persistence, export/import | Pipeline feature |
| π PIPELINE_JSON.md | Exact JSON schema β write a valid layout from scratch | AI models & hand-editors |
| π₯οΈ GPU_MANAGEMENT.md | Smart VRAM sharing, RAM-first residency, priority, batch auto-tuning, per-project profiles | GPU tuning & low-end hardware |
| π€ AGENT_KNOWLEDGE_BASE.md | Quick Q&A β the fastest path to a correct answer | AI agents answering questions |
| π GLOSSARY.md | One-line definitions for every term (RAG, HNSW, BM25, SSE, HITL, β¦) | Terminology lookup |
| π CHATBOT_FLOW.md | Step-by-step: user types message β intent β tools β rerank β LLM β answer | Deep-dive: chat request end-to-end |
| π DATA_FLOW.md | Document ingestion: parse β chunk β embed β ChromaDB + BM25 | Deep-dive: data pipeline |
| πΊοΈ PIPELINE_ROADMAP.md | Planned improvements to the RAG pipeline | Roadmap |
| π¨ API_PROVIDER.md | Cloud mode: providers, env vars, mixing providers, rerank modes, extended thinking | API mode setup |
| π LAUNCHER.md | Setup page internals: install steps, provider picker, Ollama automation | Launcher development |
πΊοΈ Quick topic map
How do I run it? β QUICKSTART.md
Something broken? β TROUBLESHOOTING.md
What changed recently? β CHANGELOG.md
What is this app? β ARCHITECTURE.md
What ports does it use? β ARCHITECTURE.md Β§2
How does a chat flow work? β BACKEND.md Β§3 / CHATBOT_FLOW.md
What API endpoints exist? β BACKEND.md Β§2
How does retrieval work? β BACKEND.md Β§5
How does compliance scan? β BACKEND.md Β§6
How does the GPU manager? β GPU_MANAGEMENT.md
How is the UI structured? β FRONTEND.md
Where is state stored? β FRONTEND.md Β§3
What is the pipeline editor? β PIPELINE_EDITOR.md
How do I write a layout JSON? β PIPELINE_JSON.md
How do I set up API mode? β API_PROVIDER.md
How does the launcher work? β LAUNCHER.md
What does a term mean? β GLOSSARY.md
Quick answers to questions? β AGENT_KNOWLEDGE_BASE.md
π€ For AI agents
- Start with AGENT_KNOWLEDGE_BASE.md for the fastest correct answer.
- Follow cross-references to ARCHITECTURE.md, BACKEND.md, FRONTEND.md for depth.
- Verify facts against source code:
backend/main.py,backend/legal_retrieval/*.py,frontend/src/**.
π Project layout
Lawyer-Assistant/
βββ backend/ # Python β FastAPI + RAG engine + AI agents
β βββ main.py # Server entry point (port 8765)
β βββ legal_retrieval/ # Core engine (embedder, reranker, router, tools)
β βββ scripts/ # CLI helpers (ingest_all.py, query.py)
β βββ tests/ # Phase-based test suites
β βββ requirements.txt # Single dependency file
βββ frontend/ # React + TypeScript + Tailwind
β βββ src/ # App.tsx, components/, store/, services/
β βββ electron/ # Electron shell (main process, python bridge)
βββ launcher/ # Setup page (no dependencies needed)
βββ assets/ # README screenshots
βββ docs/ # This knowledge base
βββ data/ # ChromaDB, BM25, processed files
βββ models/ # BGE-M3, BGE-Reranker (downloaded on first run)