📚 Docs / Troubleshooting — Lawyer Assistant

Troubleshooting — Lawyer Assistant

Common failures, their causes, and fixes. Cross-referenced with the rest of the knowledge base — start with the quick table, then jump to a section or a doc for depth.
Getting started? See QUICKSTART.md first.

0. Quick reference

SymptomLikely causeFix
Boot screen stuck on "loading"Backend never became ready§1 — check backend startup / Python on PATH
"Could not reach the backend server"Nothing listening on 8765§1 — start the backend or restart npm run dev
EADDRINUSE / port 8765 busyStale backend process§2 — kill the port, restart
Answers say model "unavailable"Ollama not running / no model§3 — start Ollama, ollama pull lfm2.5:8b
"No workspace selected. Select a project folder first."No project folder active§4a — pick a folder with "Work in a folder" (a workspace is required)
No sources, "could not find relevant information"Corpus not ingested§4 — ingest documents (bulk or attach)
First query very slowModels loading cold§5 — warmup / patience on first run
CUDA out of memoryBatch size too large for GPU§6 — --batch-size 32 or CPU
Electron shows "Frontend Dev Server Failed"Vite can't start on 5173§7 — cd frontend && npm install
Attached file doesn't appear in chatUpload failed / unsupported type§8 — check /api/upload, extensions, 5-file cap
Stream ends with no answerInterrupt or SSE hiccup§9 — check ApprovalBar; retry
Scan fails or flags missingDocument not indexed / 50MB cap§10 — ingest first, check caps

1. Backend not reachable on port 8765

Symptoms: BootLoader stuck on "loading"; toast/error "Could not reach the backend server. Make sure the Python server is running on port 8765."

Causes & checks:

bash# Is anything listening on 8765?
curl http://localhost:8765/api/health          # expect {"status":"ok",...}
netstat -ano | findstr :8765 | findstr LISTENING   # Windows
lsof -ti:8765                                  # macOS/Linux

If nothing responds, the backend didn't start. Common reasons:

  1. Python 3 not on PATH — Electron's venv-manager needs a system Python to create .venv; if it can't find one it falls back to python/python3, which also fails. Verify: python --version.
  2. Venv/dependency setup failed — the bridge logs to the Electron console ("Venv setup failed, falling back to system Python"). Fix manually:
bash   python -m venv .venv
   .venv\Scripts\activate        # Windows   |   source .venv/bin/activate
   pip install -r backend/requirements.txt
   python backend/main.py        # run directly to see errors
  1. Warmup takes a while — the backend binds the port first, then warms up models in the background, so /api/health should respond quickly. If the process crashes during warmup (OOM, missing model), see §5/§6.

Fix: restart npm run dev (it kills stale listeners and retries). Watch the Electron terminal for Python stdout/stderr.


2. Stale processes on 8765 / 5173

Symptom: EADDRINUSE errors; a previous instance's backend keeps serving old code.

Electron already kills listeners on 8765 and 5173 at startup (frontend/electron/src/main/index.tskillPort). If you still hit conflicts:

bash# Windows
netstat -ano | findstr :8765 | findstr LISTENING
taskkill /F /PID <pid>

# macOS/Linux
lsof -ti:8765 | xargs kill -9

Then restart the app. See QUICKSTART.md §3.


3. Ollama not running / model unavailable

Symptom: The status/meta line reports model "unavailable"; answers may be generic or missing; direct mode fails.

Causes:

Fixes:

bashollama serve                        # ensure the daemon is running
ollama list                         # see pulled models
ollama pull lfm2.5:8b               # pull the launcher's default model
Retrieval still works without Ollama — only LLM generation (RAG answers, relevance verification, scanning) degrades. See BACKEND.md §7.

4. Empty results / "no relevant documents"

Symptom: The agent honestly says it couldn't find relevant information; Sources panel is empty; retrieval returns 0 chunks.

Cause: The corpus was never ingested (empty <project>/workspace/chroma_db for the active project — or no workspace selected at all).

Checks:

bashcurl http://localhost:8765/api/documents    # list indexed files

4a. "No workspace selected"

Symptom: Chat/upload/scan error with "No workspace selected. Select a project folder first."

Cause: A project folder is now required — there is no default data/ folder fallback.

Fix: In the app, click "Work in a folder" and pick the project folder. The backend then stores everything under <project>/workspace/.


4b. Empty workspace index

Fixes:

bash  .venv\Scripts\activate
  cd backend && python scripts/ingest_all.py            # --reset to rebuild

Also verify the reranker isn't filtering everything: if scores are all below the threshold, try skip_rerank / --no-rerank. See

BACKEND.md §5.


5. Slow first query

Symptom: The first query takes 10–30s; later ones are fast.

Cause: Models (BGE-M3, BGE-Reranker, LLM) load on first use.

Fix: The backend warms up all models in a background thread at startup (backend/main.py), so in the desktop app the first query is already fast after the warmup completes (~seconds after launch). If you run the backend directly and skip warmup, expect a one-time load. Don't kill the app during warmup.


6. GPU out of memory

Symptom: CUDA out of memory during ingestion or embedding.

Fixes:

bashcd backend && python scripts/ingest_all.py --batch-size 32    # lower GPU memory
cd backend && python scripts/ingest_all.py --device cpu       # force CPU

Runtime device is auto-resolved (cudampscpu) in backend/legal_retrieval/config.py (resolve_device); you can override with PLR_* env vars. See BACKEND.md §5.


7. Frontend dev server failed

Symptom: Electron window shows "⚠️ Frontend Dev Server Failed" and hints cd frontend && npm install.

Fixes:

bashcd frontend && npm install && npm run dev   # confirm Vite starts on 5173

If 5173 is occupied by another app, stop it or restart npm run dev (which kills stale 5173 listeners). See FRONTEND.md §8.


8. Attachments don't work

Symptoms: Files don't upload; uploads fail; attached file ignored.

Checks:

See FRONTEND.md §2 and BACKEND.md §2.


9. Stream ends without an answer

Symptoms: Answer never arrives; spinner stops; execution log incomplete.

Causes:


10. Playbook scan fails / flags missing

Symptoms: Scan errors; zero flags; "Document not found".

Checks:


11. Diagnostics cheatsheet

bashcurl http://localhost:8765/api/health       # backend alive?
curl http://localhost:8765/api/documents    # indexed files
curl http://localhost:8765/api/playbooks    # available playbooks
curl http://localhost:8765/api/flags        # persisted flags
netstat -ano | findstr :8765                # Windows port check
ollama list                                 # pulled LLM models
nvidia-smi                                  # GPU memory

12. Where to look next

TopicDoc
Running the appQUICKSTART.md
Architecture & portsARCHITECTURE.md
API, agents, retrieval, scanBACKEND.md
Frontend streaming & panelsFRONTEND.md
Pipeline editorPIPELINE_EDITOR.md
TerminologyGLOSSARY.md
Agent Q&AAGENT_KNOWLEDGE_BASE.md

Questions, answered

Short, self-contained answers about this guide.

Ollama isn't running — what do I do?

Start it manually (ollama serve) or relaunch the app, then confirm http://localhost:11434 responds. Retrieval still works without Ollama — only LLM generation (answers, verification, scanning) degrades.

Why is my search returning no results?

Usually the corpus was never ingested — make sure a workspace is selected and 'Ingest all files' has run. Also verify the reranker isn't filtering everything and that the query terms actually exist in the index.

Port 8765 is already in use?

A stale backend from a previous session is still listening. The app kills listeners on 8765 and 5173 at startup; if it still conflicts, kill the leftover process and restart. The doc covers the exact commands.

Setup fails at the venv step?

The launcher falls back to system Python if venv creation fails. The troubleshooting guide walks through each failure mode with its exact fix.