Add Vaquill as an alternative legal-research provider#1
Open
zriyansh wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 onVAQUILL_API_KEY. Mirrors the shape oflegalData.tsso behavior is predictable.backend/src/index.ts: import,app.use(\"/vaquill\", ...), integration-status line at boot.backend/.env.example: documentedVAQUILL_API_KEYalongsideLEGAL_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:
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)