nwhitehouse/mike
Olava/Qwen3 legal assistant with vision mode, research orchestration, and tabular document review
nwhitehouse/mike is the most heavily modified fork tracked here. The core work centers on integrating Olava-001 (a vLLM-hosted Qwen3-VL model) as a drop-in LLM provider alongside Claude and Gemini, then building out capabilities specific to that model: Qwen3 reasoning controls, vision mode for PDF document analysis, and a streaming citation UI.
Beyond the Olava integration, nwhitehouse has shipped substantial product work: a multi-pass research orchestrator (feat-005), a structured agent events audit log (feat-015), in-chat memory that persists tool calls and results across turns (feat-017), tabular document review with pgvector RAG, column management, filtering, and a durable job queue for tabular generation. Legal-specific tools include a legal database search tool with a Files-and-Sources picker, Brave web search integration, and a tabular cell citation system.
Infrastructure work includes auth/RLS hardening, dark mode with semantic token migration, a full Finch-to-Olava rebrand, and a loop controller that bounds tool dispatches per turn (feat-014).
What's in it
- Tabular review, end to end Run one question across thousands of documents, mark cells verified, filter to what still needs eyes, hide or rerun columns, and drill into any single document without losing your place in the table.
- Citations you can actually click Extracted table cells and inline chat references jump straight to the exact page and phrase in the source PDF - and attachment chips in user messages open the doc too.
- Self-hosted reasoning model Olava is wired in as the fork's single AI engine: a self-hosted Qwen-class model with live streaming, tool-call recovery, and user-controllable thinking depth.
- Five-pass research orchestrator Tick a legal database or the web as a source and a multi-pass research engine kicks in automatically, with bounded tool dispatches so the assistant can't spin its wheels.
- Live legal and web sources Opt-in tools pull from four open US federal legal sources and from Brave web search, surfaced as clickable result cards in the chat.
- Vision-mode PDF reading Uploaded PDFs are shown to the model as page images rather than extracted text, pre-loaded the moment the file lands.
- Built to be hosted Dark mode on semantic tokens, a structured audit log of every AI turn, a deployment-grade README, persistent chat history, and a security hardening pass - all the plumbing of a real product.
Direction
discoverychat-uibranding
Activity
Show 8 more
Threads of work (detailed view)
nwhitehouse teaches Mike's table review to read the whole document
The grid-style review tool can now answer questions that no column was built to capture.
RAG over tabular-review documents via pgvector and OpenAI embeddings
nwhitehouse added end-to-end RAG on top of the tabular review: every uploaded document gets chunked and embedded via a new job type on the existing worker pool, chunks land in a `document_chunks` table with a pgvector HNSW index, and the TR chat retrieves top-K passages and injects them into the system prompt. Four commits over roughly an hour show what actually goes wrong when you run this on real PDFs.
nwhitehouse puts its Mike fork into production, and bolts the door behind it
The interesting part isn't the deployment grind - it's who's allowed to sign up.
Launch-week hosting ops: CORS, Nixpacks, lockfile drift, email domain gate
A cluster of small production-wiring commits from nwhitehouse's launch week. Mostly Vercel + Railway + Supabase-specific fixes, with two reusable patterns: a multi-origin CORS function and a DB-enforced email domain whitelist.
nwhitehouse makes the AI show its work, cell by cell
Every extracted answer now ships with one-click jumps to the exact passage behind it, plus search terms to find that passage fast.
Citation chips and keyword chips in the tabular cell side-panel
nwhitehouse extended the tabular cell detail view with two chip types: citation chips that jump the doc viewer to the cited page, and keyword chips that drive the doc-search input. Four commits landed over a day, with three of them fixing issues found from running the feature on real data.
nwhitehouse turns tabular review into a cell-by-cell sign-off
A reviewer can now mark each extracted value as checked, and the system remembers who signed it off and when.
Tabular review filtering by flag, verified state, and per-column text
nwhitehouse added a filter bar above the tabular review table that lets reviewers narrow rows by flag color, whether a cell has been manually verified, and per-column text predicates. The filter logic is pure and unit-tested; four commits address UX issues - mostly popover rendering against a sticky-column z-index stack - found through smoke testing.
nwhitehouse gives tabular review real column controls
Reviewers can now hide, re-run, and delete individual columns in the grid instead of living with whatever they started with.
Tabular column management: hide, reprocess per-column, delete with confirm
nwhitehouse added the column-level actions that become necessary once a tabular review has more than a handful of columns: per-column reprocess, delete with a confirmation modal that names the column and counts cells, and per-device localStorage-backed column visibility. Three commits, with two of them relocating the manage-columns UI after user feedback.
nwhitehouse gives Mike a dark mode and a coat of paint that lasts
A frontend-wide colour overhaul ships a light/dark/system theme picker - and quietly makes the fork much cheaper to build on.
Dark mode via semantic-token migration across 74 frontend files
nwhitehouse added light/dark/system theme support. The bulk of the diff isn't adding `dark:` Tailwind variants; it's migrating raw color classes to the semantic tokens that were already defined in `globals.css`, which made both modes work at once.
nwhitehouse makes thousand-document reviews survive a closed laptop
The fork rebuilds its bulk document-review engine so a long run no longer dies when a tab closes, a connection times out, or the server restarts.
Tabular generate replaced with a durable job queue and worker pool
The biggest structural change in the tabular review subsystem: +1650/-475 in a single commit, swapping the SSE-streaming generate handler for a jobs table with leased worker claims. The author's stated target is 5K-10K-document reviews; the proximate problem was that proxy idle timeouts, tab closes, and backend restarts all killed runs with no recovery path.
nwhitehouse puts the AI's reasoning on a dial
The model's chain-of-thought is now tucked behind a click, and teams can turn the deliberation down when it isn't earning its keep.
Qwen3 thinking mode gets env-var controls and a collapsed UI
nwhitehouse adds three env vars to gate Qwen3's reasoning budget and reworks the frontend thinking card so it collapses by default. The per-helper opt-out pattern - passing `enableThinking: false` on small single-purpose calls - is the most portable piece.
nwhitehouse puts a leash on the assistant's tool-calling
A new guardrail stops the AI from spinning in circles when a tool keeps failing, and steers it toward an answer instead of a timeout.
LoopController: escalate on step count, repeated calls, or wall-clock timeout
nwhitehouse added a 138-line controller that wraps the tool-dispatch callback in `runLLMStream` and escalates when the agent loop runs too long, repeats the same call three times, or passes 60 seconds of wall-clock time.
nwhitehouse gives every agent turn a paper trail
Mike's agent now keeps a structured record of what it did on each turn - built so the log never becomes a second pile of sensitive data.
Structured agent_events audit log replaces 60+ scattered console.log calls
nwhitehouse replaced the only debug trail for agent activity - scattered `console.log` calls across `chatTools.ts` and `llm/olava.ts` - with an append-only `agent_events` table. The fire-and-forget write pattern and the metadata-only payload rule are worth stealing if your fork has any multi-step agent flow you need to diagnose after the fact.
nwhitehouse stops Mike's chatbot from forgetting what it just read
A fix so the legal assistant remembers the documents it pulled instead of re-reading them from scratch every single turn.
In-chat memory: persist tool calls and results so the model stops re-reading every document
nwhitehouse fixed the root cause of "the model forgets what it read last turn." Tool calls and results are now persisted to `chat_messages` and replayed to the LLM on every subsequent turn, using the OpenAI canonical `tool_calls`/`tool_call_id` pairing that Olava already speaks.
nwhitehouse gives Olava eyes for the whole document
nwhitehouse's fork now lets its AI assistant look at PDFs as images, not just scrape the text out of them.
Vision mode: PDF pages sent as images to Olava, with tiered caching and upload-time prerender
nwhitehouse builds an eight-commit arc that renders PDF pages to PNG and splices them into the last user message as image content blocks for Qwen3-VL. The biggest lesson buried in the diff: pdfjs + node-canvas produces blank pages on this stack; the fix is `pdftoppm` from poppler-utils.
nwhitehouse makes attachment chips actually open the document
Those little file tags on chat messages used to be pure decoration - now they're a one-click route to the document itself.
Attachment chips in user messages now open the doc viewer
nwhitehouse fixes a silent UX gap: the filename chips shown next to a user prompt were display-only. Two commits make them clickable when a `document_id` is present, with the second commit catching a missed render path.
nwhitehouse tried live citations, then backed out
An experiment to make source citations appear as the AI writes its answer didn't survive contact with the model.
add_citation tool experiment tried and parked; hover popover and rescroll fix kept
nwhitehouse tried replacing the freeform `<CITATIONS>` JSON block with an explicit `add_citation` tool call. The model wrote the inline markers but skipped the tool calls entirely. The UI fixes from the same commit are worth taking; the tool path is not.
nwhitehouse fixes the greeting that ignored your name
A small change so the app stops greeting users by their email prefix when they've actually set a display name.
nwhitehouse rebuilds legal research as a five-stage pipeline
Instead of one lookup and an answer, nwhitehouse's fork now runs a structured research loop across legal and web sources, automatically.
Five-pass research pipeline for a small reasoning model
nwhitehouse built a full multi-step research orchestrator on top of the Olava-001 vLLM endpoint - query expansion, parallel search fan-out, triage, per-result extraction, and streaming synthesis, all coordinated by a 302-line pipeline with hard caps of 25 Olava calls and 45 seconds wall-clock. Tested end-to-end against real CourtListener data, it produced a 2KB synthesis with inline citations where the single-pass path emitted only whitespace.
nwhitehouse pulls search results out of the activity log and into the answer
When the model returns sources but little prose, the sources now show up as the answer instead of hiding behind a 'completed in steps' toggle.
Search result cards rendered inline, then rescued from the collapsible wrapper
feat-004 makes every `legal_search` and `web_search` result visible as a clickable card in the assistant message regardless of whether Olava synthesizes anything useful. bug-003, 45 minutes later, fixes the UX failure where those cards landed inside the collapsible "Completed in N steps" wrapper and were invisible by default.
nwhitehouse bolts web search onto Mike's chat
A toggle in the chat box now lets Mike reach the live web, not just your document set.
Brave web-search tool with per-message globe toggle
nwhitehouse added a `web_search` tool backed by the Brave Search API. It's a binary toggle per message, hard-gated so the tool never appears in the schema when the user hasn't enabled it.
nwhitehouse keeps the assistant streaming while it reaches for tools
Tool-using turns used to go silent and slow; now the answer keeps flowing in real time, with a safety net for when the model misbehaves.
Olava streaming restored, then corrected after live endpoint testing
Two commits, same day, in opposite directions. feat-001 restores streaming during tool-using turns by adding a state machine that hides `<think>` blocks and `<tool_call>` markup from the user-visible stream while keeping the raw buffer intact for the custom parser. bug-002 then discovers that on the actual RunPod endpoint the markup never lands in `delta.content` at all - vLLM just drops it - and pivots to re-issuing the first iter as a non-streaming request to recover the tool call.
nwhitehouse catches the chat that was quietly forgetting everything
Every message a user typed looked saved but was being silently thrown away before it ever hit the database.
Silent data loss: user messages were never persisted due to a nonexistent column
Every user message in nwhitehouse's fork was silently dropped on write. The insert referenced a `workflow` column that doesn't exist in the schema; Supabase returned PGRST204 and the app never checked the result.
nwhitehouse plugs Mike into four federal legal databases
Mike's chat can now search court opinions, statutes, and federal rules directly - but only when you tell it to.
Legal database search tool with Files-and-Sources per-message picker
nwhitehouse added a `legal_search` tool fanning out across four open U.S. legal databases, hard-gated behind a per-message source picker in the chat input. When no sources are selected, the tool isn't in the schema at all.
nwhitehouse walls off tenant data, top to bottom
A sweeping security pass adds database-level isolation so one client's matters can't leak into another's.
Auth hardening: RLS migration, server-side security middleware, and HTML sanitization
nwhitehouse ran a broad security pass across 36 files, shipping a 451-line RLS migration, server-side HTTP security middleware, download-token tightening, and frontend HTML sanitization for assistant message rendering. This is the kind of sweep you do once you've decided the fork is hosting real user data.
377-line operations and architecture README for the Olava deployment
Replaces three lines with a full handoff document covering the production topology, all env vars, vLLM specifics, and operational gotchas. If you're evaluating what nwhitehouse actually built and how it runs, this is the single best artifact in the fork.
nwhitehouse bets the whole fork on one house model
No model picker, no API keys, no choice - every user now talks to a single in-house assistant called Olava.
Olava-only lockdown: Anthropic and Gemini stripped from model picker
A -283/+99 commit across 22 files that commits the fork to a single-provider product. The model picker now shows only "Olava-001", the API-key entry UI is gone entirely, all defaults route to `olava-extract`, and the LLM router coerces any non-Olava model ID (from stale localStorage or DB rows) back to the default at the server layer.
nwhitehouse wires Mike up to a self-hosted AI option
A third AI engine that runs on your own hardware, not someone else's cloud - plus a fix for garbled bold text in generated Word docs.
Third LLM provider: Olava (vLLM/Qwen LoRA) wired into the router
nwhitehouse added a vLLM-backed "Olava" provider - an OpenAI-compatible endpoint serving a Qwen3-based reasoning LoRA - alongside the existing Anthropic and Gemini paths. The interesting part is not the provider addition itself but the scaffolding built to make a small reasoning model behave: think-block stripping, a 16384-token floor, a custom tool-call parser for non-standard LoRA markup, and a tool-stripping default that prevents 400s on vLLM servers without `--enable-auto-tool-choice`.
nwhitehouse lets reviewers overrule the AI without starting over
A new manual edit path means a single wrong extraction no longer forces you to re-run the whole tabular review.
Finch rebrand and tabular doc-detail drill-in view
One commit doing two unrelated things: a string-level rename of the product from Mike to Finch, and a 675-line three-pane doc-detail view for tabular review drill-in with inline cell editing and in-document search.
Pull requests (detailed view)
🟢 Open (1)
vercel[bot] · opened 3mo ago