AI Research Suite
Point your own AI assistant at this corpus — your model, your account, no key needed from us. Connect it over MCP, or call the public API directly, and it can browse, read, search, and concordance 96,093 pages across 750 texts.
You do not need to be a programmer, and you do not need to install anything. Step 1 below works with the free version of most chat assistants.
Start here — no setup needed
If you already use ChatGPT, Claude, Gemini or Copilot in a web browser, you can put this library to work in about a minute.
- Copy the block of text below, using the Copy button.
- Open a new chat with your assistant and paste it in as the first message. Nothing much will seem to happen — that is fine. It is instructions, not a question.
- Now ask your research question in ordinary language. The assistant will search this library and answer with links back to the original pages.
You are a research assistant for classical Vietnamese Hán-Nôm texts. You have read-only access to the Việt Điển corpus — 750 digitized Hán-Nôm texts (96,093 pages of OCR) — through a public JSON API (HTTP GET, no auth) at https://www.viet-dien.com. Endpoints — reach for distribution and concordance first; they answer most questions in one call, where search makes you page through results: - https://www.viet-dien.com/api/v1/distribution?q=<query> Which texts carry <query>, and how heavily, heaviest first. Call this first on a broad question, to choose what is worth reading. - https://www.viet-dien.com/api/v1/concordance?q=<query>&width=30 Every occurrence of <query> across the corpus, one line each with context either side. This is how you read usage: senses, collocations and set phrases show themselves when the occurrences are lined up together, and one-snippet-per-page search hides them. - https://www.viet-dien.com/api/v1/search?q=<query> Pages whose OCR contains <query>, one snippet each. Returns text_id, title, title_han, item_id, page_number, snippet, viewer_url. - https://www.viet-dien.com/api/v1/texts?q=<title> Find texts by romanized or Hán (Sinitic) title. - https://www.viet-dien.com/api/v1/texts/<id> A text's metadata and list of page numbers. - https://www.viet-dien.com/api/v1/texts/<id>/pages/<n>?context=1 The OCR of one page, plus the source page-image URL. A classical sentence runs straight across the page break, so pass context=1 when quoting near a page edge, or the clause ends mid-air. - https://www.viet-dien.com/api/v1/texts/<id>/full.txt A whole work as plain text, pages marked — use it instead of forty page fetches when you need to read a text through. - https://www.viet-dien.com/api/v1/variants?q=<char> Which other glyph forms search treats as this character, so you can explain a match rather than assert it. Search syntax (all of it works in q=, and is worth using — the words of a classical collocation are often separated, so a plain phrase search misses them): 國家 the characters together, in order "見聞 小錄" quoted phrase 國 AND 家 both somewhere on the same page 國家 OR 天下 either one 國 NOT 家 the first, without the second 國 NEAR/10 家 within 10 characters of each other 國?家 ? is any single character 見聞*錄 * is a short gap (up to 8 characters) Malformed queries return HTTP 400 with a "detail" message explaining the problem. Requests are rate limited to 60/minute and 1000/hour per client, so work through results steadily rather than fanning out; HTTP 429 means slow down and retry. How to help me: 1. Search first, then fetch the specific pages you cite. 2. The material is Classical Chinese / Chữ Nôm and the OCR is machine-generated, so it may contain errors — read critically and flag uncertainty. 3. Always include Việt Điển links in your answers: cite every source as a clickable link to its viewer_url (a page on https://www.viet-dien.com) so I can open the original page image and OCR. Never cite a page without linking it. 4. For a character or phrase, tell me which texts and pages it appears on, link each with its viewer_url, and quote the surrounding snippet. Corpus source: Digitizing Vietnam (https://www.digitizingvietnam.com).
This works best with an assistant that can browse the web. If yours replies that it cannot open links, it cannot reach the library — try step 2 instead, or a different assistant.
Connect over MCP
optionalSome assistants can be given tools of their own. If yours has a setting called Connectors, Integrations or MCP servers, adding the single address below beats step 1: the assistant gets purpose-built search tools, and you never have to paste instructions again.
https://www.viet-dien.com/mcp
Where to put it
- •Claude (claude.ai or the desktop app): Settings → Connectors → Add custom connector, then paste the address. Available on the paid plans.
- •ChatGPT: Settings → Connectors, then add it as a custom MCP connector. You may have to turn on developer mode first.
- •Cursor, Claude Code and most other tools that mention “MCP”: look for Add server, and choose the HTTP or remote-URL option.
The exact wording of these menus changes from time to time; you are looking for anywhere that asks for the address of a remote MCP server. Once it is added the assistant already knows how to use the library, so you can go straight to asking questions — no text to paste.
Advanced: paste into a configuration file instead
{
"mcpServers": {
"viet-dien": {
"type": "http",
"url": "https://www.viet-dien.com/mcp"
}
}
}
What to ask
Ask in ordinary language — English, Vietnamese or Chinese — and give the characters where you have them. Some questions that suit a collection like this:
“Which of these texts discuss 科舉, the civil service examinations, and which one has the most to say about it?”
A good opening move on any topic: it tells you which works are worth reading before you commit to reading them.
“Find every place 皇越 appears, and show me the line around each one.”
Lining occurrences up side by side is how you see what a phrase means in use, rather than what a dictionary says it means.
“Does 見聞 appear near 小錄 anywhere? Not necessarily side by side — within about ten characters.”
The words of a classical phrase are often separated on the page. Asking for “near” rather than “exactly” finds what a plain search would miss.
“Read the first ten pages of Kiến văn tiểu lục volume 1 and summarise what it covers, page by page.”
For getting your bearings in an unfamiliar work before deciding where to read closely.
Reading the answers
- The text the assistant reads is machine transcription of woodblock printing, and it is uncorrected. Individual characters are sometimes simply wrong.
- Click through. Every answer should carry links to pages on this site, where the original scan sits beside the transcription. Treat any claim without a link as unverified.
- “Not found” is weak evidence. A phrase may be present but mistranscribed, or in a work not yet digitized. Absence here is not absence in the record.
- Cite the original, not the assistant. Follow the link, read the page yourself, and cite the text and page as you would from a library.
For developers API reference, tool list, schemas
Public API
The same corpus over plain HTTP GET, for a client that does not speak MCP. Read-only, CORS-enabled JSON. No key required. Base URL:
https://www.viet-dien.com
| GET /api/v1/stats | Corpus totals | Try it ↗ |
| GET /api/v1/texts?q=易&limit=20 | List / filter texts by title | Try it ↗ |
| GET /api/v1/texts/11 | A text's metadata + page numbers | Try it ↗ |
| GET /api/v1/texts/11/pages/1?context=1 | A page's OCR + image URL, with the pages either side | Try it ↗ |
| GET /api/v1/texts/11/full.txt | A whole work as plain text | Try it ↗ |
| GET /api/v1/search?q=國&limit=20 | Full-text OCR search | Try it ↗ |
| GET /api/v1/concordance?q=國家&width=30 | Every occurrence of a term, in context | Try it ↗ |
| GET /api/v1/distribution?q=國家 | Which texts carry a term, heaviest first | Try it ↗ |
| GET /api/v1/variants?q=為 | A character's interchangeable forms | Try it ↗ |
| GET /api/openapi.json | OpenAPI 3 schema (for tool import) | Try it ↗ |
Tools your assistant gets
| search_corpus | Find pages whose text contains a query, with a snippet of each. Good for "where does this appear"; for "how is it used" prefer concordance, and for "which works" prefer distribution. |
| concordance | Every occurrence of a term across the corpus, one line each with context either side (a KWIC concordance). This is the tool for reading usage: senses, collocations and formulae show up when the occurrences are lined up together, which one-snippet-per-page search hides. |
| distribution | Matching pages grouped by work, heaviest first. Call this first on any broad question: it tells you where a term lives before you spend calls reading pages. |
| get_page | One page's OCR text, with the URL of the source page image and a viewer link to cite. Pass context to pull in the pages either side — a classical sentence runs across the page break, so a quotation from one page alone can end mid-clause. |
| get_full_text | A whole work (or a run of pages) in one call, pages marked. Use it instead of forty get_page calls when you need to read a text through rather than check a citation. Ask for a page range on a long work. |
| list_texts | The works in the corpus, filtered by title — romanized (Đại Việt sử ký) or Sinitic (大越史記) — or by catalogue field: author, year of composition, subject, language. Use it to find a work by who wrote it, when, or what it is about; use distribution to find one by content. Diacritics are ignored throughout, so "nguyen" finds "Nguyễn". Cataloguing is uneven: an author is recorded for about 39% of the corpus and a year for about 49%, so a year filter cannot see the undated remainder — do not report an empty or short result as evidence that the corpus holds nothing of that kind. |
| get_text_info | One work's metadata and the page numbers actually digitized (they need not be contiguous), plus links to the viewer and to the item on Digitizing Vietnam. |
| char_variants | Which other forms of a character search treats as the same. Woodblock carvers used whichever glyph they liked, so 為 and 爲 are one word; this reports the grouping, so you can explain a match rather than assert it. |
| corpus_stats | How many works and pages are currently digitized. Worth checking before making a claim about coverage. |
Other ways to connect
- • ChatGPT (Custom GPT / Actions): import the OpenAPI schema. https://www.viet-dien.com/api/openapi.json
- • Inspect the MCP server from a browser (tool list and instructions, as JSON): https://www.viet-dien.com/mcp/tools.json