Challenge
- Patents are long, and reading claims and descriptions back and forth in English is hard work
- Once patents gathered by topic are scattered, nobody can find which one held a given drafting precedent
Approach
- Store bibliographic data, abstract, claims and description of each public patent verbatim in structured form, and split translation into slices handled by agents
- Write each corpus's scope into its manifest, and provide one search MCP across all corpora
Outcome
- Reading pages show literal and free translations under the English, with a dictionary on hover
- Research and design work can pull the relevant passage of any patent through the MCP
The author built this corpus of public patents only, to research patents related to AI and development methods. Each topic has its own corpus, with a written statement of what it includes and excludes.
As a data layer it handles only input and completeness, never conclusions or judgements. Analysis happens in separate work that cites the corpus.
The full workflow
| Task | Who | Inputs | Outputs |
|---|---|---|---|
| 1. Define scope | Main session | — | Corpus scope |
| 2. Fetch text | Fetcherfetch_extract.py | Corpus scope | English text |
| 3. Plan slices | Slice plannergen_plan.py | English text | Slice plan |
| 4. Translate | Translators + Fan-out scriptone per slice + workflow .js | Slice plan | Slices |
| 5. Merge | Mergermerge.py | Slices | Merged text |
| 6. Check | Checkercheck_corpus.py | Merged text | Check report |
| 7. Build pages | Page buildergen_html.py | Check report | Reading pages |
| 8. Cross-search | Search MCPpatent_server.py | Check report | Search hits |
8 steps · 1 role · 7 tools · 1 loop · 3 corpora, 42 patents, 26 translated
Store the English exactly as fetched, let agents translate slice by slice in parallel, and publish to pages and search only after the machine check passes.
- As a data layer it handles only intake and completeness; no analysis or conclusions are written here
- Original and translation are separate files, so fixing a translation never touches the original
- The only model work is translation in step 4; fetching, slicing, merging, checking, pages and search are scripts and a server
- The checker decides when a corpus is done; in strict mode, anything untranslated fails
Project folders involved (3)
This workflow does not live in one folder: it runs across projects.
- (private) patent data folder
- The core: corpora, pipeline scripts and the search server
- patent-mcp plugin
- The author's plugin bundling the search server, enabled per project
- (private) research folders
- Separate work that cites the corpora; conclusions are written there
Step 1 · Main session
Define scopemeta.scope
Write down, per corpus, what goes in and what stays out.
- Only published patent documents are included
- The boundary is written inside the manifest, never left to be guessed from folder names
- Each topic gets its own corpus, with groups and topics for filtering
| Outputs | Corpus scope |
Step 2 · Fetcher
Fetch textfetch_extract
Fetch the full English text from the public page in structured form.
- Bibliographic data, abstract, claims and description are stored exactly as fetched
- Classification, citations, family and legal events come along as bibliographic fields
- Translated corpora use a bibliography-only update mode, because re-fetching the body breaks its alignment with the translation
Common misconceptionRe-fetching is not harmless: overwriting a translated body shifts the paragraph alignment
| Inputs | Corpus scope |
| Outputs | English text |
Step 3 · Slice planner
Plan slices30 paragraphs
Split the translation into slices one agent can handle.
- Each patent gets one slice for title, abstract and all claims
- The description is cut into slices of 30 paragraphs
- The first corpus of 20 patents came to 157 slices
| Inputs | English text |
| Outputs | Slice plan |
Step 4 · Translators + Fan-out script
Translatelit + free
Send one agent per slice in parallel to write literal and free translations.
- Claims get both a literal and a free translation; the description is translated paragraph by paragraph
- The translated paragraph count must equal the original's, and each agent writes only its own slice file
- Every agent receives the same terminology list and the rule to keep figure numbers and reference signs unchanged
Claude CodeA workflow script fans the slices out; general-purpose subagents do the translating
| Inputs | Slice plan |
| Outputs | Slices |
Step 5 · Merger
Mergemerge.py
Merge the slices into one translation per patent.
- The merged translation lives in a file separate from the original
- Translations come in two shapes, plain strings and literal/free pairs; that is a convention, not an error
- Every consumer goes through one shared function, so both shapes are handled the same way
| Inputs | Slices |
| Outputs | Merged text |
Step 6 · Checker
Checkcheck_corpus
Check structural completeness and decide whether the corpus is done.
- It counts untranslated patents and empty translated paragraphs
- A non-zero exit code means fail
- Strict mode also fails anything untranslated and is used to accept a finished corpus
| Inputs | Merged text |
| Outputs | Check report |
Step 7 · Page builder
Build pagesgen_html
Build reading pages with literal and free translations under the English.
- Hovering over an English word shows a dictionary entry, cut down per page to what is needed
- A panel at the bottom right toggles literal, free and translated text
- Pages can always be rebuilt, so they are kept out of the repository
| Inputs | Check report |
| Outputs | Reading pages |
Step 8 · Search MCP
Cross-search8 MCP tools
Search across all corpora at once.
- Eight tools; the corpus list is always fetched first instead of guessing names
- An empty corpus name searches across all corpora; on the Chinese side both literal and free translations are searched
- The server ships in the author's plugin and is enabled only in the projects that use it
| Inputs | Check report |
| Outputs | Search hits |
Loops and rework
- Untranslated or empty paragraphs → step 4: Only the missing slices go back to the agents, then merge and check run again
Key points
Keep original and translation apart. The English full text is stored exactly as fetched; translations are written as separate slice files and then merged. Fixing a translation never touches the original.
Update only bibliographic data once a corpus is translated. Re-fetching full text rewrites the body and breaks its alignment with the translation, so translated corpora use a bibliography-only update mode.
Let the checker decide completion. A corpus is not considered done until the structural integrity checker passes; in strict mode, untranslated items also fail.