# LegalAgent

Canonical: https://gaboesquivel.com/project/legal-agent

A voice and chat AI assistant for legal professionals, combining case retrieval, document intelligence, and bilingual interactions.

**Role:** Software Engineer
**Employment:** 2025 (Software Engineer, LegalAgent)
**Types:** ai, contract, featured, mobile, backend, fullstack, startup
**Technologies:** TypeScript, React Native, Expo, OpenAI, AI SDK, TanStack Query, TanStack Form, TanStack Start, Tailwind, Artificial Intelligence, Redis, PostgreSQL, React

## Story

I built the voice and chat assistant inside LegalAgent's React Native application, helping attorneys retrieve case information, summarize documents, and navigate procedural questions in English and Spanish.
Chat runs through the Vercel AI SDK, while voice uses OpenAI's Realtime API for live transcription and speech synthesis. I connected both experiences to retrieval-augmented generation (RAG) and refined the assistant's persona and tool-calling behavior using feedback from attorney sessions.
I also developed an internal administration dashboard with TanStack Start, Microsoft SSO, system prompt management, and document categorization. It gave the team a way to manage the knowledge and behavior behind the assistant without changing application code.

## Achievements

- Shipped a voice and chat assistant in a React Native Expo application using the Vercel AI SDK and OpenAI Realtime API.
- Implemented RAG for case context, document summaries, and procedural guidance.
- Delivered bilingual voice interactions with real-time transcription and speech synthesis.
- Built a TanStack Start admin dashboard with Microsoft SSO, system prompt management, and document categorization.
- Refined the assistant's persona and tool-calling behavior based on attorney feedback.

## Related writing

- [Why I Still Use Expo](https://gaboesquivel.com/blog/2025-09-why-expo) (2025-10-01)
- [RAG with TypeScript](https://gaboesquivel.com/blog/2025-05-typescript-rag) (2025-06-02)