Skip to content
Back

Flow Counsel — AI-Powered Contract Analysis

Doctrine · Fullstack Engineer · May 2024 → Present

~1M€ ARRrevenue generated400daily active users5 000analyses / day9team members

Situation

Doctrine is France's leading legal intelligence platform, used by over 20,000 legal professionals. The company wanted to expand into the contracts space, but had no defined product direction.

I joined a 9-person squad created from scratch to explore this space. As founding engineer, I owned the entire web layer: Next.js frontend, NestJS backend, PostgreSQL database design, and Elasticsearch indexing.

Challenge

The core challenge was twofold: figuring out what to build and how to build it at the same time. Zero product to start, with the real risk of building something nobody would use.

The team's initial hypothesis — contract drafting assistance — turned out to be the wrong problem. We had to pivot quickly while maintaining delivery velocity.

Action

I participated in the user research phase: interviews with legal teams revealed the real pain was contract analysis — identifying risks and inconsistencies — not drafting.

I built the complete web architecture: React/Next.js frontend, NestJS backend API, PostgreSQL database schema, and Elasticsearch integration for full-text search.

I contributed to the RAG (Retrieval-Augmented Generation) pipeline: multi-source retrieval, LLM filtering, semantic reranking with embeddings, and structured output validation via Pydantic.

I designed the migration from synchronous to asynchronous architecture using SQS, Dead Letter Queues, exponential backoff retry, and job status tracking — enabling users to run analyses in parallel.

I separated sensitive documents into a dedicated Amazon Aurora database for compliance requirements, with application-layer soft joins and aggressive caching.

Result

Flow Counsel reached ~€1M ARR with 400 daily active users and 5,000 contract analyses per day.

The product was delivered in ~7 months: from research phase through MVP, beta, and launch. Beta testers reported saving 60% of their time on contract analysis.

The architecture handled production load without major incidents. The Word Add-in became a key product differentiator for enterprise clients.

Artifacts

Complete Next.js frontend with analysis pipeline integration, NestJS backend with SQS/DLQ async architecture, 4-step RAG pipeline, Microsoft Word Add-in (TypeScript + Office.js), dual-database compliance architecture, and full Datadog observability (APM, logs, distributed traces).