AI-Powered Legal Document Review and Analysis Platform

lexbe · Legal · 2024 · source Agentic: no · promotional bias: high · source-backed · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Legal eDiscovery document review

Lexbe needed to let legal teams query and analyze massive litigation document collections without missing critical evidence, while preserving legal confidentiality, scalability, source citations, and production recall quality.

Constraints:

Architecture

Lexbe built Lexbe Pilot as an AI-powered Q&A and reporting assistant inside its eDiscovery platform using Amazon Bedrock Knowledge Bases. Users access the frontend through CloudFront; requests pass through an Application Load Balancer to Fargate backend services. Legal documents live in S3, Apache Tika extracts text into a separate S3 repository, Titan Text v2 creates embeddings, vectors are stored for retrieval, and Amazon OpenSearch indexes document text and metadata in both vector and text modes. Bedrock Knowledge Bases retrieves relevant context, Sonnet 3.5 generates grounded responses, and the frontend returns answers with citations. Lexbe iterated for eight months with AWS, using recall as the production gate and adding reranker technology to reach 90% recall.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  legal-user["legal-user"] --> web-frontend["web-frontend"]
  web-frontend --> cloudfront["cloudfront"]
  cloudfront --> application-load-balancer["application-load-balancer"]
  application-load-balancer --> fargate-backend["fargate-backend"]
  fargate-backend --> bedrock-knowledge-bases["bedrock-knowledge-bases"]
  fargate-backend --> s3-document-bucket["s3-document-bucket"]
  s3-document-bucket --> apache-tika-extractor["apache-tika-extractor"]
  apache-tika-extractor --> s3-text-bucket["s3-text-bucket"]
  s3-text-bucket --> titan-embedding-generator["titan-embedding-generator"]
  titan-embedding-generator --> vector-database["vector-database"]
  vector-database --> bedrock-knowledge-bases
  opensearch-index["opensearch-index"] --> bedrock-knowledge-bases
  bedrock-knowledge-bases --> reranker["reranker"]
  bedrock-knowledge-bases --> sonnet-35-llm["sonnet-35-llm"]
  sonnet-35-llm --> response-renderer["response-renderer"]
  response-renderer --> web-frontend
  recall-evaluation-loop["recall-evaluation-loop"] --> bedrock-knowledge-bases
  recall-evaluation-loop --> reranker
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
legal-user Attorney or legal team member querying a case document set through Lexbe Pilot. web-frontend
web-frontend Browser-facing Lexbe Pilot interface for Q&A, reports, and citations. legal-user, cloudfront, response-renderer
cloudfront Edge routing layer for frontend requests and response delivery. web-frontend, application-load-balancer
application-load-balancer Routes web requests to backend services. cloudfront, fargate-backend
fargate-backend Serverless container backend that handles requests and interacts with RAG components. application-load-balancer, bedrock-knowledge-bases, s3-document-bucket, response-renderer
s3-document-bucket Stores original legal documents for each case. apache-tika-extractor, fargate-backend
apache-tika-extractor Extracts text from legal documents. s3-document-bucket, s3-text-bucket
s3-text-bucket Stores extracted text files used as the source repository for Bedrock. titan-embedding-generator, bedrock-knowledge-bases
titan-embedding-generator Generates document embeddings using Titan Text v2. s3-text-bucket, vector-database
vector-database Stores embeddings for fast semantic retrieval. titan-embedding-generator, bedrock-knowledge-bases
opensearch-index Indexes document text and metadata in vector and text modes for hybrid retrieval. bedrock-knowledge-bases
bedrock-knowledge-bases Managed RAG workflow that ingests documents, retrieves relevant context, and coordinates vector retrieval. fargate-backend, s3-text-bucket, vector-database, opensearch-index, reranker, sonnet-35-llm
reranker Post-retrieval ranking stage that improved recall in the final production iteration. bedrock-knowledge-bases
sonnet-35-llm Generates coherent answers and reports from retrieved legal-document context. bedrock-knowledge-bases, response-renderer
response-renderer Returns answers, findings-of-fact reports, and hyperlinked source citations to users. sonnet-35-llm, web-frontend
recall-evaluation-loop Eight-month evaluation and optimization process using recall rate as the production-readiness benchmark. bedrock-knowledge-bases, reranker, titan-embedding-generator

Data flow

A legal user queries Lexbe Pilot in the web frontend. CloudFront routes the request through an Application Load Balancer to Fargate backend services. Documents stored in S3 are processed by Apache Tika, which extracts text into a separate S3 bucket used by Bedrock. Titan Text v2 generates embeddings, vector storage and OpenSearch provide semantic and keyword retrieval, and Bedrock Knowledge Bases fetches relevant context. Sonnet 3.5 uses the retrieved context to generate a response, findings-of-fact report, or inferential answer with links back to source documents. Recall measurements and reranker experiments guide production readiness.

"A user accesses the frontend application through a web browser.

  1. Request routing: The request is routed through Amazon CloudFront, which connects to the backend through an [Application Load Balancer](https://aws.amazon.com/elasticloadbalancing/application-"
5 supporting quotes
“2. Request routing: The request is routed through Amazon CloudFront, which connects to the backend through an Application Load Balancer.”article, stated
“4. Document handling: Legal documents are stored in an Amazon Simple Storage Service (Amazon S3) bucket, and Apache Tika extracts text from these documents.”article, stated
“The extracted text is processed using Titan Text v2 to generate embeddings.”article, stated
“Amazon Bedrock Knowledge Bases retrieves relevant data from the vector database for a given query.”article, implied
“The Amazon Bedrock Sonnet 3.5 large language model (LLM) processes the retrieved data to generate a coherent and accurate response.”article, stated

Why this architecture

Lexbe needed recall-oriented retrieval over huge document collections, not simple answer generation. Bedrock Knowledge Bases provided a managed RAG workflow, while OpenSearch kept both vector and text search available for legal retrieval. Fargate gave horizontally scalable backend processing without server management. Titan embeddings and token-size tuning were iterated against recall, and reranking was added once retrieval recall became the bottleneck. Source-linked reports and answers fit legal review because attorneys must trace generated claims back to documents.

5 supporting quotes
“Using Amazon Bedrock Knowledge Bases, users can query an entire dataset and retrieve grounded, contextually relevant results.”article, implied
“Both Vector and Text modes are used. This allows Lexbe to quickly locate specific documents or key information across large datasets by vector or by keyword.”article, stated
“* AWS Fargate. Orchestrates the analysis and processing of large-scale workloads in a serverless container environment, allowing Lexbe to scale horizontally without the need to manage underlying server infrastructure.”article, implied
“We focused on Recall Rate because identifying the right documents is critical to getting the correct response.”article, stated
“It produced a polished, five-page report complete with clear section headings and hyperlinks back to every source document”article, stated

Models used: Amazon Bedrock Sonnet 3.5 · Titan Text v2 embeddings · Amazon Titan embeddings · Cohere embeddings · reranker technology · Amazon Bedrock Knowledge Bases

Scale

Alternatives considered (roads not taken)

Traditional keyword search

Rejected because: Keyword search can return hundreds or thousands of documents without the contextual synthesis needed to find hidden critical evidence.

“This approach goes far beyond traditional keyword searches by helping legal teams identify critical or smoking gun documents that could otherwise remain hidden.”article, stated
“keyword searches that previously returned a handful of documents might now produce hundreds or even thousands.”article, stated

Vector retrieval alone

Rejected because: Lexbe used both vector and text modes in OpenSearch, preserving semantic and keyword retrieval paths for large legal datasets.

“Both Vector and Text modes are used. This allows Lexbe to quickly locate specific documents or key information across large datasets by vector or by keyword.”article, stated

Ship the first acceptable-looking RAG prototype

Rejected because: The initial 5% recall was far below production quality, so the team iterated for eight months until recall reached 90%.

“The initial system only had a 5% Recall Rate showing that much work was needed to get to production.”article, stated
“Reranker technology proved invaluable and enabled up to 90% Recall Rate.”article, stated

Evaluate with generic answer satisfaction alone

Rejected because: Legal findings-of-fact reports require many source documents, so recall was the core production-readiness metric.

“We focused on Recall Rate because identifying the right documents is critical to getting the correct response.”article, stated
“we are looking to generate finding-of-facts reports that require a large number of source documents.”article, stated

Manage backend servers directly

Rejected because: AWS Fargate gave Lexbe serverless container scaling for large-scale workloads without managing underlying infrastructure.

“* AWS Fargate. Orchestrates the analysis and processing of large-scale workloads in a serverless container environment, allowing Lexbe to scale horizontally without the need to manage underlying server infrastructure.”article, stated
“allowing Lexbe to scale horizontally without the need to manage underlying server infrastructure.”article, stated

Patterns

rag-retrieval (retrieval)

Lexbe Pilot uses Amazon Bedrock Knowledge Bases to retrieve grounded context from entire legal document datasets before generating answers and reports.

“Using Amazon Bedrock Knowledge Bases, users can query an entire dataset and retrieve grounded, contextually relevant results.”article, stated
“Provides fully managed support for an end-to-end Retrieval-Augmented Generation (RAG) workflow”article, stated

hybrid-search (retrieval)

Amazon OpenSearch indexes document text and metadata in both vector and text modes so legal teams can use semantic and keyword retrieval.

“Both Vector and Text modes are used. This allows Lexbe to quickly locate specific documents or key information across large datasets by vector or by keyword.”article, stated

retrieval-ranking (retrieval)

Reranker technology was added after earlier retrieval improvements and was the step that moved recall to 90%.

“Introduction of Reranker technology proved invaluable and enabled up to 90% Recall Rate.”article, stated

eval-driven-development (evaluation)

Lexbe used recall-rate acceptance criteria over an eight-month iteration cycle to decide when the feature was ready for production.

“Lexbe established clear acceptance criteria focused on achieving specific recall rates.”article, stated
“These metrics served as a benchmark for when the feature was ready for production.”article, stated

context-compaction (context)

Lexbe Pilot distills massive result sets and multilingual document collections into concise answers and multi-page findings-of-fact reports.

“Lexbe Pilot distills these large result sets into concise, meaningful answers”article, stated
“It produced a polished, five-page report complete with clear section headings and hyperlinks back to every source document”article, stated

structured-output-contract (contracts)

The system generates structured findings-of-fact reports with section headings and hyperlinks to source documents.

“It produced a polished, five-page report complete with clear section headings and hyperlinks back to every source document”article, stated

cost-aware-routing (operations)

Lexbe uses ECS/Fargate and Linux Spot Market processing to control production processing costs.

“Cost efficiency. Processing in Amazon ECS Linux Spot Market provides a significant cost advantage.”article, stated

safety-policy-enforcement (safety)

Sensitive legal documents are protected with AWS encryption and role-based access controls.

“The robust security framework of AWS, including encryption and role-based access controls, safeguards sensitive legal documents.”article, stated

Tradeoffs

Use managed Bedrock Knowledge Bases

Chose fully managed RAG workflow over custom end-to-end retrieval and orchestration infrastructure.

Rationale: Knowledge Bases handled ingestion, semantic search, and contextual retrieval while Lexbe optimized recall and integration.

“* Amazon Bedrock Knowledge Bases. Provides fully managed support for an end-to-end Retrieval-Augmented Generation (RAG) workflow, enabling Lexbe to ingest documents, perform semantic searches, and retrieve contextually relevant information.”article, stated
“perform semantic searches, and retrieve contextually relevant information.”article, stated

Optimize for recall

Chose recall-rate acceptance criteria over generic accuracy or answer fluency as the production gate.

Rationale: Legal reports need many supporting documents, and missing evidence is a greater risk than a less polished answer.

“We focused on Recall Rate because identifying the right documents is critical to getting the correct response.”article, stated
“For this reason, we focused on Recall Rate to help ensure that Amazon Bedrock Knowledge Bases was not leaving out important information.”article, stated

Use hybrid vector and text search

Chose OpenSearch vector and text modes over semantic-only or keyword-only retrieval.

Rationale: Legal review benefits from both semantic similarity and exact keyword/document lookup.

“Both Vector and Text modes are used.”article, stated
“quickly locate specific documents or key information across large datasets by vector or by keyword.”article, stated

Add reranking after embedding and token-size tuning

Chose reranker technology in the final iteration over stopping at Titan Embed text-v2's 66% recall.

Rationale: The reranker was the intervention that moved retrieval from partial recall to the reported 90% production target.

“A Recall Rate of 66% was achieved using Titan Embed text-v2 models.”article, stated
“Introduction of Reranker technology proved invaluable and enabled up to 90% Recall Rate.”article, stated

Use serverless container deployment

Chose AWS Fargate and ECS over managing fixed backend servers.

Rationale: Legal workloads vary by case size and deadline, so horizontal scaling and less infrastructure management fit the workload.

“* AWS Fargate. Orchestrates the analysis and processing of large-scale workloads in a serverless container environment, allowing Lexbe to scale horizontally without the need to manage underlying server infrastructure.”article, stated
“Scalability. Using Amazon Elastic Container Service (Amazon ECS) and AWS Fargate, Lexbe can dynamically scale its processing infrastructure.”article, stated

Gotchas (what bit them)

The first RAG implementation was nowhere near production recall.

Root cause: Legal findings-of-fact require retrieving many relevant documents, and the initial configuration only reached 5% recall.

Resolution: Lexbe treated recall as the production gate and iterated through Knowledge Bases features, token-size tuning, Titan Embed text-v2, and reranking.

“The initial system only had a 5% Recall Rate showing that much work was needed to get to production.”article, stated
“the system’s performance underwent five significant milestones, each marking a leap toward production.”article, stated

Keyword search becomes unmanageable at legal-document scale.

Root cause: As cases grow, keyword matches can return hundreds or thousands of documents without ranking the truly important evidence.

Resolution: Lexbe added semantic retrieval, LLM synthesis, and source-linked answer generation over full datasets.

“keyword searches that previously returned a handful of documents might now produce hundreds or even thousands.”article, stated
“distills these large result sets into concise, meaningful answers”article, stated

Legal RAG must prioritize recall over answer elegance.

Root cause: A finding-of-facts report may require a large number of source documents; leaving out an important document changes the legal analysis.

Resolution: The team made recall the acceptance criterion instead of optimizing only generated-answer quality.

“identifying the right documents is critical to getting the correct response.”article, stated
“finding-of-facts reports that require a large number of source documents.”article, stated

Vendor case-study outcomes should be read with context.

Root cause: The post is co-authored by AWS and emphasizes AWS services and benefits; it gives strong recall metrics but broad claims for speed and cost.

Resolution: Use the documented recall progression and architecture as evidence, while treating generalized efficiency claims as promotional.

“This post is co-authored with Karsten Weber and Rosary Wang from Lexbe.”article, stated
“they achieved marked improvements in both retrieval accuracy and processing speed—all while keeping costs under control.”article, implied

Sensitive legal documents require production security controls.

Root cause: eDiscovery data is confidential and may include highly sensitive case material.

Resolution: The system uses AWS security controls, including encryption and role-based access controls.

“safeguards sensitive legal documents. This is critical for Lexbe’s clients, who must adhere to strict confidentiality requirements.”article, stated

Evaluation

Lexbe used recall rate as the primary production-readiness metric over an eight-month collaboration with AWS. The system improved from 5% recall in January 2024 to 36% in April, 60% in June after token-size tuning, 66% in August with Titan Embed text-v2, and up to 90% in December after adding reranking.

Metrics: recall rate · retrieval accuracy · token-size configuration impact · embedding model impact · reranker impact · findings-of-fact source coverage

5 supporting quotes
“Lexbe established clear acceptance criteria focused on achieving specific recall rates.”article, implied
“The initial system only had a 5% Recall Rate showing that much work was needed to get to production.”article, implied
“This brought Recall Rate to 60%.”article, implied
“A Recall Rate of 66% was achieved using Titan Embed text-v2 models.”article, implied
“Reranker technology proved invaluable and enabled up to 90% Recall Rate.”article, implied

Outcomes

The source reports case sets from 100,000 to over one million documents, keyword result sets of hundreds or thousands, an eight-month optimization period, recall milestones of 5%, 36%, 60%, 66%, and up to 90%, a five-page findings-of-fact report, tens of thousands of documents in an inference example, and English/Spanish multilingual handling.

6 supporting quotes
“Lexbe Pilot is an AI-powered Q&A assistant integrated into the Lexbe eDiscovery platform.”article, stated
“users can query an entire dataset and retrieve grounded, contextually relevant results.”article, stated
“Introduction of Reranker technology proved invaluable and enabled up to 90% Recall Rate.”article, stated
“It produced a polished, five-page report complete with clear section headings and hyperlinks back to every source document”article, stated
“In a case of tens of thousands of documents, we asked, “Who is Bob’s son?””article, stated
“regardless of whether those documents were in English, Spanish, or any other language.”article, stated