Skip to content

Add Vaquill as an alternative legal-research provider#1

Open
zriyansh wants to merge 1 commit into
QuanteraAI:mainfrom
zriyansh:add-vaquill-provider
Open

Add Vaquill as an alternative legal-research provider#1
zriyansh wants to merge 1 commit into
QuanteraAI:mainfrom
zriyansh:add-vaquill-provider

Conversation

@zriyansh
Copy link
Copy Markdown

Adds Vaquill as an alternative to LegalDataHunter, with zero impact on existing LDH deployments. Both providers can be enabled simultaneously; the frontend picks which to call.

What this adds

  • backend/src/routes/vaquill.ts: new proxy router, env-gated on VAQUILL_API_KEY. Mirrors the shape of legalData.ts so behavior is predictable.
  • backend/src/index.ts: import, app.use(\"/vaquill\", ...), integration-status line at boot.
  • backend/.env.example: documented VAQUILL_API_KEY alongside LEGAL_DATA_HUNTER_API_KEY, with a comment explaining both can run side by side.
  • README.md: tech stack entry + env-var docs + third-party-keys list updated.

New endpoints

  • POST /vaquill/ask: AI-grounded legal Q&A. Body: `{ question, countryCode?, usState?, mode? }`. Returns a synthesized answer with cited sources.
  • POST /vaquill/statutes/search: hybrid semantic + keyword search across US primary law (Constitution, USC, CFR, Federal Rules, 50-state codes, state constitutions, state court rules, Executive Orders since 2015) and Indian acts. Body: `{ q, corpusType?, state?, titleNumber?, limit? }`.

Why this fits

The LDH integration in `legalData.ts` is already a clean proxy with per-user key support and an env fallback. Adding a second provider in the same shape lets self-hosters pick the corpus that fits their use case:

  • LegalDataHunter is broader on jurisdiction count (178) and oriented around primary-source retrieval.
  • Vaquill is deeper on US primary law (Constitution + Federal Rules + 50-state codes + Executive Orders, refreshed daily) and Indian case law (31M+ judgments), with AI-grounded Q&A and citation-graph traversal.

Users who want both can set both. Users who want neither still get the rest of the app working.

Backwards compatibility

Zero changes to `legalData.ts` or any LDH code path. Existing deployments behave identically. The new route only activates when `VAQUILL_API_KEY` is set.

Follow-ups (out of scope for this PR)

  • Per-user Vaquill key support (mirroring LDH's `user_profiles.legal_data_hunter_api_key` column). Skipped here to keep the PR small; happy to send a follow-up migration if you want it.
  • Frontend wiring of the new routes. The Sources panel isn't yet consuming `/legal-data/*` endpoints in the repo I can see, so wiring is intentionally deferred.

Sits alongside the existing LegalDataHunter integration without touching it. Both providers can be enabled simultaneously; the frontend picks which to call.

New routes:
- POST /vaquill/ask: AI-grounded legal Q&A across US primary law (Constitution, USC, CFR, Federal Rules of Procedure, all 50 state statute codes, state constitutions, state court rules, Executive Orders since 2015) plus Indian case law (31M+ judgments) and citation-graph traversal.
- POST /vaquill/statutes/search: hybrid semantic + keyword search across US primary law (with corpus-type and state filters) and Indian acts.

Wiring:
- backend/src/routes/vaquill.ts: new proxy router, env-gated on VAQUILL_API_KEY.
- backend/src/index.ts: import, app.use(/vaquill), integration-status line.
- backend/.env.example: documented VAQUILL_API_KEY alongside LEGAL_DATA_HUNTER_API_KEY.
- README.md: tech stack + env-var docs + third-party-keys list updated.

Backwards-compatible: zero changes to legalData.ts. Existing LDH deployments keep working unchanged. Operators who want Vaquill add VAQUILL_API_KEY; operators who want both set both.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant