← Back to Blog
Product Updates
Hybrid Search + Guardrails: How Legal Teams Tamed AI in 2024
Zedly AI Editorial Team
November 18, 2024
9 min read
The gap between "close enough" and "exactly right" is where legal malpractice lives. When an associate searches a document repository for a specific case citation or contract clause, a near-miss is worse than no result at all. It creates false confidence. Throughout 2024, legal operations teams told us the same thing: general-purpose AI search was not cutting it. Semantic similarity alone missed exact docket numbers, conflated opposing motions, and returned results that looked plausible but cited the wrong authority.
We spent the year rebuilding our retrieval engine from the ground up for legal precision. The result is a hybrid search system paired with organization-level guardrails that give legal teams the accuracy they need and the cost controls their managing partners demand. For firms where the primary concern is data privacy and bar compliance rather than search architecture, see our companion piece on Private AI for Law Firms.
Why Pure Vector Search Falls Short in Legal Work
Vector search works by converting text into numerical representations (embeddings) and finding passages with similar meaning. For most knowledge work, this is transformative. Ask a vague question, get a conceptually relevant answer. But legal work is not most knowledge work.
Legal documents are full of alphanumeric identifiers that carry enormous weight: case numbers like 2:24-cv-01387, CFR citations like 17 CFR 240.10b-5, UCC sections, patent numbers, and named parties. These identifiers embed poorly. To a general-purpose vector model, "Smith v. Jones, 555 U.S. 123 (2024)" and "Johnson v. Williams, 548 U.S. 456 (2023)" look nearly identical because they share the same structural pattern. But they are entirely different authorities with different holdings.
Worse, semantic similarity can actively mislead. A vector search for "motion to compel production of documents" will happily return passages about "motion to dismiss for failure to state a claim" because both are motions filed in civil litigation. An associate relying on those results might cite the wrong procedural standard in a brief.
The core problem: Embedding models optimize for meaning similarity. Legal work demands both meaning similarity and exact-match precision. A retrieval system that sacrifices one for the other is not safe for legal use.
Hybrid Search: Vector Similarity Meets Keyword Precision
Zedly's hybrid search engine runs two retrieval paths in parallel for every query:
- Vector search finds passages that are semantically related to the query, even when phrasing differs. Ask about "landlord's right to terminate early" and it surfaces clauses titled "Owner's Option to Cancel" because it understands the concepts are equivalent.
- Keyword search (BM25) finds passages containing exact terms. Search for "17 CFR 240.10b-5" and every document containing that precise string surfaces, regardless of how the surrounding text is phrased.
Results from both paths are merged using reciprocal rank fusion, a scoring method that combines rankings from multiple retrieval systems without requiring them to produce comparable scores. A passage that ranks highly in both vector and keyword results rises to the top. A passage that scores well on exact match but poorly on semantic relevance (or vice versa) still surfaces, but at an appropriate position.
What This Looks Like in Practice
An attorney searching a discovery set for references to a specific SEC filing enters: "10b-5 disclosure obligations quarterly report Q3 2023"
The keyword path surfaces every document mentioning "10b-5" exactly, including exhibits, correspondence, and internal memos that reference the regulation by its alphanumeric code. The vector path surfaces passages discussing securities disclosure obligations, materiality standards, and quarterly reporting requirements, even in documents that never use the "10b-5" shorthand.
The fused result set gives the attorney both: the exact regulatory references and the broader context around disclosure practices. No second search required.
Legal-Tuned Embeddings
Hybrid search solves the retrieval architecture problem, but the quality of vector results still depends on the embedding model. General-purpose embeddings treat legal text like any other English prose. They miss the domain-specific relationships that legal professionals rely on.
Voyage-law-2 is an embedding model trained specifically on case law, contracts, regulatory filings, and legal correspondence. It understands that "indemnification" and "hold harmless" are near-synonyms in contract drafting, that "force majeure" relates to "impossibility of performance," and that "motion to compel" and "motion to dismiss" are categorically different procedural tools despite superficial similarity.
Zedly auto-detects document types during ingestion. Legal documents, contracts, court filings, and regulatory materials are routed through Voyage-law-2 automatically. General business documents, correspondence, and other file types use Voyage-3 for broad coverage. Teams never configure embedding models or think about which pipeline processes their files.
Why auto-detection matters: A single matter often contains a mix of legal filings, business correspondence, financial spreadsheets, and technical reports. Routing each document type to the optimal embedding model means search quality stays high across the entire corpus, not just the purely legal documents.
Organization-Level Guardrails
Search accuracy means nothing if the platform's usage is unpredictable, unauditable, or uncontrollable. Legal teams operate under strict budgets and compliance requirements. When we asked law firms what held them back from adopting AI document tools, the answer was rarely "the technology isn't good enough." It was "we can't control how people use it."
Zedly's guardrails address this directly:
- Shared storage pools. Each organization gets a configurable storage allocation. Document storage is pooled across the firm, with visibility into consumption by practice group, matter, or individual user.
- Per-seat Active Desk budgets. The Active Desk, where documents are loaded for analysis, has configurable capacity limits per user. This prevents any single user from consuming disproportionate resources.
- Ingestion quotas. Large uploads (depositions, data room dumps, bulk discovery) require approval before processing begins. A first-year associate cannot accidentally ingest 30 GB of raw discovery overnight and blow through the firm's monthly compute budget.
- Rate limits. Query and API usage are rate-limited at both the user and organization level, protecting against runaway automation and ensuring fair access across the firm.
- Usage dashboards. Managing partners and IT administrators see real-time dashboards showing storage consumption, query volume, ingestion activity, and cost projections. No surprises at the end of the month.
These controls exist because law firms handle the most sensitive data on earth and need governance that matches. Guardrails are not restrictions. They are what make it safe to give every attorney in the firm access to AI-powered document intelligence.
Chain-of-Custody Metadata and Defensible Citations
Legal AI cannot operate in a black box. When an attorney cites a passage in a brief, the source must be verifiable. When a compliance team presents findings to a regulator, the audit trail must be complete. When a partner reviews an associate's work product, the provenance of every fact must be traceable.
Zedly maintains chain-of-custody metadata from the moment a document is ingested:
- Ingestion metadata: When the document was uploaded, by whom, file hash, original filename, and source location.
- Processing metadata: OCR confidence scores, chunking boundaries, embedding model used, and index timestamps.
- Retrieval metadata: Every query is logged with the user, timestamp, retrieved passages, relevance scores, and the final response generated.
- Citation format: Every answer cites the exact source document and page number. Passages are linked back to the original file so attorneys can verify context with one click.
Results export to exhibit-ready formats. When a paralegal prepares a privilege log or an associate compiles exhibits for a motion, the AI-retrieved passages carry their provenance with them. No manual re-verification of where a quote came from. For a practical guide on citation formats and how to verify AI-generated clause references, see how to cite a clause in a contract.
From Discovery to Due Diligence
Hybrid search and guardrails are not theoretical. Legal teams are using them across the full spectrum of legal work:
- Document review and discovery. Search thousands of documents for specific terms, concepts, or patterns. Hybrid search ensures that exact identifiers (Bates numbers, exhibit references, party names) surface alongside conceptually relevant passages.
- Contract analysis. Upload a portfolio of contracts and search for specific clause types, obligations, or risk factors. Legal-tuned embeddings understand that "limitation of liability" and "cap on damages" describe the same concept.
- M&A due diligence. Load a data room into the Active Desk and surface red flags in hours instead of weeks. Ingestion quotas ensure the data room upload is approved before processing begins, and usage dashboards track the cost of the review in real time.
- Regulatory compliance. Search internal policies and correspondence against regulatory requirements. The keyword path catches exact regulation numbers while the vector path finds discussions about compliance intent and implementation.
- Precedent research. Build a searchable library of the firm's own work product, briefs, memos, opinions, and search it for relevant authority or language. Every result cites the original document so attorneys can assess applicability in context.
For firms that require complete network isolation for sensitive matters, on-premise deployment with local LLM inference eliminates all external data transmission while preserving hybrid search and guardrail functionality.
What Changed in 2024
A year ago, legal teams were experimenting with AI document tools cautiously, often limited to a single practice group or a low-stakes pilot. The concerns were consistent: accuracy wasn't good enough for citation-heavy work, costs were unpredictable, and there was no way to enforce firm-wide usage policies.
Hybrid search addresses the accuracy gap. Legal-tuned embeddings close the domain expertise gap. Organization-level guardrails solve the governance gap. Together, they moved AI document intelligence from "interesting experiment" to "standard infrastructure" at firms that adopted them.
The firms that deployed private AI early are now seeing compounding returns: larger document libraries mean better search results, established usage patterns mean predictable costs, and institutional knowledge captured in the system makes every attorney more effective.
Frequently Asked Questions
What is hybrid search in AI document retrieval?
Hybrid search combines two retrieval methods: vector similarity search, which finds semantically related passages based on meaning, and keyword search (BM25), which finds exact text matches. Results from both methods are merged using reciprocal rank fusion. This ensures that conceptually relevant passages surface alongside exact matches for case numbers, statute citations, and named parties, giving legal teams both precision and recall in a single query.
Why do legal teams need legal-tuned embeddings?
General-purpose embedding models often conflate legal terms that look similar but carry opposite meanings, such as "motion to compel" and "motion to dismiss." Legal-tuned embeddings like Voyage-law-2 are trained on case law, contracts, and regulatory filings, so they understand the semantic distinctions that matter in legal work. This reduces irrelevant results and surfaces the right precedent faster.
What guardrails does Zedly offer for law firm AI usage?
Zedly provides organization-level controls including shared storage pools with configurable limits, per-seat Active Desk budgets, ingestion quotas that prevent unauthorized bulk uploads, rate limits on API and query usage, and real-time usage dashboards. Managing partners can set limits per practice group and approve large ingestion jobs before they run, keeping costs predictable and usage auditable.
Can hybrid search handle large discovery sets?
Yes. Zedly's hybrid search engine is designed for high-volume legal work. Documents are chunked, embedded, and indexed during ingestion so that queries against thousands of documents return results in seconds. The system handles multi-hundred-page depositions, large contract sets, and full M&A data rooms without degradation in search quality or response time.
How does Zedly ensure citation accuracy in legal AI responses?
Every answer generated by Zedly cites the exact source document and page number. The system maintains chain-of-custody metadata from ingestion through retrieval, and all cited passages can be verified against the original document. Results export cleanly to exhibit-ready formats, and audit logs record every query, retrieval, and response for compliance review.
Looking for enterprise-grade legal AI?
Zedly AI is built for law firms, in-house counsel, and deal teams — with clause extraction, cross-contract search, and deployment options from cloud to air-gapped. Explore Legal AI →
Ready to See Hybrid Search in Action?
Upload a set of legal documents and run the same search you would on your current platform. See the difference that hybrid retrieval, legal-tuned embeddings, and defensible citations make in practice.
Request a Legal Demo
Comparing enterprise AI platforms?
See a detailed breakdown of deployment, compliance, pricing, and document features.
Ready to get started?
Private-by-design document analysis with strict retention controls.