Back to work
OnTract — product screenshot
AI Engineering RAG

OnTract

An AI-powered contract intelligence platform that summarizes contracts, extracts key clauses, and lets teams query documents conversationally. I worked as an AI Engineer on the team that built the underlying AI and backend systems.

View Live App

My Role

AI Engineer

Timeline

Add timeline

Team

7 (6 peers + me)

Skills / Tools

OpenAI API, LangChain, ChromaDB, RAG, Python, AWS, SQL

Overview

Building affordable AI contract intelligence for teams enterprise tools have priced out.

OnTract is an AI-powered contract intelligence platform built for small and mid-sized businesses that need the same contract analysis capabilities as the big enterprise contract management platforms, without the enterprise price tag. As an AI Engineer on a team of 7, I helped build the systems that read, understand, and surface key information from legal documents — from document ingestion through the retrieval pipeline that powers conversational search — reducing the manual work of contract review.

Problem

Enterprise contract intelligence tools price out the businesses that need them most.

The existing players in contract intelligence — tools that summarize agreements, extract clauses, and flag renewal dates — are built and priced for enterprise legal teams. Smaller businesses face the same dense, error-prone contracts, but can't justify that cost, so they're left reviewing everything manually. We built OnTract to close that gap: the same AI-powered contract analysis, at a price a smaller team can actually afford.

Approach

Three systems worked together to turn raw contract text into structured, queryable knowledge.

01

AI-powered contract summarization

Reading a full contract to find a few key terms is slow.

Built AI workflows — running as Supabase Edge Functions — to summarize contracts and extract key clauses like renewal dates, payment terms, and obligations, using OpenAI's GPT-4o to process each document as it's ingested.

02

Conversational, context-aware document search

A single keyword search rarely captures what someone actually needs from a contract.

Integrated LLMs with semantic search and conversational memory using LangChain, supporting multi-turn chat over ingested contracts. Contract text is embedded and stored in ChromaDB, an open-source vector database — a deliberate choice to keep infrastructure costs low while the product proves itself with smaller customers. Every chat interaction is traced through LangSmith for visibility into model behavior and latency.

03

A scalable backend for contract data

AI outputs are only useful if they're stored and retrievable at scale.

Leveraged Supabase's managed Postgres, storage, and edge functions to build a scalable backend for document storage and metadata management, with database migrations and seed data keeping every teammate's environment reproducible.

System Architecture

A modular stack where AI, payments, and observability layer on top of a Supabase core.

The product is a Next.js frontend paired with Supabase for auth, a Postgres database, file storage, and serverless edge functions — the same edge functions that run the AI document-processing pipeline. This keeps AI workloads close to the data without standing up a separate backend service.

Rather than requiring every integration just to run the app, the team designed the stack in layers: the core application (auth, contracts, clients) depends on Supabase alone. Everything else — AI processing, payments, observability, and email invitations — is an optional layer on top, each gated behind its own environment variables and only active when its keys are configured.

Keeping infrastructure costs low was part of the product itself, not just an engineering convenience. For vector storage and semantic retrieval, the team chose ChromaDB, an open-source embedding database, over managed alternatives like Pinecone — avoiding a recurring per-vector hosting cost while OnTract was still validating demand with smaller customers. As usage grows, the plan is to migrate to Pinecone for its managed scaling and faster retrieval at high volume, trading a higher fixed cost for headroom once the user base justifies it.

OnTract system architecture diagram A Next.js frontend connects to a Supabase core (Auth, Postgres, Storage) and Edge Functions, which run the AI processing pipeline. Four optional, environment-gated integrations branch from Edge Functions: OpenAI, LangChain, and ChromaDB for document AI and vector search, LangSmith for tracing, Stripe for billing, and Resend for transactional email. Next.js Frontend UI + routing Supabase Core System of record + access control Auth Postgres Storage Edge Functions AI processing + email jobs OpenAI + LangChain + ChromaDB Summarization, clauses & search LangSmith Tracing & observability Stripe Subscription billing Resend Transactional email Core — always required Optional — env-gated

Core services (solid connectors) are required for the app to run at all. Integrations (dashed connectors) branch off the edge functions layer and only activate once their API keys are configured.

Core Stack

  1. Next.js — frontend application and routing
  2. Supabase (Postgres, Auth, Storage) — the system of record and access control
  3. Edge Functions — serverless compute for AI processing and email jobs

Optional Integrations

  1. OpenAI + LangChain + ChromaDB — document summarization, clause extraction, and conversational chat over vector embeddings stored in ChromaDB
  2. LangSmith — tracing and observability for every LLM call
  3. Stripe — subscription billing across Starter and Pro tiers
  4. Resend — transactional email for team and client invitations

Outcome

A working, lower-cost alternative to enterprise contract intelligence tools.

The result is a platform that gives smaller businesses the same AI-powered summarization, clause extraction, and conversational search as enterprise contract management tools — at a fraction of the cost, largely by choosing infrastructure like ChromaDB that scales down cheaply instead of defaulting to the same managed, enterprise-grade services our competitors run on. Because the retrieval layer isn't hard-coded to one vector store, swapping in Pinecone later as the user base grows is a targeted change rather than a rebuild.

Reflection

Match infrastructure cost to the stage of the business, not just the scale of the technology.

Working on OnTract reinforced that the "best" technical choice depends on context. ChromaDB isn't as fast or as hands-off as a managed service like Pinecone at large scale, but it was the right choice for a product whose entire pitch is affordability for smaller customers. Designing the retrieval layer so ChromaDB could later be swapped for Pinecone, rather than assuming one vector store forever, was a small decision early on that should save real rework as OnTract grows.

Next project: YFCC Health