Case study · 2025 · LegalTech · AI

Putting Claude inside a proposal editor — and getting a DOCX out the other side

An AI-streaming rich-text editor for an EU tendering firm. Plate.js for the canvas, Claude for the inline completions, a custom DOCX exporter for the deliverable. A separate Python AI service handles the heavy retrieval work in the background while the editor stays at 60fps.

  • ClientEU tendering firm
  • IndustryLegalTech · Public-sector proposals
  • Year2025
  • EngagementMulti-app build · retained operation
Scriva proposal editor — a rich-text document with AI-suggested paragraphs highlighted in teal and a floating toolbar offering Insert, Rewrite, and Cite source actions.
01 — At a glance
Inline
AI in the editorStreaming completions arrive *inside* paragraphs, not in a side panel.
1-click
DOCX exportFormatting, headings, lists, tables preserved end-to-end.
Multi-app
ArchitectureEditor frontend, AI service, document service — separately deployable.
Summary

Proposal writers in the public-tender world live in two windows simultaneously — a Word document and a research browser. Scriva collapses those into one. A Plate.js editor with Claude streaming directly into the canvas, source-cited paragraphs anchored to the originating document, and a one-click export that produces a DOCX a procurement officer cannot tell from one a human typed. Behind the editor sits a Python AI service that handles the heavy retrieval and a document service that handles parsing and storage — three apps in a monorepo, each independently deployable.

The problem

Procurement was held together with Excel and goodwill.

EU public tenders are won and lost in the editor. A tendering team typically receives a 60-to-200-page request-for-proposals document, has 14 to 28 days to respond, and produces a deliverable that must conform to the original document's structure, terminology, and citation expectations *exactly*. Off-by-one section numbering disqualifies. Mis-stating a regulatory reference disqualifies. Using a phrasing that doesn't track the source-language definition can disqualify.

So writers live in two windows. Word, where the proposal is being typed. Browser, where the RFP PDF and a dozen regulatory references are open. They alt-tab thousands of times per proposal. They paraphrase by hand. They lose citations between paragraphs. And the final DOCX must be assembled by hand into the template the procuring authority distributed — including font, margins, header logo, signature block.

Writers were alt-tabbing thousands of times per proposal and rebuilding the DOCX template by hand at the end of every cycle. The AI tools that existed didn't fit the actual job.

Generic AI editors are nowhere near this work. Notion AI is built for blog posts. ChatGPT lives outside the document. Microsoft Copilot is Word-shaped and not great at multi-document retrieval. The team had tried all three and was building proposals the old way regardless.

What they wanted was specific: a real rich-text editor with the formatting fidelity to produce a regulator-grade DOCX, an AI that could be invoked *inside* a paragraph and stream tokens into the live document, citations that linked to the source PDF, and a retrieval layer that already knew which regulations applied to which proposal type.

Scriva editor — streaming Claude completion appearing inline in a Plate.js paragraph, with subtle teal highlight marking the AI-authored range.

AI completions stream *into* the paragraph, not into a side panel. The writer keeps their hands on the document.

02 — Why us

Why they chose Synara

Most teams that quoted them an AI editor planned to wrap an existing editor library and bolt a side panel onto it. Side panels are the wrong product. Writers don't want to read AI output in a different surface and copy-paste it across — they want the AI to type *into* the paragraph they're already in. That's a hard editor problem, not an AI problem, and the team that solved it had to be comfortable extracting and modifying a real rich-text engine.

We chose to base the editor on Plate.js (which sits on Slate) precisely because it gives us extension points all the way down to the rendering loop. We pulled the relevant portions of Plate into our codebase via an internal registry pattern — editor self-contained, zero hidden runtime dependencies except `@/lib/utils`. That decision unlocked everything downstream: streaming AI directly into a paragraph, custom decorations for citation links, DOCX export with full formatting fidelity, all on a single in-house editor surface.

03 — What we built

A three-portal procurement platform — buyer, supplier, admin.

Scriva proposal editor rendered on a MacBook on a charcoal oak desk in a legal-office library — rich text body, floating AI toolbar, DOCX export pill in the corner.
01

Streaming AI inside the paragraph

Place the cursor anywhere, invoke the AI with a hotkey or floating toolbar, and Claude tokens stream *into* the paragraph in real time. Subtle teal highlighting marks AI-authored ranges so the writer can review and lock down language before export.

02

Source-cited completions

Every AI completion is anchored to the originating document and page range. Click a citation marker in the editor to open the source PDF at the cited paragraph. Citations survive DOCX export as footnote-style references.

03

DOCX export with formatting fidelity

Single-click export to a DOCX that preserves headings, lists, tables, footnotes, page breaks, and embedded images. Built on `@platejs/docx-io` with custom serializers for the structures procurement authorities expect.

04

Multi-document retrieval-aware AI

The AI service indexes the active RFP plus a configurable corpus of regulatory and prior-proposal references. Completions and rewrites are grounded against this corpus and never fabricate a citation that isn't in the indexed set.

05

Section-aware floating toolbar

The AI toolbar adapts to the current section's type — executive summary, technical approach, pricing schedule, references — and offers context-appropriate actions: Rewrite formally, Compress, Expand with citation, Convert to bullet list.

06

Document service with versioning

Every proposal is versioned at the section level. Writers can compare two versions side by side, restore a previous section, and audit every AI invocation by author, prompt, and timestamp.

Scriva's DOCX export panel — preserved formatting, embedded citations, downloadable in a single click.

Single-click export to a DOCX a procurement officer cannot tell from one a human typed.

04 — Architecture

In plain English, why each choice.

Editor frontend
Vite + React 18 application built around an in-house Plate.js editor. We pulled the relevant portions of Plate into our codebase via a registry pattern so the editor has zero hidden runtime dependencies. Streaming AI uses Vercel AI SDK on the client side, wired to the AI service over Server-Sent Events.
AI service
Python service that owns retrieval, embedding, and the orchestration of Claude calls. Why a separate service rather than running everything from the Next-adjacent stack: retrieval is CPU-heavy and memory-resident, and we wanted to scale it independently of the editor. The Python service exposes a small typed HTTP surface; Claude is the underlying LLM.
Document service
Next.js (separately deployable) handles document storage, parsing, versioning, and the DOCX export pipeline. It exposes a typed API consumed by both the editor and any future client. Parsing uses tuned PDF extractors per document class; export uses `@platejs/docx-io` with custom serializers.
Proposal-creator service
A fourth small service handles bulk document generation — populating a templated DOCX with project metadata, signatures, header logos. Triggered at the end of the proposal lifecycle, kept separate so its templates can evolve without redeploying the editor.
Data layer
Postgres with Drizzle for the document service. Embeddings stored alongside source-document metadata; the AI service hits the same database in read-only mode for retrieval. Section-level versioning is modeled as an append-only history table.
Monorepo + infra
Turborepo with pnpm. Four apps (editor, AI service, document service, proposal-creator), shared packages for the editor primitives, the DOCX exporter, and the typed API contracts. Each app deploys independently — Vercel for the Next pieces, a container runtime for the Python AI service.
05 — Outcomes

What changed after launch.

60fps
Editor performanceStreaming AI tokens into the paragraph without UI jank.
1-click
Export round-tripDOCX produced and downloadable from any document version.
Audit-grade
VersioningEvery AI invocation logged with author, prompt, range, timestamp.
4-app
ArchitectureEditor, AI, document, proposal-creator — independently deployable.

MethodologyPerformance numbers measured on the production staging environment with a representative proposal corpus. Export fidelity verified against three procurement-authority DOCX templates the client routinely receives. Versioning audit-grade is a property of the data model.

The first AI editor where I stop noticing the AI. I write, it offers, I keep writing. The DOCX at the end is what we used to spend a Saturday assembling.

Senior proposal writerEU tendering firm
06 — What’s next

Multi-language proposal mode — English, German, French side by side with linked sections. A team-collaboration layer for parallel writers on the same proposal. Deeper retrieval against the firm's historical proposal corpus so completions can cite the firm's *own* prior winning language.

Stack
  • Vite
  • React 18
  • Plate.js
  • Slate
  • Vercel AI SDK
  • Claude
  • Next.js
  • Python
  • Postgres
  • Drizzle ORM
  • @platejs/docx-io
  • Turborepo
  • pnpm

Building an AI editor for a domain where formatting matters?

Generic AI editors don't survive contact with regulator-grade documents. If your team produces tenders, legal filings, clinical reports, or any deliverable with strict format and citation requirements — we can scope an in-house editor that meets the format, not just the language.

Start a conversation