
π.Law
Engineering Case Study
π.Law represents a production implementation of the Catalyst Platform. It solves the challenge of "Safe Enterprise AI" by decoupling the sensitive legal data layer from the AI reasoning layer using a zero-leakage proxy architecture.
System Design
Next.js Client
User Interface
Security Boundary
FastAPI ProxyAuth & Sanitization
Catalyst Core
RAG & Routing
LLM Provider
Inference Only
Hybrid Search Strategy
Legal discovery requires high precision. We implemented a hybrid retrieval strategy directly in Postgres:
- Semantic Search: Uses
pgvectorfor conceptual matching (cosine similarity). - Keyword Fallback: Traditional SQL text search for exact case citations.
- Infrastructure: No separate vector DB (Pinecone/Weaviate) required—reducing operational complexity.
Zero-Leakage Architecture
The frontend never touches the Catalyst API directly. A dedicated backend proxy injects the X-Tenant-Id and strips sensitive metadata.
- Hard Isolation: API keys are strictly scoped to tenants.
- Redaction: PII is detected and redacted before hitting the LLM logs.
- Observability: Every request carries a distributed trace ID for cross-service debugging.
Tech Stack
Next.js 16 (App Router)FastAPIPostgres + pgvectorDocker ComposeTailwind + shadcn/uiReact QueryAlembic