# Harvard NeuroLaw Library Engineering

**Completed:** 2024

**Scope:** ai-agent-development, llm-integration, prompt-engineering

---

Brain science shows up in courtrooms all the time now, but it's written for journals, not for the people who have to act on it. The CLBB NeuroLaw Library is thousands of peer-reviewed articles, amicus briefs, court cases, and expert affidavits on neuroscience and law, open to anyone with no account or paywall. When a document is published, the platform uses Google Gemini to write four more versions of it at different reading levels. Anyone can move one slider and read the same source at the depth they need, with the original always one click away.

## Technologies
Harvard CLBB NeuroLaw Library

## Sectors
AI Agents, AI, Education, Engineering

## Metrics

reading levels per document. The original plus four Gemini rewrites, behind one slider.

of resources. Articles, amicus briefs, cases, and expert affidavits, each made multi-level automatically.

citation formats for every resource (APA · AMA · MLA · NLM · Bluebook).

and fully public. No account, no paywall, no restriction.

## Read it at your level

Open a document and you get a Comprehension Slider. Drag it and the same text re-renders at a different reading level, from the original down to plain 5th-grade language. Every level is generated ahead of time and stored at publish, so switching is instant. The original sits at the end of the slider, so the text you'd actually quote is always one drag away.

## Sector

Education

Research

Legal

AI

## Scopes

Branding

UI/UX

Front-end

Back-end

LLM integration

Search

## Technologies

Next.js

React

Contentful

GraphQL

Typesense

Google Gemini

Vercel

![Image](https://cdn.sanity.io/images/zep746qw/production/9f14c623d2cdcdd16bc616df9c3379482c891f00-3870x2678.png)

## The problem it removes

Neurolaw research shapes sentencing, competency rulings, and appeals, but almost nobody it affects can read it. The audience is wide: defense attorneys, prosecutors, judges, advocates, clinicians, families, incarcerated people. The writing is narrow: dense, citation-heavy, one expert reading level. The old options were both bad. Publish the original and lose most readers, or hand-write simpler versions that don't scale and go stale on the next edit. The content was also split across document types with different metadata, so searching it meant knowing what each thing was called. The goal: every document readable at the reader's level, the whole library searchable from one box.

![Image](https://cdn.sanity.io/images/zep746qw/production/58b4bc472464e02da6cd8a065b4f743ceb8586d0-2560x2560.png)

## How it works

Two phases, kept apart on purpose. The slow AI work runs once at publish. Reading is fast.

**Generation (at publish).** An editor flips a generate flag and publishes. A webhook fires, the document body is converted to clean Markdown, and Gemini 2.5 Flash rewrites it at four reading levels under fixed rules: third person, no citations, keep the structure, about five paragraphs. A second pass pulls keywords. Each version is written back to Contentful as Rich Text, the original untouched, and the flag turns itself off so the job is safe to repeat. A separate webhook syncs the document into Typesense.

**Reading (at request).** Pages are static. The slider swaps pre-stored text with no model calls. One search covers every document type, with typo tolerance and synonyms. Filters cover type, state, court, circuit, jurisdiction, year, and topic. Every resource has citations in five formats, plus highlighting, notes, and print.

![Image](https://cdn.sanity.io/images/zep746qw/production/afb63571fbe941385253f73a1036f5ac1573927c-3840x2160.png)

## Can you trust the answer

The original is never replaced. The AI versions help people understand a document, they don't stand in for it. The original is always on the slider, and the quote and citation tools point back to it. You read the simple version, you cite the original.

Editors stay in control. Nothing generates automatically. An editor opts each document in, reviews the output in Contentful before it ships, and the rewriting rules live in an editable prompt, not in model weights.

## Why we built it this way

### 01. Why generate at publish, not on demand?

Reading needs to feel instant, and documents are read far more than they're edited. Generating once keeps reading free, cost predictable, and output reviewable.

### 02. Why an LLM, not hand-written levels?

Hand-writing four versions of every document doesn't scale and breaks on the next edit. The LLM makes it realistic while editors keep control.

### 03. Why keep the original front and center?

The audience argues cases and writes rulings. A simplified version can't quietly become the record, so the original stays the default and the thing you cite.

### 04. Why one model and one search index?

Readers think in questions, not content types. One index lets a single search and filter set cover the whole library.

### 05. Why headless Contentful, GraphQL, static rendering?

The team publishes without an engineer, the front end stays fast and typed, and edits go live in seconds.

![Image](https://cdn.sanity.io/images/zep746qw/production/81c9d32904eb6216e9a7027d0da7717e85798ea8-3866x2670.png)

## The hard part, stitching the journey

The hard part wasn't calling a model. It was making four kinds of documents act like one library, without damaging the source.

Articles, briefs, cases, and affidavits carry different metadata. They had to fit one model that a single search, one filter set, and one citation tool could serve, while keeping the details lawyers filter on. That mapping is what makes "every Ninth Circuit case since 2018, in plain language, with a Bluebook citation" a single click.

The rewriting adds its own problem. Each document moves from Rich Text to Markdown to Gemini and back, and has to come out with its structure intact. Assets are stripped before the model sees them, headers are locked down, and the result is written to its own field so the original is never overwritten.

## Why it worked

The model was the easy part. The real work was getting thousands of documents into one place and making each one readable at any level. The library now adjusts to whoever opens it, the original and a citation always within reach, and the team keeps full control. Because the heavy work runs once at publish and the rules live in editable prompts, it keeps growing without re-engineering.

![Image](https://cdn.sanity.io/images/zep746qw/production/39bbd5adb8f9cdf7c053384e55c2b2db27fab6f1-3840x2160.png)

## Testimonial

> "Monogram was integral to designing the CLBB NeuroLaw Library. They are the best of the best."
> 
> [GET REAL QUOTE]

**— Stephanie Tabashneck, Founding Director, CLBB NeuroLaw Library**

---
**View Project:** [Harvard NeuroLaw Library Engineering](https://clbbneurolawlibrary.com/)


## Contact Us

[Build what comes next](https://monogram.io/#contact) | Email: [hello+llm@monogram.io](mailto:hello+llm@monogram.io)

Provide your contact details and claim a time to meet. We'll help you do the rest.

Monogram is an Applied AI Studio based in Atlanta that designs and deploys production AI systems — connecting models, data, workflows, and enterprise software to automate real work.

The contact form collects: name, email, company, estimated budget (USD), a project description, and how you heard about Monogram.

Not sure where to start? Tell us what you're trying to automate or build — we'll help you figure out where AI fits.


---

**More content:** [Home](/.md) | [About](/about.md) | [Blog](/blog.md) | [Engineering](/engineering.md)

Monogram helps companies, organizations, and firms adopt AI by designing and building proof of concepts (POCs), MVPs, intelligent workflows, and production-ready AI applications.

Website designed and developed by [Monogram](https://monogram.io)