Inspiration
Legal firms manage large volumes of case files, briefs, and supporting documents across different systems. Finding the right document or passage can be slow, while generic AI tools may generate answers without reliable references to the firm's own files.
That inspired LexGeni — a legal AI workspace built on Google Cloud where lawyers can search their firm's knowledge, get grounded answers with verifiable citations, protect sensitive information, and use dedicated AI agents for legal workflows.
Live Demo: LexGeni Frontend Username: demolawyer1@cloudedgetechy.com Password: KWHuGE8gNmNV8dT=12
What it does
LexGeni is a legal AI workspace that combines AI-powered search, chat, agents, privacy, and analytics in one platform.
For Lawyers — Search, Chat & Privacy
- Agent Search across a firm's document corpus using Vertex AI Agent Search.
- Four isolated GCS buckets separating indexed documents, raw PII, protected PII/vault data, and chat uploads.
- DLP privacy pipeline that identifies and cleans sensitive information before it becomes searchable.
- Privacy-aware chat that provides appropriate notices when users request sensitive identifiers.
- Chat interface with source and citation controls.
- PDF upload in chat for instant document analysis using Gemini and the Google GenAI SDK without adding the uploaded document to the firm's permanent search index.
- Citation viewer allowing lawyers to open the original firm document or cleaned text and verify the generated answer.
- Matters in the sidebar so lawyers can group multiple chats under a specific matter.
- Edit prior query after a response — update the question and regenerate the answer from that point.
- Conversation history stored securely in Firestore.
- Identity-Aware Proxy (IAP) protecting the deployed application.
For Lawyers — AI Agents
LexGeni includes an Agents Gallery designed for task-specific legal workflows.
The first production-ready agent is the Argument Drafting Agent, built with the Google Agent Development Kit (ADK).
Workflow:
Issue → Posture → Docket → Agent Search → Outline → Draft → Review
- Vertex AI Agent Search retrieves relevant passages from firm briefs for evidence grounding.
- An ADK
SequentialAgentruns three Gemini steps: Outline → Draft → Review. - Gemini generation uses the Google GenAI SDK; multi-step agent orchestration uses Google ADK.
- The agent produces drafts with inline citations grounded in the firm's available knowledge.
- Past agent runs are stored in Firestore, allowing lawyers to revisit previous work.
Additional agents are planned, including:
- Brief Research Agent
- Opposing Brief Analyzer
- Legal Research Memo Agent
For Leaders — Analytics
LexGeni also provides a separate analytics experience for firm leaders.
- Batch extraction of structured information from formal briefs.
- Cloud Run Job:
lexgeni-extract-job - Gemini + Google GenAI SDK for document extraction.
- Structured results stored in BigQuery.
- Looker Studio dashboards for business and document-level insights.
- Analytics is separated from the lawyer-facing search and chat experience.
Technology Stack
Frontend: Next.js on Cloud Run
Backend: FastAPI on Cloud Run
Agent orchestration: Google ADK (SequentialAgent for Argument Drafting)
AI: Gemini via Google GenAI SDK / Vertex AI
Search: Vertex AI Agent Search
Storage: Google Cloud Storage
Database: Firestore
Analytics: BigQuery + Looker Studio
Privacy: Sensitive Data Protection / DLP
Authentication & Security: Identity-Aware Proxy
Google frameworks used: Google ADK (Argument Drafting agent), Google GenAI SDK (chat, agent LLM steps, analytics extraction), Vertex AI Agent Search (grounded retrieval)
How we built it
- Designed a four-bucket storage architecture with explicit rules defining what can and cannot be indexed.
- Configured Vertex AI Agent Search with multiple data stores and a blended search experience.
- Built the application using Next.js and FastAPI, deployed on Cloud Run.
- Connected grounded retrieval with Agent Search and generation using Gemini through the Google GenAI SDK.
- Built the Agents Gallery and Argument Drafting Agent using Google ADK — an ADK
SequentialAgentfor outline → draft → review, with Agent Search supplying evidence. - Implemented the DLP privacy pipeline to clean sensitive information before indexing.
- Added privacy-aware responses and protected storage for sensitive data.
- Built the analytics extraction pipeline using Cloud Run Jobs, Gemini, and BigQuery.
- Connected analytics to Looker Studio for leadership dashboards.
- Added matters (group chats by matter) and edit-and-regenerate for prior user queries.
- Secured the live application using Identity-Aware Proxy (IAP).
Challenges we ran into
- Meeting the requirement to use the Google agent framework (ADK) and Google GenAI SDK across chat, agents, and analytics.
- Wiring ADK SequentialAgent steps with Agent Search evidence without breaking grounding or citation quality.
- Designing a search architecture that could combine multiple data sources while ensuring raw PII never entered the searchable index.
- Mapping search results and chunks into a useful citation experience that lawyers can verify.
- Designing a legal drafting workflow that is more useful than a generic chatbot.
- Making long AI-generated legal drafts easy to review and navigate.
- Managing authentication and application routing between IAP, Cloud Run, Next.js, and FastAPI.
- Building search, chat, agents, privacy, analytics, and dashboards into a cohesive product experience within a short demo.
Accomplishments that we're proud of
- Built a complete legal AI workspace on Google Cloud, rather than just a chatbot.
- Delivered grounded AI answers with clickable citations to firm documents.
- Built a dedicated Argument Drafting Agent on Google ADK (
SequentialAgent: outline → draft → review) with persistent past runs. - Implemented DLP-based sensitive-data isolation across multiple storage layers.
- Added a separate analytics platform for legal leaders using Gemini, BigQuery, and Looker Studio.
- Deployed the complete application on Cloud Run and secured it with IAP.
- Used the Google GenAI SDK consistently across chat, agents, and analytics extraction.
- Shipped practical lawyer UX: matters, edit prior query, and reopen past agent runs.
What we learned
- Grounding builds trust. Legal professionals need to verify where an AI answer came from, not simply receive a generated response.
- Data architecture is part of the product. Separating firm documents, sensitive information, cleaned content, and temporary chat uploads is critical for privacy.
- ADK fits real legal workflows. Multi-step agents (outline → draft → review) are clearer and more reliable than one long free-form chat prompt.
- Agents need purpose-built experiences. A drafting workflow is more effective when the user is guided through specific inputs and review steps rather than relying on one long chat.
- Citations are essential for legal AI. A useful answer should make it easy to go back to the underlying source.
- Official AI SDKs and frameworks simplify development. The Google GenAI SDK and Google ADK provided a consistent approach for Gemini-powered chat, agents, and document extraction.
- Different users need different experiences. Lawyers need search and drafting tools, while firm leaders need analytics and higher-level insights.
What's next for LexGeni - Search, Agents & Analytics
Search
- Improve search relevance and citation accuracy.
- Add stronger document-level and passage-level grounding checks.
- Expand enterprise data connectors, including SharePoint.
- Improve search across larger and more diverse legal knowledge bases.
Agents
- Brief Research Agent (ADK)
- Opposing Brief Analyzer (ADK)
- Legal Research Memo Agent (ADK)
- More specialized agents for litigation and document workflows.
- Better agent evaluation, review, and citation validation.
Analytics
- More leadership dashboards.
- Matter-level insights and document intelligence.
- Trend analysis across briefs and cases.
- Automated extraction of additional legal and business metadata.
The long-term vision for LexGeni is to bring Search, Agents, and Analytics together into a secure legal AI workspace where lawyers can find information faster, create better work, and make decisions using trusted data from their own organization.
Log in or sign up for Devpost to join the conversation.