Overview
Two kinds of software meet when AI is added to a document application. A language model understands what a user asks for and writes text; a document engine such as TX Text Control creates, edits, converts and exports the documents themselves. AI integration connects the two, so that each does its own part and the application stays in control of the workflow.
The pages of AI Integration build on each other: the concepts and building blocks come first, followed by the packages, the models, the tasks and the samples. Code that uses a model relies on the TX Text Control AI preview or on earlier samples with OpenAI's hosted API.
Language and Documents
The responsibilities are divided into three layers:
- The language model handles language. It interprets a request, summarizes, extracts information, rewrites text and plans document actions.
- The integration layer manages the workflow. Your application decides which context and which tools the model gets, checks what it proposes and shows the results.
- The document engine performs the document operations. TX Text Control changes text, styles, tables, fields, formatting and document structure, and it lays out and exports the documents.
A model turns a prompt into structured tool calls and never has to understand the internals of a DOCX or PDF file. Because the layers are separate, you can change the model, replace the user interface or move inference to another host without rebuilding the rest of the application.
Work that needs no reasoning, such as converting documents to Markdown or classifying documents of known types, belongs in code rather than in a model. Split the Work Between Code and Model describes which tasks go where.
The Building Blocks
| Building block | What it does | Described in |
|---|---|---|
ServerTextControl | Loads documents, extracts their text or Markdown, applies changes and exports DOCX and PDF | Chat with Documents, Document Analysis |
| TX Text Control AI | A preview of six NuGet packages and ten sample applications for local models, document tools, web endpoints and knowledge | Text Control AI |
| Local inference | Runs GGUF models with llama.cpp on hardware you control | Local / Private LLMs |
| Private knowledge | Indexes approved documents and retrieves passages that ground answers | RAG |
| MCP document server | Offers document operations of TX Text Control as tools that models call through the Model Context Protocol (MCP) | MCP Document Server |
| Text Control MCP Server | Gives AI coding assistants read-only access to documentation, blog articles and product information; it doesn't process documents | AI Coding Assistants |
| Agent Skills | Teach AI coding assistants how to build applications with the Document Editor and ServerTextControl | AI Coding Assistants |
What You Can Build
| Workflow | Read |
|---|---|
| Ask questions about a contract or summarize it | Chat with Documents |
| Classify documents, extract invoice data as JSON, explain tracked changes or describe images for accessible PDF documents | Document Analysis |
| Answer from approved policies or compare a document with approved reference material | RAG |
| Generate proposals, invoices, agendas, reports or letters from a request and export them as PDF | MCP Document Server |
| Rewrite selected text in the Document Editor, change a named style or work with tables, fields and templates | Agent Workflows |
Local and Hosted Models
The TX Text Control AI preview runs models locally by default, on hardware whose owner controls where inference runs. Since version 0.1.0-beta.2, it can also use OpenAI and OpenAI-compatible APIs, and the earlier samples in the Text Control blog call OpenAI's hosted API; a hosted model receives the prompts and the document text in them. Local / Private LLMs describes what local means and compares the options.
Data Protection and Review
- Local isn't compliant by itself. A local model gives you architectural control, not security or regulatory compliance. Authentication, authorization, encrypted transport, retention, logging, backups and operating system security remain your responsibility. The web sample of the preview, for example, uses external resources during setup and loads Google Fonts by default; an isolated deployment provisions its dependencies through approved channels, hosts web assets itself and controls outbound traffic.
- External providers receive content. Choosing a hosted model sends prompts, document content and tool results to the provider. Private reference knowledge is sent only to an inference endpoint that the host explicitly approves, and the retrieved passages then leave the host.
- Documents are data. Text inside a document or a retrieved passage never grants permission to run tools.
- Results need review. Generated content and proposed edits should be reviewable. Tool calling and structured output need a compatible model, and a valid JSON answer isn't proof of a correct one. Retrieval doesn't train the model, and it doesn't guarantee that every relevant passage was found.
Preview Status
TX Text Control AI is a preview, version 0.1.0-beta.3 at the time of writing, whose APIs and behavior may change before the stable release. Its license, .NET targets and platforms are listed in Requirements in Text Control AI.
Next Steps
- Text Control AI: the packages, the architecture and the samples.
- Chat with Documents: a first program that answers questions about a PDF.
- Examples: all AI samples with their repositories.